Mercurial > hg > decoupage
diff decoupage/formatters.py @ 107:450aff4c97e3
py35 compat
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Fri, 31 Mar 2017 17:06:59 -0700 |
parents | c382bdd01751 |
children |
line wrap: on
line diff
--- a/decoupage/formatters.py Fri Mar 31 16:38:02 2017 -0700 +++ b/decoupage/formatters.py Fri Mar 31 17:06:59 2017 -0700 @@ -341,9 +341,17 @@ formatters[entry_point.name] = formatter return formatters + def main(args=sys.argv[1:]): + """CLI""" + for name, formatter in formatters().items(): - print '%s%s' % (name, formatter.__doc__ and ': ' + formatter.__doc__ or '') + description = '' + if formatter.__doc__: + description = ': {}'.format(formatter.__doc__) + print ('{name}{description}'.format(name=name, + description=description)) + if __name__ == '__main__': main()