Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions distrib/gen_gps.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ def recursive_ls(dir):
"""Return the list of ads files in dir and its subdirs"""
result = set()
for f in os.listdir(dir):
path = os.path.join(dir, f)
if f.endswith(".ads") \
and f.startswith("gnatcoll-"):

private = False
pkg = ""
for l in file(os.path.join(dir, f)).readlines():
with open(path) as h:
for l in h.readlines():
m = pkg_re.search(l)
if m:
private = m.group(1)
Expand All @@ -26,18 +28,18 @@ def recursive_ls(dir):
if not private:
result.add((pkg, os.path.splitext(f)[0]))

elif os.path.isdir(os.path.join(dir, f)):
result = result.union(recursive_ls(os.path.join(dir, f)))
elif os.path.isdir(path):
result = result.union(recursive_ls(path))

return result

list = recursive_ls("../src")
out = file("gnatcoll/runtime.py", "wb")
out.write("""XML = r'''<?xml version="1.0"?>
with open("gnatcoll/runtime.py", "w") as out:
out.write("""XML = r'''<?xml version="1.0"?>
<GPS>
""")

for pkg, f in sorted(list):
for pkg, f in sorted(list):
if '__' in f:
# An internal package with a specific naming scheme
continue
Expand All @@ -61,8 +63,7 @@ def recursive_ls(dir):

""" % {"file": f, "menu": menu, "package": pkg})

out.write("""</GPS>'''
out.write("""</GPS>'''
import GPS
GPS.parse_xml(XML)
""")
out.close()