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 (17 lines) | stat: -rwxr-xr-x 404 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env python3

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

import glob
import os.path

includes = glob.glob("lua/*.h")
sources  = glob.glob("src/*.c")

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