diff --git a/scripts/gendoc.py b/scripts/gendoc.py index d2b0d75e..611d0d10 100755 --- a/scripts/gendoc.py +++ b/scripts/gendoc.py @@ -253,13 +253,12 @@ def run_through_template(input): ] if VERBOSE: args.insert(2, "-v") + log("EXEC: %s" % " ".join(args)) log(" ==== build.py output ==== ") - log( - subprocess.check_output( - args, - stderr=out, - cwd="../templating" - ) + print subprocess.check_output( + args, + stderr=out, + cwd="../templating" ) except subprocess.CalledProcessError as e: with open(tmpfile, 'r') as f: diff --git a/templating/batesian/sections.py b/templating/batesian/sections.py index 31849389..c18c9a5f 100644 --- a/templating/batesian/sections.py +++ b/templating/batesian/sections.py @@ -16,7 +16,7 @@ class Sections(object): def log(self, text): if self.debug: - print text + print "batesian:sections: %s" % text def get_sections(self): render_list = inspect.getmembers(self, predicate=inspect.ismethod) diff --git a/templating/batesian/units.py b/templating/batesian/units.py index c20a2d1f..993f253d 100644 --- a/templating/batesian/units.py +++ b/templating/batesian/units.py @@ -22,7 +22,7 @@ class Units(object): def log(self, text): if self.debug: - print text + print "batesian:units: %s" % text def get_units(self, debug=False): unit_list = inspect.getmembers(self, predicate=inspect.ismethod) diff --git a/templating/build.py b/templating/build.py index ac3d2491..013248f4 100755 --- a/templating/build.py +++ b/templating/build.py @@ -52,8 +52,8 @@ def create_from_template(template, sections): def check_unaccessed(name, store): unaccessed_keys = store.get_unaccessed_set() if len(unaccessed_keys) > 0: - print "Found %s unused %s keys." % (len(unaccessed_keys), name) - print unaccessed_keys + log("Found %s unused %s keys." % (len(unaccessed_keys), name)) + log(unaccessed_keys) def main(input_module, file_stream=None, out_dir=None, verbose=False): if out_dir and not os.path.exists(out_dir): @@ -121,17 +121,19 @@ def main(input_module, file_stream=None, out_dir=None, verbose=False): return # check the input files and substitute in sections where required - print "Parsing input template: %s" % file_stream.name + log("Parsing input template: %s" % file_stream.name) temp = Template(file_stream.read()) - print "Creating output for: %s" % file_stream.name + log("Creating output for: %s" % file_stream.name) output = create_from_template(temp, sections) with open( os.path.join(out_dir, os.path.basename(file_stream.name)), "w" ) as f: f.write(output) - print "Output file for: %s" % file_stream.name + log("Output file for: %s" % file_stream.name) check_unaccessed("units", units) +def log(line): + print "batesian: %s" % line if __name__ == '__main__': parser = ArgumentParser( @@ -175,7 +177,7 @@ if __name__ == '__main__': sys.exit(0) if not args.file: - print "No file supplied." + log("No file supplied.") parser.print_help() sys.exit(1)