Mercurial > p > roundup > code
diff roundup/scripts/roundup_gettext.py @ 6044:32a5a54536b5
flake8 whitespace fixes.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Tue, 07 Jan 2020 21:38:56 -0500 |
| parents | 64b05e24dbd8 |
| children | d1c29284ccd9 |
line wrap: on
line diff
--- a/roundup/scripts/roundup_gettext.py Tue Jan 07 21:38:28 2020 -0500 +++ b/roundup/scripts/roundup_gettext.py Tue Jan 07 21:38:56 2020 -0500 @@ -28,10 +28,12 @@ # i don't think this will ever need to be changed, but still... TEMPLATE_FILE = "messages.pot" + def run(): # return unless command line arguments contain single directory path if (len(sys.argv) != 2) or (sys.argv[1] in ("-h", "--help")): - print(_("Usage: %(program)s <tracker home>") % {"program": sys.argv[0]}) + print(_("Usage: %(program)s <tracker home>") % + {"program": sys.argv[0]}) return # collect file paths of html templates home = os.path.abspath(sys.argv[1]) @@ -40,8 +42,8 @@ # glob is not used because i want to match file names # without case sensitivity, and that is easier done this way. htmlfiles = [filename for filename in os.listdir(htmldir) - if os.path.isfile(os.path.join(htmldir, filename)) - and filename.lower().endswith(".html")] + if os.path.isfile(os.path.join(htmldir, filename)) + and filename.lower().endswith(".html")] else: htmlfiles = [] # return if no html files found @@ -60,6 +62,7 @@ # run talgettext.main() + if __name__ == "__main__": run()
