From b836f2622691082e1fc4216cc3c1427d9c13fd21 Mon Sep 17 00:00:00 2001 From: Alan Hamlett Date: Sun, 22 Sep 2013 15:24:50 -0700 Subject: [PATCH] upgraded wakatime package --- .../wakatime/packages/pygments2/__init__.py | 91 + .../wakatime/packages/pygments2/cmdline.py | 441 ++ .../{pygments => pygments2}/console.py | 0 .../{pygments => pygments2}/filter.py | 0 .../packages/pygments2/filters/__init__.py | 356 ++ .../wakatime/packages/pygments2/formatter.py | 95 + .../formatters/__init__.py | 0 .../packages/pygments2/formatters/_mapping.py | 92 + .../formatters/bbcode.py | 0 .../packages/pygments2/formatters/html.py | 821 +++ .../packages/pygments2/formatters/img.py | 553 ++ .../packages/pygments2/formatters/latex.py | 378 ++ .../formatters/other.py | 0 .../{pygments => pygments2}/formatters/rtf.py | 0 .../{pygments => pygments2}/formatters/svg.py | 0 .../formatters/terminal.py | 0 .../formatters/terminal256.py | 0 .../wakatime/packages/pygments2/lexer.py | 765 +++ .../packages/pygments2/lexers/__init__.py | 240 + .../lexers/_asybuiltins.py | 0 .../lexers/_clbuiltins.py | 0 .../lexers/_lassobuiltins.py | 0 .../packages/pygments2/lexers/_luabuiltins.py | 249 + .../packages/pygments2/lexers/_mapping.py | 350 ++ .../lexers/_openedgebuiltins.py | 0 .../packages/pygments2/lexers/_phpbuiltins.py | 3787 ++++++++++++ .../pygments2/lexers/_postgres_builtins.py | 233 + .../pygments2/lexers/_robotframeworklexer.py | 557 ++ .../lexers/_scilab_builtins.py | 0 .../pygments2/lexers/_sourcemodbuiltins.py | 1072 ++++ .../lexers/_stan_builtins.py | 0 .../lexers/_vimbuiltins.py | 0 .../packages/pygments2/lexers/agile.py | 2290 ++++++++ .../{pygments => pygments2}/lexers/asm.py | 0 .../packages/pygments2/lexers/compiled.py | 3723 ++++++++++++ .../{pygments => pygments2}/lexers/dalvik.py | 0 .../packages/pygments2/lexers/dotnet.py | 671 +++ .../{pygments => pygments2}/lexers/foxpro.py | 0 .../packages/pygments2/lexers/functional.py | 2731 +++++++++ .../{pygments => pygments2}/lexers/hdl.py | 0 .../wakatime/packages/pygments2/lexers/jvm.py | 1112 ++++ .../{pygments => pygments2}/lexers/math.py | 0 .../packages/pygments2/lexers/other.py | 3778 ++++++++++++ .../{pygments => pygments2}/lexers/parsers.py | 0 .../{pygments => pygments2}/lexers/shell.py | 0 .../packages/pygments2/lexers/special.py | 100 + .../wakatime/packages/pygments2/lexers/sql.py | 559 ++ .../lexers/templates.py | 0 .../packages/pygments2/lexers/text.py | 1893 ++++++ .../wakatime/packages/pygments2/lexers/web.py | 4045 +++++++++++++ .../{pygments => pygments2}/modeline.py | 0 .../{pygments => pygments2}/plugin.py | 0 .../{pygments => pygments2}/scanner.py | 0 .../wakatime/packages/pygments2/style.py | 117 + .../styles/__init__.py | 0 .../{pygments => pygments2}/styles/autumn.py | 0 .../{pygments => pygments2}/styles/borland.py | 0 .../{pygments => pygments2}/styles/bw.py | 0 .../styles/colorful.py | 0 .../{pygments => pygments2}/styles/default.py | 0 .../{pygments => pygments2}/styles/emacs.py | 0 .../styles/friendly.py | 0 .../{pygments => pygments2}/styles/fruity.py | 0 .../{pygments => pygments2}/styles/manni.py | 0 .../{pygments => pygments2}/styles/monokai.py | 0 .../{pygments => pygments2}/styles/murphy.py | 0 .../{pygments => pygments2}/styles/native.py | 0 .../{pygments => pygments2}/styles/pastie.py | 0 .../{pygments => pygments2}/styles/perldoc.py | 0 .../{pygments => pygments2}/styles/rrt.py | 0 .../{pygments => pygments2}/styles/tango.py | 0 .../{pygments => pygments2}/styles/trac.py | 0 .../{pygments => pygments2}/styles/vim.py | 0 .../{pygments => pygments2}/styles/vs.py | 0 .../packages/{pygments => pygments2}/token.py | 0 .../wakatime/packages/pygments2/unistring.py | 140 + .../wakatime/packages/pygments2/util.py | 277 + .../{pygments => pygments3}/__init__.py | 0 .../{pygments => pygments3}/cmdline.py | 0 .../wakatime/packages/pygments3/console.py | 74 + .../wakatime/packages/pygments3/filter.py | 74 + .../filters/__init__.py | 0 .../{pygments => pygments3}/formatter.py | 0 .../packages/pygments3/formatters/__init__.py | 68 + .../formatters/_mapping.py | 0 .../packages/pygments3/formatters/bbcode.py | 109 + .../formatters/html.py | 0 .../{pygments => pygments3}/formatters/img.py | 0 .../formatters/latex.py | 0 .../packages/pygments3/formatters/other.py | 115 + .../packages/pygments3/formatters/rtf.py | 136 + .../packages/pygments3/formatters/svg.py | 154 + .../packages/pygments3/formatters/terminal.py | 112 + .../pygments3/formatters/terminal256.py | 222 + .../packages/{pygments => pygments3}/lexer.py | 0 .../lexers/__init__.py | 0 .../packages/pygments3/lexers/_asybuiltins.py | 1645 ++++++ .../packages/pygments3/lexers/_clbuiltins.py | 232 + .../pygments3/lexers/_lassobuiltins.py | 5172 +++++++++++++++++ .../lexers/_luabuiltins.py | 0 .../lexers/_mapping.py | 0 .../pygments3/lexers/_openedgebuiltins.py | 562 ++ .../lexers/_phpbuiltins.py | 0 .../lexers/_postgres_builtins.py | 0 .../lexers/_robotframeworklexer.py | 0 .../pygments3/lexers/_scilab_builtins.py | 40 + .../lexers/_sourcemodbuiltins.py | 0 .../pygments3/lexers/_stan_builtins.py | 360 ++ .../packages/pygments3/lexers/_vimbuiltins.py | 13 + .../{pygments => pygments3}/lexers/agile.py | 0 .../wakatime/packages/pygments3/lexers/asm.py | 398 ++ .../lexers/compiled.py | 0 .../packages/pygments3/lexers/dalvik.py | 104 + .../{pygments => pygments3}/lexers/dotnet.py | 0 .../packages/pygments3/lexers/foxpro.py | 428 ++ .../lexers/functional.py | 0 .../wakatime/packages/pygments3/lexers/hdl.py | 356 ++ .../{pygments => pygments3}/lexers/jvm.py | 0 .../packages/pygments3/lexers/math.py | 1918 ++++++ .../{pygments => pygments3}/lexers/other.py | 0 .../packages/pygments3/lexers/parsers.py | 778 +++ .../packages/pygments3/lexers/shell.py | 424 ++ .../{pygments => pygments3}/lexers/special.py | 0 .../{pygments => pygments3}/lexers/sql.py | 0 .../packages/pygments3/lexers/templates.py | 1742 ++++++ .../{pygments => pygments3}/lexers/text.py | 0 .../{pygments => pygments3}/lexers/web.py | 0 .../wakatime/packages/pygments3/modeline.py | 40 + .../wakatime/packages/pygments3/plugin.py | 74 + .../wakatime/packages/pygments3/scanner.py | 104 + .../packages/{pygments => pygments3}/style.py | 0 .../packages/pygments3/styles/__init__.py | 70 + .../packages/pygments3/styles/autumn.py | 65 + .../packages/pygments3/styles/borland.py | 51 + .../wakatime/packages/pygments3/styles/bw.py | 49 + .../packages/pygments3/styles/colorful.py | 81 + .../packages/pygments3/styles/default.py | 73 + .../packages/pygments3/styles/emacs.py | 72 + .../packages/pygments3/styles/friendly.py | 72 + .../packages/pygments3/styles/fruity.py | 42 + .../packages/pygments3/styles/manni.py | 75 + .../packages/pygments3/styles/monokai.py | 106 + .../packages/pygments3/styles/murphy.py | 80 + .../packages/pygments3/styles/native.py | 65 + .../packages/pygments3/styles/pastie.py | 75 + .../packages/pygments3/styles/perldoc.py | 69 + .../wakatime/packages/pygments3/styles/rrt.py | 33 + .../packages/pygments3/styles/tango.py | 141 + .../packages/pygments3/styles/trac.py | 63 + .../wakatime/packages/pygments3/styles/vim.py | 63 + .../wakatime/packages/pygments3/styles/vs.py | 38 + .../wakatime/packages/pygments3/token.py | 195 + .../{pygments => pygments3}/unistring.py | 0 .../packages/{pygments => pygments3}/util.py | 0 packages/wakatime/wakatime/stats.py | 8 +- 155 files changed, 48554 insertions(+), 2 deletions(-) create mode 100644 packages/wakatime/wakatime/packages/pygments2/__init__.py create mode 100644 packages/wakatime/wakatime/packages/pygments2/cmdline.py rename packages/wakatime/wakatime/packages/{pygments => pygments2}/console.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/filter.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments2/filters/__init__.py create mode 100644 packages/wakatime/wakatime/packages/pygments2/formatter.py rename packages/wakatime/wakatime/packages/{pygments => pygments2}/formatters/__init__.py (100%) create mode 100755 packages/wakatime/wakatime/packages/pygments2/formatters/_mapping.py rename packages/wakatime/wakatime/packages/{pygments => pygments2}/formatters/bbcode.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments2/formatters/html.py create mode 100644 packages/wakatime/wakatime/packages/pygments2/formatters/img.py create mode 100644 packages/wakatime/wakatime/packages/pygments2/formatters/latex.py rename packages/wakatime/wakatime/packages/{pygments => pygments2}/formatters/other.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/formatters/rtf.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/formatters/svg.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/formatters/terminal.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/formatters/terminal256.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments2/lexer.py create mode 100644 packages/wakatime/wakatime/packages/pygments2/lexers/__init__.py rename packages/wakatime/wakatime/packages/{pygments => pygments2}/lexers/_asybuiltins.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/lexers/_clbuiltins.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/lexers/_lassobuiltins.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments2/lexers/_luabuiltins.py create mode 100644 packages/wakatime/wakatime/packages/pygments2/lexers/_mapping.py rename packages/wakatime/wakatime/packages/{pygments => pygments2}/lexers/_openedgebuiltins.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments2/lexers/_phpbuiltins.py create mode 100644 packages/wakatime/wakatime/packages/pygments2/lexers/_postgres_builtins.py create mode 100644 packages/wakatime/wakatime/packages/pygments2/lexers/_robotframeworklexer.py rename packages/wakatime/wakatime/packages/{pygments => pygments2}/lexers/_scilab_builtins.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments2/lexers/_sourcemodbuiltins.py rename packages/wakatime/wakatime/packages/{pygments => pygments2}/lexers/_stan_builtins.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/lexers/_vimbuiltins.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments2/lexers/agile.py rename packages/wakatime/wakatime/packages/{pygments => pygments2}/lexers/asm.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments2/lexers/compiled.py rename packages/wakatime/wakatime/packages/{pygments => pygments2}/lexers/dalvik.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments2/lexers/dotnet.py rename packages/wakatime/wakatime/packages/{pygments => pygments2}/lexers/foxpro.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments2/lexers/functional.py rename packages/wakatime/wakatime/packages/{pygments => pygments2}/lexers/hdl.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments2/lexers/jvm.py rename packages/wakatime/wakatime/packages/{pygments => pygments2}/lexers/math.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments2/lexers/other.py rename packages/wakatime/wakatime/packages/{pygments => pygments2}/lexers/parsers.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/lexers/shell.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments2/lexers/special.py create mode 100644 packages/wakatime/wakatime/packages/pygments2/lexers/sql.py rename packages/wakatime/wakatime/packages/{pygments => pygments2}/lexers/templates.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments2/lexers/text.py create mode 100644 packages/wakatime/wakatime/packages/pygments2/lexers/web.py rename packages/wakatime/wakatime/packages/{pygments => pygments2}/modeline.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/plugin.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/scanner.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments2/style.py rename packages/wakatime/wakatime/packages/{pygments => pygments2}/styles/__init__.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/styles/autumn.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/styles/borland.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/styles/bw.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/styles/colorful.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/styles/default.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/styles/emacs.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/styles/friendly.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/styles/fruity.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/styles/manni.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/styles/monokai.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/styles/murphy.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/styles/native.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/styles/pastie.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/styles/perldoc.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/styles/rrt.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/styles/tango.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/styles/trac.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/styles/vim.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/styles/vs.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments2}/token.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments2/unistring.py create mode 100644 packages/wakatime/wakatime/packages/pygments2/util.py rename packages/wakatime/wakatime/packages/{pygments => pygments3}/__init__.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments3}/cmdline.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments3/console.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/filter.py rename packages/wakatime/wakatime/packages/{pygments => pygments3}/filters/__init__.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments3}/formatter.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments3/formatters/__init__.py rename packages/wakatime/wakatime/packages/{pygments => pygments3}/formatters/_mapping.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments3/formatters/bbcode.py rename packages/wakatime/wakatime/packages/{pygments => pygments3}/formatters/html.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments3}/formatters/img.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments3}/formatters/latex.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments3/formatters/other.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/formatters/rtf.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/formatters/svg.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/formatters/terminal.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/formatters/terminal256.py rename packages/wakatime/wakatime/packages/{pygments => pygments3}/lexer.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments3}/lexers/__init__.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments3/lexers/_asybuiltins.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/lexers/_clbuiltins.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/lexers/_lassobuiltins.py rename packages/wakatime/wakatime/packages/{pygments => pygments3}/lexers/_luabuiltins.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments3}/lexers/_mapping.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments3/lexers/_openedgebuiltins.py rename packages/wakatime/wakatime/packages/{pygments => pygments3}/lexers/_phpbuiltins.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments3}/lexers/_postgres_builtins.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments3}/lexers/_robotframeworklexer.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments3/lexers/_scilab_builtins.py rename packages/wakatime/wakatime/packages/{pygments => pygments3}/lexers/_sourcemodbuiltins.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments3/lexers/_stan_builtins.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/lexers/_vimbuiltins.py rename packages/wakatime/wakatime/packages/{pygments => pygments3}/lexers/agile.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments3/lexers/asm.py rename packages/wakatime/wakatime/packages/{pygments => pygments3}/lexers/compiled.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments3/lexers/dalvik.py rename packages/wakatime/wakatime/packages/{pygments => pygments3}/lexers/dotnet.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments3/lexers/foxpro.py rename packages/wakatime/wakatime/packages/{pygments => pygments3}/lexers/functional.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments3/lexers/hdl.py rename packages/wakatime/wakatime/packages/{pygments => pygments3}/lexers/jvm.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments3/lexers/math.py rename packages/wakatime/wakatime/packages/{pygments => pygments3}/lexers/other.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments3/lexers/parsers.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/lexers/shell.py rename packages/wakatime/wakatime/packages/{pygments => pygments3}/lexers/special.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments3}/lexers/sql.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments3/lexers/templates.py rename packages/wakatime/wakatime/packages/{pygments => pygments3}/lexers/text.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments3}/lexers/web.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments3/modeline.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/plugin.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/scanner.py rename packages/wakatime/wakatime/packages/{pygments => pygments3}/style.py (100%) create mode 100644 packages/wakatime/wakatime/packages/pygments3/styles/__init__.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/styles/autumn.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/styles/borland.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/styles/bw.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/styles/colorful.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/styles/default.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/styles/emacs.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/styles/friendly.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/styles/fruity.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/styles/manni.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/styles/monokai.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/styles/murphy.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/styles/native.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/styles/pastie.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/styles/perldoc.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/styles/rrt.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/styles/tango.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/styles/trac.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/styles/vim.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/styles/vs.py create mode 100644 packages/wakatime/wakatime/packages/pygments3/token.py rename packages/wakatime/wakatime/packages/{pygments => pygments3}/unistring.py (100%) rename packages/wakatime/wakatime/packages/{pygments => pygments3}/util.py (100%) diff --git a/packages/wakatime/wakatime/packages/pygments2/__init__.py b/packages/wakatime/wakatime/packages/pygments2/__init__.py new file mode 100644 index 0000000..2bfd8ba --- /dev/null +++ b/packages/wakatime/wakatime/packages/pygments2/__init__.py @@ -0,0 +1,91 @@ +# -*- coding: utf-8 -*- +""" + Pygments + ~~~~~~~~ + + Pygments is a syntax highlighting package written in Python. + + It is a generic syntax highlighter for general use in all kinds of software + such as forum systems, wikis or other applications that need to prettify + source code. Highlights are: + + * a wide range of common languages and markup formats is supported + * special attention is paid to details, increasing quality by a fair amount + * support for new languages and formats are added easily + * a number of output formats, presently HTML, LaTeX, RTF, SVG, all image + formats that PIL supports, and ANSI sequences + * it is usable as a command-line tool and as a library + * ... and it highlights even Brainfuck! + + The `Pygments tip`_ is installable with ``easy_install Pygments==dev``. + + .. _Pygments tip: + http://bitbucket.org/birkenfeld/pygments-main/get/tip.zip#egg=Pygments-dev + + :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +__version__ = '1.6' +__docformat__ = 'restructuredtext' + +__all__ = ['lex', 'format', 'highlight'] + + +import sys + +from pygments.util import StringIO, BytesIO + + +def lex(code, lexer): + """ + Lex ``code`` with ``lexer`` and return an iterable of tokens. + """ + try: + return lexer.get_tokens(code) + except TypeError, err: + if isinstance(err.args[0], str) and \ + 'unbound method get_tokens' in err.args[0]: + raise TypeError('lex() argument must be a lexer instance, ' + 'not a class') + raise + + +def format(tokens, formatter, outfile=None): + """ + Format a tokenlist ``tokens`` with the formatter ``formatter``. + + If ``outfile`` is given and a valid file object (an object + with a ``write`` method), the result will be written to it, otherwise + it is returned as a string. + """ + try: + if not outfile: + #print formatter, 'using', formatter.encoding + realoutfile = formatter.encoding and BytesIO() or StringIO() + formatter.format(tokens, realoutfile) + return realoutfile.getvalue() + else: + formatter.format(tokens, outfile) + except TypeError, err: + if isinstance(err.args[0], str) and \ + 'unbound method format' in err.args[0]: + raise TypeError('format() argument must be a formatter instance, ' + 'not a class') + raise + + +def highlight(code, lexer, formatter, outfile=None): + """ + Lex ``code`` with ``lexer`` and format it with the formatter ``formatter``. + + If ``outfile`` is given and a valid file object (an object + with a ``write`` method), the result will be written to it, otherwise + it is returned as a string. + """ + return format(lex(code, lexer), formatter, outfile) + + +if __name__ == '__main__': + from pygments.cmdline import main + sys.exit(main(sys.argv)) diff --git a/packages/wakatime/wakatime/packages/pygments2/cmdline.py b/packages/wakatime/wakatime/packages/pygments2/cmdline.py new file mode 100644 index 0000000..c25204b --- /dev/null +++ b/packages/wakatime/wakatime/packages/pygments2/cmdline.py @@ -0,0 +1,441 @@ +# -*- coding: utf-8 -*- +""" + pygments.cmdline + ~~~~~~~~~~~~~~~~ + + Command line interface. + + :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" +import sys +import getopt +from textwrap import dedent + +from pygments import __version__, highlight +from pygments.util import ClassNotFound, OptionError, docstring_headline +from pygments.lexers import get_all_lexers, get_lexer_by_name, get_lexer_for_filename, \ + find_lexer_class, guess_lexer, TextLexer +from pygments.formatters import get_all_formatters, get_formatter_by_name, \ + get_formatter_for_filename, find_formatter_class, \ + TerminalFormatter # pylint:disable-msg=E0611 +from pygments.filters import get_all_filters, find_filter_class +from pygments.styles import get_all_styles, get_style_by_name + + +USAGE = """\ +Usage: %s [-l | -g] [-F [:]] [-f ] + [-O ] [-P ] [-o ] [] + + %s -S + + +

%(title)s

+ +''' + +DOC_HEADER_EXTERNALCSS = '''\ + + + + + %(title)s + + + + +

%(title)s

+ +''' + +DOC_FOOTER = '''\ + + +''' + + +class HtmlFormatter(Formatter): + r""" + Format tokens as HTML 4 ```` tags within a ``
`` tag, wrapped
+    in a ``
`` tag. The ``
``'s CSS class can be set by the `cssclass` + option. + + If the `linenos` option is set to ``"table"``, the ``
`` is
+    additionally wrapped inside a ```` which has one row and two
+    cells: one containing the line numbers and one containing the code.
+    Example:
+
+    .. sourcecode:: html
+
+        
+
+ + +
+
1
+            2
+
+
def foo(bar):
+              pass
+            
+
+ + (whitespace added to improve clarity). + + Wrapping can be disabled using the `nowrap` option. + + A list of lines can be specified using the `hl_lines` option to make these + lines highlighted (as of Pygments 0.11). + + With the `full` option, a complete HTML 4 document is output, including + the style definitions inside a ``