diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2019-12-28 17:12:57 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2019-12-28 17:12:57 +0100 |
commit | 5fc601f5484c9463e3399c0e690db80b9c22386e (patch) | |
tree | 3574b43f98f25e7bbf9dfdcb3e90d54f23e8ae0c /bin/scons-proc.py | |
parent | 10b9d3fe4386c06efbb4d971e4e307b89e254faa (diff) | |
parent | 56597a6a68e741355b301f91d5913d59cfb34eaa (diff) |
Update upstream source from tag 'upstream/3.1.2'
Update to upstream version '3.1.2'
with Debian dir 7ef381d8ee1bc3570b5feec63204df7f87ac1cb2
Diffstat (limited to 'bin/scons-proc.py')
-rw-r--r-- | bin/scons-proc.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/bin/scons-proc.py b/bin/scons-proc.py index e09c853..d8b37df 100644 --- a/bin/scons-proc.py +++ b/bin/scons-proc.py @@ -32,8 +32,8 @@ Options: -t file(s) dump tool information to the specified file(s) -v file(s) dump variable information to the specified file(s) - Regard that each -[btv] argument is a pair of - comma-separated .gen,.mod file names. + The "files" argument following a -[bftv] argument is expected to + be a comma-separated pair of names like: foo.gen,foo.mod """ @@ -70,7 +70,9 @@ def parse_docs(args, include_entities=True): sys.stderr.write("error in %s\n" % f) raise else: - content = open(f).read() + # mode we read (text/bytes) has to match handling in SConsDoc + with open(f, 'r') as fp: + content = fp.read() if content: try: h.parseContent(content, include_entities) @@ -166,6 +168,7 @@ class SCons_XML(object): # Write file f = self.fopen(filename) stf.writeGenTree(root, f) + f.close() def write_mod(self, filename): try: @@ -212,6 +215,7 @@ class SCons_XML(object): v.tag, v.entityfunc(), v.tag)) f.write('\n') f.write(Warning) + f.close() class Proxy(object): def __init__(self, subject): @@ -348,7 +352,7 @@ processor_class = SCons_XML # Step 1: Creating entity files for builders, functions,... print("Generating entity files...") -h = parse_docs(args, False) +h = parse_docs(args, include_entities=False) write_output_files(h, buildersfiles, functionsfiles, toolsfiles, variablesfiles, SCons_XML.write_mod) @@ -362,7 +366,7 @@ else: # Step 3: Creating actual documentation snippets, using the # fully resolved and updated entities from the *.mod files. print("Updating documentation for builders, tools and functions...") -h = parse_docs(args, True) +h = parse_docs(args, include_entities=True) write_output_files(h, buildersfiles, functionsfiles, toolsfiles, variablesfiles, SCons_XML.write) print("Done") |