Commit 11976727 authored by Matthias Braun's avatar Matthias Braun
Browse files

output documentation to file on request

parent e9412b5e
......@@ -127,8 +127,14 @@ def prepare_nodes():
return real_nodes
def main(argv):
output = sys.stdout
if len(argv) > 1:
output = open(argv[1], "w")
real_nodes = prepare_nodes()
time = datetime.now().replace(microsecond=0).isoformat(' ')
sys.stdout.write(docu_template.render(nodes = real_nodes, time=time))
output.write(docu_template.render(nodes = real_nodes, time=time))
if output != sys.stdout:
output.close()
main(sys.argv)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment