From 2614ee4e4a93c32c7d341d8e992e821a0352145b Mon Sep 17 00:00:00 2001 From: Michael Clemens Date: Sun, 18 Mar 2018 23:19:46 +0100 Subject: [PATCH] fixed code to max. 80 columns width --- esm2markdown.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/esm2markdown.py b/esm2markdown.py index 2196a86..7e47eaf 100755 --- a/esm2markdown.py +++ b/esm2markdown.py @@ -51,7 +51,8 @@ def line(level,key,value): if key: if value == "N/A": output = lvl + key_style + key + key_style + "\n" - elif value: output = lvl + key_style + key + key_style + " " + value_style + value + value_style + "\n" + elif value: output = lvl + key_style + key + key_style + " " + \ + value_style + value + value_style + "\n" else: output = "" return output @@ -103,7 +104,7 @@ def main(xmlfile,outfile): description = rule.findtext('description') file.write("\n## Description\n") file.write(description +"\n") - # Print general rule information (ID, Normalization, Severity, all Tags, Group By) + # Print rule information (ID, Normalization, Severity, Tags, Group By) file.write("\n## General Information\n") file.write(line(1,"Rule ID:",rule.findtext('id'))) file.write(line(1,"Normalization ID:",rule.findtext('normid'))) @@ -163,7 +164,8 @@ def main(xmlfile,outfile): v = e.get('value') if o and v and t: file.write(line(2,"Filter Component","N/A")) - file.write(line(3,"Condition:","'" + t + "' " + o + " '" + v + "'")) + file.write(line(3,"Condition:","'" + t + "' " + o + " '" \ + + v + "'")) v = "" o = "" file.write("\n\\newpage\n") @@ -172,7 +174,7 @@ def main(xmlfile,outfile): if __name__=="__main__": if len(sys.argv) != 3: print('Invalid Numbers of Arguments. Script will be terminated.') - print('Usage: python esm2markdown ') - print('Example: python esm2markdown RuleExport_2018_03_01_12_36_37.xml documentation.mk') + print('Usage: python esm2markdown ') + print('Example: python esm2markdown RuleExport.xml documentation.mk') else: main(sys.argv[1],sys.argv[2]);