From a74fb54053eb9c247a4af1f5fa3fe59e891204d5 Mon Sep 17 00:00:00 2001 From: Daniel Wagner-Hall Date: Thu, 10 Sep 2015 13:44:41 +0100 Subject: [PATCH 1/3] Correct comment --- scripts/gendoc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gendoc.py b/scripts/gendoc.py index 47141d7d8..57a047174 100755 --- a/scripts/gendoc.py +++ b/scripts/gendoc.py @@ -76,7 +76,7 @@ def main(): if __name__ == '__main__': if len(sys.argv) > 1 and sys.argv[1:] != ["--nodelete"]: - # we accept no args, so they don't know what they're doing! + # we accept almost no args, so they don't know what they're doing! print "gendoc.py - Generate the Matrix specification as HTML." print "Usage:" print " python gendoc.py" From cdc06a8bf1c410147a7cd096c2a9169914285852 Mon Sep 17 00:00:00 2001 From: Daniel Wagner-Hall Date: Thu, 10 Sep 2015 13:53:38 +0100 Subject: [PATCH 2/3] Document --nodelete --- scripts/gendoc.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/gendoc.py b/scripts/gendoc.py index 57a047174..e3c3797e4 100755 --- a/scripts/gendoc.py +++ b/scripts/gendoc.py @@ -79,9 +79,11 @@ if __name__ == '__main__': # we accept almost no args, so they don't know what they're doing! print "gendoc.py - Generate the Matrix specification as HTML." print "Usage:" - print " python gendoc.py" + print " python gendoc.py [--nodelete]" print "" print "The specification can then be found in the gen/ folder." + print ("If --nodelete was specified, intermediate files will be " + "present in the tmp/ folder.") print "" print "Requirements:" print " - This script requires Jinja2 and rst2html (docutils)." From 99106bb6fefd0b2f44c1ff418491f7d54c52cc8c Mon Sep 17 00:00:00 2001 From: Daniel Wagner-Hall Date: Thu, 10 Sep 2015 13:54:00 +0100 Subject: [PATCH 3/3] Add explanatory comments Also, remove line which was accidentally removed --- templating/build.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/templating/build.py b/templating/build.py index 6756bed9e..ac3d2491a 100755 --- a/templating/build.py +++ b/templating/build.py @@ -76,6 +76,11 @@ def main(input_module, file_stream=None, out_dir=None, verbose=False): return " "*indent + input def wrap(input, wrap=80, initial_indent=""): + if len(input) == 0: + return initial_indent + # TextWrapper collapses newlines into single spaces; we do our own + # splitting on newlines to prevent this, so that newlines can actually + # be intentionally inserted in text. input_lines = input.split('\n\n') wrapper = TextWrapper(initial_indent=initial_indent, width=wrap) output_lines = [wrapper.fill(line) for line in input_lines]