diff options
author | Tim Hatch <tim@timhatch.com> | 2014-04-14 15:24:11 -0400 |
---|---|---|
committer | Tim Hatch <tim@timhatch.com> | 2014-04-14 15:24:11 -0400 |
commit | 775708f0cd0fc79c120efff55becfc9c0d52aab3 (patch) | |
tree | a3b2610df30e95695abfb4ef8d5728861dbe90c3 /pygments/lexers/_phpbuiltins.py | |
parent | 4ea98ad140a53922d83be5c1ab298e4ca2e980cc (diff) | |
parent | dd4dc914d46c58843c5144aaad6f85bc78ed1973 (diff) | |
download | pygments-775708f0cd0fc79c120efff55becfc9c0d52aab3.tar.gz |
Merged in alexsdutton/pygments-main (pull request #78)
Conflicts:
AUTHORS
pygments/lexers/_mapping.py
Diffstat (limited to 'pygments/lexers/_phpbuiltins.py')
-rw-r--r-- | pygments/lexers/_phpbuiltins.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/pygments/lexers/_phpbuiltins.py b/pygments/lexers/_phpbuiltins.py index cd1608f1..2f5ec851 100644 --- a/pygments/lexers/_phpbuiltins.py +++ b/pygments/lexers/_phpbuiltins.py @@ -12,10 +12,11 @@ internet connection. don't run that at home, use a server ;-) - :copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS. + :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ +from __future__ import print_function MODULES = {'.NET': ['dotnet_load'], 'APC': ['apc_add', @@ -3711,7 +3712,10 @@ if __name__ == '__main__': import re import shutil import tarfile - import urllib + try: + from urllib import urlretrieve + except ImportError: + from urllib.request import urlretrieve PHP_MANUAL_URL = 'http://us3.php.net/distributions/manual/php_manual_en.tar.gz' PHP_MANUAL_DIR = './php-chunked-xhtml/' @@ -3752,7 +3756,7 @@ if __name__ == '__main__': return modules def get_php_references(): - download = urllib.urlretrieve(PHP_MANUAL_URL) + download = urlretrieve(PHP_MANUAL_URL) tar = tarfile.open(download[0]) tar.extractall() tar.close() @@ -3777,11 +3781,11 @@ if __name__ == '__main__': f.close() def run(): - print '>> Downloading Function Index' + print('>> Downloading Function Index') modules = get_php_functions() - total = sum(len(v) for v in modules.itervalues()) - print '%d functions found' % total + total = sum(len(v) for v in modules.values()) + print('%d functions found' % total) regenerate(__file__, modules) shutil.rmtree(PHP_MANUAL_DIR) - run()
\ No newline at end of file + run() |