Mercurial > p > roundup > code
diff roundup/scripts/roundup_mailgw.py @ 5376:64b05e24dbd8
Python 3 preparation: convert print to a function.
Tool-assisted patch. It is possible that some "from __future__ import
print_function" are not in fact needed, if a file only uses print()
with a single string as an argument and so would work fine in Python 2
without that import.
| author | Joseph Myers <jsm@polyomino.org.uk> |
|---|---|
| date | Tue, 24 Jul 2018 09:54:52 +0000 |
| parents | 63574f1f3570 |
| children | 55f09ca366c4 |
line wrap: on
line diff
--- a/roundup/scripts/roundup_mailgw.py Sat Jul 21 23:07:16 2018 +1000 +++ b/roundup/scripts/roundup_mailgw.py Tue Jul 24 09:54:52 2018 +0000 @@ -16,6 +16,7 @@ """Command-line script stub that calls the roundup.mailgw. """ +from __future__ import print_function __docformat__ = 'restructuredtext' @@ -43,8 +44,8 @@ def usage(args, message=None): if message is not None: - print message - print _( + print(message) + print(_( """Usage: %(program)s [-v] [-c class] [[-C class] -S field=value]* [instance home] [mail source [specification]] Options: @@ -123,7 +124,7 @@ This supports the same notation as IMAP. imaps_cram username:password@server [mailbox] -""")%{'program': args[0]} +""")%{'program': args[0]}) return 1 def main(argv): @@ -141,7 +142,7 @@ for (opt, arg) in optionsList: if opt == '-v': - print '%s (python %s)'%(roundup_version, sys.version.split()[0]) + print('%s (python %s)'%(roundup_version, sys.version.split()[0])) return # figure the instance home
