File: replace.py

package info (click to toggle)
gringo 3.0.4-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 3,116 kB
  • sloc: cpp: 45,083; ansic: 4,368; yacc: 477; makefile: 194; python: 22
file content (19 lines) | stat: -rwxr-xr-x 656 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python3

# small script that brings the includes in line with the bingo project

import glob
import os.path

includes = glob.glob("luasql/*.h") + glob.glob("luasql/*.h.in")
sources  = glob.glob("src/*.c") + glob.glob("src/*.cpp")
lua      = [ os.path.relpath(x, "../liblua") for x in glob.glob("../liblua/lua/*.h") ]

for x in includes + sources:
	content = open(x).read()
	for y in includes + lua:
		z = os.path.basename(y)
		content = content.replace('#include "{0}"'.format(z), '#include <{0}>'.format(y))
	content = content.replace("See Copyright Notice in license.html", "See Copyright Notice in COPYING")
	open(x, "w").write(content)