diff options
author | Georg Brandl <georg@python.org> | 2014-01-18 13:25:15 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2014-01-18 13:25:15 +0100 |
commit | a9169c157a05c82a1b8a7ffb92e7f159fb4ca0f8 (patch) | |
tree | face5db25ebef227315a0ae1080d4b2262f6fe23 /docs/generate.py | |
parent | e921fe0b430608cb7e0c89f7fada9260cb4822eb (diff) | |
download | pygments-a9169c157a05c82a1b8a7ffb92e7f159fb4ca0f8.tar.gz |
futurizing: move to print_function and "except X as Y" syntax
Diffstat (limited to 'docs/generate.py')
-rwxr-xr-x | docs/generate.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/docs/generate.py b/docs/generate.py index c379cded..172b8ccc 100755 --- a/docs/generate.py +++ b/docs/generate.py @@ -9,6 +9,7 @@ :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ +from __future__ import print_function import os import sys @@ -51,7 +52,7 @@ def generate_lexer_docs(): mod = __import__(module, None, None, [classname]) cls = getattr(mod, classname) if not cls.__doc__: - print "Warning: %s does not have a docstring." % classname + print("Warning: %s does not have a docstring." % classname) modules.setdefault(module, []).append(( classname, cls.__doc__, @@ -441,11 +442,11 @@ def run(handle_file, dst, sources=()): sources = [os.path.join(path, fn) for fn in os.listdir(path)] if not os.path.isdir(dst): os.makedirs(dst) - print 'Making docs for Pygments %s in %s' % (__version__, dst) + print('Making docs for Pygments %s in %s' % (__version__, dst)) for fn in sources: if not os.path.isfile(fn): continue - print 'Processing %s' % fn + print('Processing %s' % fn) f = open(fn) try: handle_file(fn, f, dst) @@ -460,13 +461,13 @@ def main(mode, dst='build/', *sources): 'python': handle_python }[mode] except KeyError: - print 'Error: unknown mode "%s"' % mode + print('Error: unknown mode "%s"' % mode) sys.exit(1) run(handler, os.path.realpath(dst), sources) if __name__ == '__main__': if len(sys.argv) == 1: - print USAGE + print(USAGE) else: main(*sys.argv[1:]) |