Mercurial > hg > decoupage
comparison 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 |
comparison
equal
deleted
inserted
replaced
106:1f84c6def8bd | 107:450aff4c97e3 |
---|---|
339 except: | 339 except: |
340 continue | 340 continue |
341 formatters[entry_point.name] = formatter | 341 formatters[entry_point.name] = formatter |
342 return formatters | 342 return formatters |
343 | 343 |
344 | |
344 def main(args=sys.argv[1:]): | 345 def main(args=sys.argv[1:]): |
346 """CLI""" | |
347 | |
345 for name, formatter in formatters().items(): | 348 for name, formatter in formatters().items(): |
346 print '%s%s' % (name, formatter.__doc__ and ': ' + formatter.__doc__ or '') | 349 description = '' |
350 if formatter.__doc__: | |
351 description = ': {}'.format(formatter.__doc__) | |
352 print ('{name}{description}'.format(name=name, | |
353 description=description)) | |
354 | |
347 | 355 |
348 if __name__ == '__main__': | 356 if __name__ == '__main__': |
349 main() | 357 main() |