gitlab-pygments.rb 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/Gemfile +2 -0
- data/README.md +91 -0
- data/Rakefile +78 -0
- data/bench.rb +22 -0
- data/cache-lexers.rb +8 -0
- data/lexers +0 -0
- data/lib/pygments/lexer.rb +148 -0
- data/lib/pygments/mentos.py +344 -0
- data/lib/pygments/popen.rb +389 -0
- data/lib/pygments/version.rb +3 -0
- data/lib/pygments.rb +8 -0
- data/pygments.rb.gemspec +24 -0
- data/test/test_data.c +2581 -0
- data/test/test_data.py +514 -0
- data/test/test_data_generated +2582 -0
- data/test/test_pygments.rb +276 -0
- data/vendor/custom_formatters/gitlab.py +171 -0
- data/vendor/custom_lexers/github.py +362 -0
- data/vendor/pygments-main/AUTHORS +115 -0
- data/vendor/pygments-main/CHANGES +762 -0
- data/vendor/pygments-main/LICENSE +25 -0
- data/vendor/pygments-main/MANIFEST.in +6 -0
- data/vendor/pygments-main/Makefile +59 -0
- data/vendor/pygments-main/REVISION +1 -0
- data/vendor/pygments-main/TODO +15 -0
- data/vendor/pygments-main/docs/generate.py +472 -0
- data/vendor/pygments-main/docs/pygmentize.1 +94 -0
- data/vendor/pygments-main/docs/src/api.txt +270 -0
- data/vendor/pygments-main/docs/src/authors.txt +5 -0
- data/vendor/pygments-main/docs/src/changelog.txt +5 -0
- data/vendor/pygments-main/docs/src/cmdline.txt +147 -0
- data/vendor/pygments-main/docs/src/filterdevelopment.txt +70 -0
- data/vendor/pygments-main/docs/src/filters.txt +42 -0
- data/vendor/pygments-main/docs/src/formatterdevelopment.txt +169 -0
- data/vendor/pygments-main/docs/src/formatters.txt +48 -0
- data/vendor/pygments-main/docs/src/index.txt +69 -0
- data/vendor/pygments-main/docs/src/installation.txt +71 -0
- data/vendor/pygments-main/docs/src/integrate.txt +43 -0
- data/vendor/pygments-main/docs/src/lexerdevelopment.txt +551 -0
- data/vendor/pygments-main/docs/src/lexers.txt +67 -0
- data/vendor/pygments-main/docs/src/moinmoin.txt +39 -0
- data/vendor/pygments-main/docs/src/plugins.txt +93 -0
- data/vendor/pygments-main/docs/src/quickstart.txt +202 -0
- data/vendor/pygments-main/docs/src/rstdirective.txt +22 -0
- data/vendor/pygments-main/docs/src/styles.txt +143 -0
- data/vendor/pygments-main/docs/src/tokens.txt +349 -0
- data/vendor/pygments-main/docs/src/unicode.txt +49 -0
- data/vendor/pygments-main/external/markdown-processor.py +67 -0
- data/vendor/pygments-main/external/moin-parser.py +112 -0
- data/vendor/pygments-main/external/pygments.bashcomp +38 -0
- data/vendor/pygments-main/external/rst-directive-old.py +77 -0
- data/vendor/pygments-main/external/rst-directive.py +83 -0
- data/vendor/pygments-main/ez_setup.py +276 -0
- data/vendor/pygments-main/pygmentize +7 -0
- data/vendor/pygments-main/pygments/__init__.py +91 -0
- data/vendor/pygments-main/pygments/cmdline.py +433 -0
- data/vendor/pygments-main/pygments/console.py +74 -0
- data/vendor/pygments-main/pygments/filter.py +74 -0
- data/vendor/pygments-main/pygments/filters/__init__.py +357 -0
- data/vendor/pygments-main/pygments/formatter.py +92 -0
- data/vendor/pygments-main/pygments/formatters/__init__.py +68 -0
- data/vendor/pygments-main/pygments/formatters/_mapping.py +94 -0
- data/vendor/pygments-main/pygments/formatters/bbcode.py +109 -0
- data/vendor/pygments-main/pygments/formatters/gitlab.py +171 -0
- data/vendor/pygments-main/pygments/formatters/html.py +750 -0
- data/vendor/pygments-main/pygments/formatters/img.py +553 -0
- data/vendor/pygments-main/pygments/formatters/latex.py +378 -0
- data/vendor/pygments-main/pygments/formatters/other.py +117 -0
- data/vendor/pygments-main/pygments/formatters/rtf.py +136 -0
- data/vendor/pygments-main/pygments/formatters/svg.py +154 -0
- data/vendor/pygments-main/pygments/formatters/terminal.py +112 -0
- data/vendor/pygments-main/pygments/formatters/terminal256.py +222 -0
- data/vendor/pygments-main/pygments/lexer.py +697 -0
- data/vendor/pygments-main/pygments/lexers/__init__.py +229 -0
- data/vendor/pygments-main/pygments/lexers/_asybuiltins.py +1645 -0
- data/vendor/pygments-main/pygments/lexers/_clbuiltins.py +232 -0
- data/vendor/pygments-main/pygments/lexers/_luabuiltins.py +249 -0
- data/vendor/pygments-main/pygments/lexers/_mapping.py +298 -0
- data/vendor/pygments-main/pygments/lexers/_phpbuiltins.py +3787 -0
- data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +232 -0
- data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +29 -0
- data/vendor/pygments-main/pygments/lexers/_vimbuiltins.py +3 -0
- data/vendor/pygments-main/pygments/lexers/agile.py +1803 -0
- data/vendor/pygments-main/pygments/lexers/asm.py +360 -0
- data/vendor/pygments-main/pygments/lexers/compiled.py +2891 -0
- data/vendor/pygments-main/pygments/lexers/dotnet.py +636 -0
- data/vendor/pygments-main/pygments/lexers/functional.py +1832 -0
- data/vendor/pygments-main/pygments/lexers/github.py +362 -0
- data/vendor/pygments-main/pygments/lexers/hdl.py +356 -0
- data/vendor/pygments-main/pygments/lexers/jvm.py +847 -0
- data/vendor/pygments-main/pygments/lexers/math.py +1072 -0
- data/vendor/pygments-main/pygments/lexers/other.py +3339 -0
- data/vendor/pygments-main/pygments/lexers/parsers.py +695 -0
- data/vendor/pygments-main/pygments/lexers/shell.py +361 -0
- data/vendor/pygments-main/pygments/lexers/special.py +100 -0
- data/vendor/pygments-main/pygments/lexers/sql.py +559 -0
- data/vendor/pygments-main/pygments/lexers/templates.py +1631 -0
- data/vendor/pygments-main/pygments/lexers/text.py +1753 -0
- data/vendor/pygments-main/pygments/lexers/web.py +2864 -0
- data/vendor/pygments-main/pygments/plugin.py +74 -0
- data/vendor/pygments-main/pygments/scanner.py +104 -0
- data/vendor/pygments-main/pygments/style.py +117 -0
- data/vendor/pygments-main/pygments/styles/__init__.py +70 -0
- data/vendor/pygments-main/pygments/styles/autumn.py +65 -0
- data/vendor/pygments-main/pygments/styles/borland.py +51 -0
- data/vendor/pygments-main/pygments/styles/bw.py +49 -0
- data/vendor/pygments-main/pygments/styles/colorful.py +81 -0
- data/vendor/pygments-main/pygments/styles/default.py +73 -0
- data/vendor/pygments-main/pygments/styles/emacs.py +72 -0
- data/vendor/pygments-main/pygments/styles/friendly.py +72 -0
- data/vendor/pygments-main/pygments/styles/fruity.py +42 -0
- data/vendor/pygments-main/pygments/styles/manni.py +75 -0
- data/vendor/pygments-main/pygments/styles/monokai.py +106 -0
- data/vendor/pygments-main/pygments/styles/murphy.py +80 -0
- data/vendor/pygments-main/pygments/styles/native.py +65 -0
- data/vendor/pygments-main/pygments/styles/pastie.py +75 -0
- data/vendor/pygments-main/pygments/styles/perldoc.py +69 -0
- data/vendor/pygments-main/pygments/styles/rrt.py +33 -0
- data/vendor/pygments-main/pygments/styles/tango.py +141 -0
- data/vendor/pygments-main/pygments/styles/trac.py +63 -0
- data/vendor/pygments-main/pygments/styles/vim.py +63 -0
- data/vendor/pygments-main/pygments/styles/vs.py +38 -0
- data/vendor/pygments-main/pygments/token.py +195 -0
- data/vendor/pygments-main/pygments/unistring.py +130 -0
- data/vendor/pygments-main/pygments/util.py +232 -0
- data/vendor/pygments-main/scripts/check_sources.py +242 -0
- data/vendor/pygments-main/scripts/detect_missing_analyse_text.py +30 -0
- data/vendor/pygments-main/scripts/epydoc.css +280 -0
- data/vendor/pygments-main/scripts/find_codetags.py +205 -0
- data/vendor/pygments-main/scripts/find_error.py +171 -0
- data/vendor/pygments-main/scripts/get_vimkw.py +43 -0
- data/vendor/pygments-main/scripts/pylintrc +301 -0
- data/vendor/pygments-main/scripts/reindent.py +291 -0
- data/vendor/pygments-main/scripts/vim2pygments.py +933 -0
- data/vendor/pygments-main/setup.cfg +6 -0
- data/vendor/pygments-main/setup.py +88 -0
- data/vendor/pygments-main/tests/dtds/HTML4-f.dtd +37 -0
- data/vendor/pygments-main/tests/dtds/HTML4-s.dtd +869 -0
- data/vendor/pygments-main/tests/dtds/HTML4.dcl +88 -0
- data/vendor/pygments-main/tests/dtds/HTML4.dtd +1092 -0
- data/vendor/pygments-main/tests/dtds/HTML4.soc +9 -0
- data/vendor/pygments-main/tests/dtds/HTMLlat1.ent +195 -0
- data/vendor/pygments-main/tests/dtds/HTMLspec.ent +77 -0
- data/vendor/pygments-main/tests/dtds/HTMLsym.ent +241 -0
- data/vendor/pygments-main/tests/examplefiles/ANTLRv3.g +608 -0
- data/vendor/pygments-main/tests/examplefiles/AcidStateAdvanced.hs +209 -0
- data/vendor/pygments-main/tests/examplefiles/AlternatingGroup.mu +102 -0
- data/vendor/pygments-main/tests/examplefiles/CPDictionary.j +611 -0
- data/vendor/pygments-main/tests/examplefiles/Constants.mo +158 -0
- data/vendor/pygments-main/tests/examplefiles/DancingSudoku.lhs +411 -0
- data/vendor/pygments-main/tests/examplefiles/Errors.scala +18 -0
- data/vendor/pygments-main/tests/examplefiles/File.hy +174 -0
- data/vendor/pygments-main/tests/examplefiles/Intro.java +1660 -0
- data/vendor/pygments-main/tests/examplefiles/Makefile +1131 -0
- data/vendor/pygments-main/tests/examplefiles/Object.st +4394 -0
- data/vendor/pygments-main/tests/examplefiles/OrderedMap.hx +584 -0
- data/vendor/pygments-main/tests/examplefiles/SmallCheck.hs +378 -0
- data/vendor/pygments-main/tests/examplefiles/Sorting.mod +470 -0
- data/vendor/pygments-main/tests/examplefiles/Sudoku.lhs +382 -0
- data/vendor/pygments-main/tests/examplefiles/addressbook.proto +30 -0
- data/vendor/pygments-main/tests/examplefiles/antlr_throws +1 -0
- data/vendor/pygments-main/tests/examplefiles/apache2.conf +393 -0
- data/vendor/pygments-main/tests/examplefiles/as3_test.as +143 -0
- data/vendor/pygments-main/tests/examplefiles/as3_test2.as +46 -0
- data/vendor/pygments-main/tests/examplefiles/as3_test3.as +3 -0
- data/vendor/pygments-main/tests/examplefiles/aspx-cs_example +27 -0
- data/vendor/pygments-main/tests/examplefiles/badcase.java +2 -0
- data/vendor/pygments-main/tests/examplefiles/batchfile.bat +49 -0
- data/vendor/pygments-main/tests/examplefiles/boot-9.scm +1557 -0
- data/vendor/pygments-main/tests/examplefiles/cells.ps +515 -0
- data/vendor/pygments-main/tests/examplefiles/ceval.c +2604 -0
- data/vendor/pygments-main/tests/examplefiles/cheetah_example.html +13 -0
- data/vendor/pygments-main/tests/examplefiles/classes.dylan +40 -0
- data/vendor/pygments-main/tests/examplefiles/condensed_ruby.rb +10 -0
- data/vendor/pygments-main/tests/examplefiles/coq_RelationClasses +447 -0
- data/vendor/pygments-main/tests/examplefiles/database.pytb +20 -0
- data/vendor/pygments-main/tests/examplefiles/de.MoinMoin.po +2461 -0
- data/vendor/pygments-main/tests/examplefiles/demo.ahk +181 -0
- data/vendor/pygments-main/tests/examplefiles/demo.cfm +38 -0
- data/vendor/pygments-main/tests/examplefiles/django_sample.html+django +68 -0
- data/vendor/pygments-main/tests/examplefiles/dwarf.cw +17 -0
- data/vendor/pygments-main/tests/examplefiles/erl_session +10 -0
- data/vendor/pygments-main/tests/examplefiles/escape_semicolon.clj +1 -0
- data/vendor/pygments-main/tests/examplefiles/evil_regex.js +48 -0
- data/vendor/pygments-main/tests/examplefiles/example.c +2080 -0
- data/vendor/pygments-main/tests/examplefiles/example.cls +15 -0
- data/vendor/pygments-main/tests/examplefiles/example.cpp +2363 -0
- data/vendor/pygments-main/tests/examplefiles/example.gs +106 -0
- data/vendor/pygments-main/tests/examplefiles/example.gst +7 -0
- data/vendor/pygments-main/tests/examplefiles/example.kt +47 -0
- data/vendor/pygments-main/tests/examplefiles/example.lua +250 -0
- data/vendor/pygments-main/tests/examplefiles/example.moo +26 -0
- data/vendor/pygments-main/tests/examplefiles/example.moon +629 -0
- data/vendor/pygments-main/tests/examplefiles/example.nim +1010 -0
- data/vendor/pygments-main/tests/examplefiles/example.ns2 +69 -0
- data/vendor/pygments-main/tests/examplefiles/example.p +34 -0
- data/vendor/pygments-main/tests/examplefiles/example.pas +2708 -0
- data/vendor/pygments-main/tests/examplefiles/example.rb +1852 -0
- data/vendor/pygments-main/tests/examplefiles/example.rhtml +561 -0
- data/vendor/pygments-main/tests/examplefiles/example.sh-session +19 -0
- data/vendor/pygments-main/tests/examplefiles/example.sml +156 -0
- data/vendor/pygments-main/tests/examplefiles/example.snobol +15 -0
- data/vendor/pygments-main/tests/examplefiles/example.tea +34 -0
- data/vendor/pygments-main/tests/examplefiles/example.u +548 -0
- data/vendor/pygments-main/tests/examplefiles/example.weechatlog +9 -0
- data/vendor/pygments-main/tests/examplefiles/example.xhtml +376 -0
- data/vendor/pygments-main/tests/examplefiles/example.yaml +302 -0
- data/vendor/pygments-main/tests/examplefiles/example2.aspx +29 -0
- data/vendor/pygments-main/tests/examplefiles/example_elixir.ex +363 -0
- data/vendor/pygments-main/tests/examplefiles/example_file.fy +128 -0
- data/vendor/pygments-main/tests/examplefiles/firefox.mak +586 -0
- data/vendor/pygments-main/tests/examplefiles/flipflop.sv +19 -0
- data/vendor/pygments-main/tests/examplefiles/foo.sce +6 -0
- data/vendor/pygments-main/tests/examplefiles/format.ml +1213 -0
- data/vendor/pygments-main/tests/examplefiles/fucked_up.rb +77 -0
- data/vendor/pygments-main/tests/examplefiles/function.mu +1 -0
- data/vendor/pygments-main/tests/examplefiles/functional.rst +1472 -0
- data/vendor/pygments-main/tests/examplefiles/genclass.clj +510 -0
- data/vendor/pygments-main/tests/examplefiles/genshi_example.xml+genshi +193 -0
- data/vendor/pygments-main/tests/examplefiles/genshitext_example.genshitext +33 -0
- data/vendor/pygments-main/tests/examplefiles/glsl.frag +7 -0
- data/vendor/pygments-main/tests/examplefiles/glsl.vert +13 -0
- data/vendor/pygments-main/tests/examplefiles/html+php_faulty.php +1 -0
- data/vendor/pygments-main/tests/examplefiles/http_request_example +14 -0
- data/vendor/pygments-main/tests/examplefiles/http_response_example +27 -0
- data/vendor/pygments-main/tests/examplefiles/import.hs +4 -0
- data/vendor/pygments-main/tests/examplefiles/intro.ik +24 -0
- data/vendor/pygments-main/tests/examplefiles/ints.php +10 -0
- data/vendor/pygments-main/tests/examplefiles/intsyn.fun +675 -0
- data/vendor/pygments-main/tests/examplefiles/intsyn.sig +286 -0
- data/vendor/pygments-main/tests/examplefiles/irb_heredoc +8 -0
- data/vendor/pygments-main/tests/examplefiles/irc.lsp +214 -0
- data/vendor/pygments-main/tests/examplefiles/java.properties +16 -0
- data/vendor/pygments-main/tests/examplefiles/jbst_example1.jbst +28 -0
- data/vendor/pygments-main/tests/examplefiles/jbst_example2.jbst +45 -0
- data/vendor/pygments-main/tests/examplefiles/jinjadesignerdoc.rst +713 -0
- data/vendor/pygments-main/tests/examplefiles/lighttpd_config.conf +13 -0
- data/vendor/pygments-main/tests/examplefiles/linecontinuation.py +47 -0
- data/vendor/pygments-main/tests/examplefiles/ltmain.sh +2849 -0
- data/vendor/pygments-main/tests/examplefiles/main.cmake +42 -0
- data/vendor/pygments-main/tests/examplefiles/markdown.lsp +679 -0
- data/vendor/pygments-main/tests/examplefiles/matlab_noreturn +3 -0
- data/vendor/pygments-main/tests/examplefiles/matlab_sample +27 -0
- data/vendor/pygments-main/tests/examplefiles/matlabsession_sample.txt +37 -0
- data/vendor/pygments-main/tests/examplefiles/minimal.ns2 +4 -0
- data/vendor/pygments-main/tests/examplefiles/moin_SyntaxReference.txt +340 -0
- data/vendor/pygments-main/tests/examplefiles/multiline_regexes.rb +38 -0
- data/vendor/pygments-main/tests/examplefiles/nasm_aoutso.asm +96 -0
- data/vendor/pygments-main/tests/examplefiles/nasm_objexe.asm +30 -0
- data/vendor/pygments-main/tests/examplefiles/nemerle_sample.n +87 -0
- data/vendor/pygments-main/tests/examplefiles/nginx_nginx.conf +118 -0
- data/vendor/pygments-main/tests/examplefiles/numbers.c +12 -0
- data/vendor/pygments-main/tests/examplefiles/objc_example.m +25 -0
- data/vendor/pygments-main/tests/examplefiles/objc_example2.m +24 -0
- data/vendor/pygments-main/tests/examplefiles/perl_misc +62 -0
- data/vendor/pygments-main/tests/examplefiles/perl_perl5db +998 -0
- data/vendor/pygments-main/tests/examplefiles/perl_regex-delims +120 -0
- data/vendor/pygments-main/tests/examplefiles/perlfunc.1 +856 -0
- data/vendor/pygments-main/tests/examplefiles/phpcomplete.vim +567 -0
- data/vendor/pygments-main/tests/examplefiles/pleac.in.rb +1223 -0
- data/vendor/pygments-main/tests/examplefiles/postgresql_test.txt +47 -0
- data/vendor/pygments-main/tests/examplefiles/pppoe.applescript +10 -0
- data/vendor/pygments-main/tests/examplefiles/psql_session.txt +122 -0
- data/vendor/pygments-main/tests/examplefiles/py3_test.txt +2 -0
- data/vendor/pygments-main/tests/examplefiles/pycon_test.pycon +14 -0
- data/vendor/pygments-main/tests/examplefiles/pytb_test2.pytb +2 -0
- data/vendor/pygments-main/tests/examplefiles/python25-bsd.mak +234 -0
- data/vendor/pygments-main/tests/examplefiles/qsort.prolog +13 -0
- data/vendor/pygments-main/tests/examplefiles/r-console-transcript.Rout +38 -0
- data/vendor/pygments-main/tests/examplefiles/ragel-cpp_rlscan +280 -0
- data/vendor/pygments-main/tests/examplefiles/ragel-cpp_snippet +2 -0
- data/vendor/pygments-main/tests/examplefiles/regex.js +22 -0
- data/vendor/pygments-main/tests/examplefiles/reversi.lsp +427 -0
- data/vendor/pygments-main/tests/examplefiles/ruby_func_def.rb +11 -0
- data/vendor/pygments-main/tests/examplefiles/scilab.sci +30 -0
- data/vendor/pygments-main/tests/examplefiles/sibling.prolog +19 -0
- data/vendor/pygments-main/tests/examplefiles/simple.md +747 -0
- data/vendor/pygments-main/tests/examplefiles/smarty_example.html +209 -0
- data/vendor/pygments-main/tests/examplefiles/source.lgt +343 -0
- data/vendor/pygments-main/tests/examplefiles/sources.list +62 -0
- data/vendor/pygments-main/tests/examplefiles/sphere.pov +18 -0
- data/vendor/pygments-main/tests/examplefiles/sqlite3.sqlite3-console +27 -0
- data/vendor/pygments-main/tests/examplefiles/squid.conf +30 -0
- data/vendor/pygments-main/tests/examplefiles/string.jl +1031 -0
- data/vendor/pygments-main/tests/examplefiles/string_delimiters.d +21 -0
- data/vendor/pygments-main/tests/examplefiles/stripheredoc.sh +3 -0
- data/vendor/pygments-main/tests/examplefiles/test.R +119 -0
- data/vendor/pygments-main/tests/examplefiles/test.adb +211 -0
- data/vendor/pygments-main/tests/examplefiles/test.asy +131 -0
- data/vendor/pygments-main/tests/examplefiles/test.awk +121 -0
- data/vendor/pygments-main/tests/examplefiles/test.bas +29 -0
- data/vendor/pygments-main/tests/examplefiles/test.bmx +145 -0
- data/vendor/pygments-main/tests/examplefiles/test.boo +39 -0
- data/vendor/pygments-main/tests/examplefiles/test.bro +250 -0
- data/vendor/pygments-main/tests/examplefiles/test.cs +374 -0
- data/vendor/pygments-main/tests/examplefiles/test.css +54 -0
- data/vendor/pygments-main/tests/examplefiles/test.d +135 -0
- data/vendor/pygments-main/tests/examplefiles/test.dart +23 -0
- data/vendor/pygments-main/tests/examplefiles/test.dtd +89 -0
- data/vendor/pygments-main/tests/examplefiles/test.ec +605 -0
- data/vendor/pygments-main/tests/examplefiles/test.ecl +58 -0
- data/vendor/pygments-main/tests/examplefiles/test.eh +315 -0
- data/vendor/pygments-main/tests/examplefiles/test.erl +169 -0
- data/vendor/pygments-main/tests/examplefiles/test.evoque +33 -0
- data/vendor/pygments-main/tests/examplefiles/test.fan +818 -0
- data/vendor/pygments-main/tests/examplefiles/test.flx +57 -0
- data/vendor/pygments-main/tests/examplefiles/test.gdc +13 -0
- data/vendor/pygments-main/tests/examplefiles/test.groovy +97 -0
- data/vendor/pygments-main/tests/examplefiles/test.html +339 -0
- data/vendor/pygments-main/tests/examplefiles/test.ini +10 -0
- data/vendor/pygments-main/tests/examplefiles/test.java +653 -0
- data/vendor/pygments-main/tests/examplefiles/test.jsp +24 -0
- data/vendor/pygments-main/tests/examplefiles/test.maql +45 -0
- data/vendor/pygments-main/tests/examplefiles/test.mod +374 -0
- data/vendor/pygments-main/tests/examplefiles/test.moo +51 -0
- data/vendor/pygments-main/tests/examplefiles/test.myt +166 -0
- data/vendor/pygments-main/tests/examplefiles/test.nim +93 -0
- data/vendor/pygments-main/tests/examplefiles/test.pas +743 -0
- data/vendor/pygments-main/tests/examplefiles/test.php +505 -0
- data/vendor/pygments-main/tests/examplefiles/test.plot +333 -0
- data/vendor/pygments-main/tests/examplefiles/test.ps1 +108 -0
- data/vendor/pygments-main/tests/examplefiles/test.pypylog +1839 -0
- data/vendor/pygments-main/tests/examplefiles/test.r3 +94 -0
- data/vendor/pygments-main/tests/examplefiles/test.rb +177 -0
- data/vendor/pygments-main/tests/examplefiles/test.rhtml +43 -0
- data/vendor/pygments-main/tests/examplefiles/test.scaml +8 -0
- data/vendor/pygments-main/tests/examplefiles/test.ssp +12 -0
- data/vendor/pygments-main/tests/examplefiles/test.tcsh +830 -0
- data/vendor/pygments-main/tests/examplefiles/test.vb +407 -0
- data/vendor/pygments-main/tests/examplefiles/test.vhdl +161 -0
- data/vendor/pygments-main/tests/examplefiles/test.xqy +138 -0
- data/vendor/pygments-main/tests/examplefiles/test.xsl +23 -0
- data/vendor/pygments-main/tests/examplefiles/truncated.pytb +15 -0
- data/vendor/pygments-main/tests/examplefiles/type.lisp +1202 -0
- data/vendor/pygments-main/tests/examplefiles/underscore.coffee +603 -0
- data/vendor/pygments-main/tests/examplefiles/unicode.applescript +5 -0
- data/vendor/pygments-main/tests/examplefiles/unicodedoc.py +11 -0
- data/vendor/pygments-main/tests/examplefiles/webkit-transition.css +3 -0
- data/vendor/pygments-main/tests/examplefiles/while.pov +13 -0
- data/vendor/pygments-main/tests/examplefiles/wiki.factor +384 -0
- data/vendor/pygments-main/tests/examplefiles/xml_example +1897 -0
- data/vendor/pygments-main/tests/examplefiles/zmlrpc.f90 +798 -0
- data/vendor/pygments-main/tests/old_run.py +138 -0
- data/vendor/pygments-main/tests/run.py +48 -0
- data/vendor/pygments-main/tests/support.py +15 -0
- data/vendor/pygments-main/tests/test_basic_api.py +294 -0
- data/vendor/pygments-main/tests/test_clexer.py +31 -0
- data/vendor/pygments-main/tests/test_cmdline.py +105 -0
- data/vendor/pygments-main/tests/test_examplefiles.py +97 -0
- data/vendor/pygments-main/tests/test_html_formatter.py +162 -0
- data/vendor/pygments-main/tests/test_latex_formatter.py +55 -0
- data/vendor/pygments-main/tests/test_perllexer.py +137 -0
- data/vendor/pygments-main/tests/test_regexlexer.py +47 -0
- data/vendor/pygments-main/tests/test_token.py +46 -0
- data/vendor/pygments-main/tests/test_using_api.py +40 -0
- data/vendor/pygments-main/tests/test_util.py +116 -0
- data/vendor/simplejson/.gitignore +10 -0
- data/vendor/simplejson/.travis.yml +5 -0
- data/vendor/simplejson/CHANGES.txt +291 -0
- data/vendor/simplejson/LICENSE.txt +19 -0
- data/vendor/simplejson/MANIFEST.in +5 -0
- data/vendor/simplejson/README.rst +19 -0
- data/vendor/simplejson/conf.py +179 -0
- data/vendor/simplejson/index.rst +628 -0
- data/vendor/simplejson/scripts/make_docs.py +18 -0
- data/vendor/simplejson/setup.py +104 -0
- data/vendor/simplejson/simplejson/__init__.py +510 -0
- data/vendor/simplejson/simplejson/_speedups.c +2745 -0
- data/vendor/simplejson/simplejson/decoder.py +425 -0
- data/vendor/simplejson/simplejson/encoder.py +567 -0
- data/vendor/simplejson/simplejson/ordered_dict.py +119 -0
- data/vendor/simplejson/simplejson/scanner.py +77 -0
- data/vendor/simplejson/simplejson/tests/__init__.py +67 -0
- data/vendor/simplejson/simplejson/tests/test_bigint_as_string.py +55 -0
- data/vendor/simplejson/simplejson/tests/test_check_circular.py +30 -0
- data/vendor/simplejson/simplejson/tests/test_decimal.py +66 -0
- data/vendor/simplejson/simplejson/tests/test_decode.py +83 -0
- data/vendor/simplejson/simplejson/tests/test_default.py +9 -0
- data/vendor/simplejson/simplejson/tests/test_dump.py +67 -0
- data/vendor/simplejson/simplejson/tests/test_encode_basestring_ascii.py +46 -0
- data/vendor/simplejson/simplejson/tests/test_encode_for_html.py +32 -0
- data/vendor/simplejson/simplejson/tests/test_errors.py +34 -0
- data/vendor/simplejson/simplejson/tests/test_fail.py +91 -0
- data/vendor/simplejson/simplejson/tests/test_float.py +19 -0
- data/vendor/simplejson/simplejson/tests/test_indent.py +86 -0
- data/vendor/simplejson/simplejson/tests/test_item_sort_key.py +20 -0
- data/vendor/simplejson/simplejson/tests/test_namedtuple.py +121 -0
- data/vendor/simplejson/simplejson/tests/test_pass1.py +76 -0
- data/vendor/simplejson/simplejson/tests/test_pass2.py +14 -0
- data/vendor/simplejson/simplejson/tests/test_pass3.py +20 -0
- data/vendor/simplejson/simplejson/tests/test_recursion.py +67 -0
- data/vendor/simplejson/simplejson/tests/test_scanstring.py +117 -0
- data/vendor/simplejson/simplejson/tests/test_separators.py +42 -0
- data/vendor/simplejson/simplejson/tests/test_speedups.py +20 -0
- data/vendor/simplejson/simplejson/tests/test_tuple.py +49 -0
- data/vendor/simplejson/simplejson/tests/test_unicode.py +109 -0
- data/vendor/simplejson/simplejson/tool.py +39 -0
- metadata +492 -0
@@ -0,0 +1,30 @@
|
|
1
|
+
import sys
|
2
|
+
|
3
|
+
from pygments.lexers import get_all_lexers, find_lexer_class
|
4
|
+
from pygments.lexer import Lexer
|
5
|
+
|
6
|
+
def main():
|
7
|
+
uses = {}
|
8
|
+
|
9
|
+
for name, aliases, filenames, mimetypes in get_all_lexers():
|
10
|
+
cls = find_lexer_class(name)
|
11
|
+
for f in filenames:
|
12
|
+
if f not in uses:
|
13
|
+
uses[f] = []
|
14
|
+
uses[f].append(cls)
|
15
|
+
|
16
|
+
ret = 0
|
17
|
+
for k, v in uses.iteritems():
|
18
|
+
if len(v) > 1:
|
19
|
+
#print "Multiple for", k, v
|
20
|
+
for i in v:
|
21
|
+
if i.analyse_text is None:
|
22
|
+
print i, "has a None analyse_text"
|
23
|
+
ret |= 1
|
24
|
+
elif Lexer.analyse_text.__doc__ == i.analyse_text.__doc__:
|
25
|
+
print i, "needs analyse_text, multiple lexers for", k
|
26
|
+
ret |= 2
|
27
|
+
return ret
|
28
|
+
|
29
|
+
if __name__ == '__main__':
|
30
|
+
sys.exit(main())
|
@@ -0,0 +1,280 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
/* Epydoc CSS Stylesheet
|
4
|
+
*
|
5
|
+
* This stylesheet can be used to customize the appearance of epydoc's
|
6
|
+
* HTML output.
|
7
|
+
*
|
8
|
+
*/
|
9
|
+
|
10
|
+
/* Adapted for Pocoo API docs by Georg Brandl */
|
11
|
+
|
12
|
+
/* Default Colors & Styles
|
13
|
+
* - Set the default foreground & background color with 'body'; and
|
14
|
+
* link colors with 'a:link' and 'a:visited'.
|
15
|
+
* - Use bold for decision list terms.
|
16
|
+
* - The heading styles defined here are used for headings *within*
|
17
|
+
* docstring descriptions. All headings used by epydoc itself use
|
18
|
+
* either class='epydoc' or class='toc' (CSS styles for both
|
19
|
+
* defined below).
|
20
|
+
*/
|
21
|
+
body { background: #ffffff; color: #000000;
|
22
|
+
font-family: Trebuchet MS,Tahoma,sans-serif;
|
23
|
+
font-size: 0.9em; line-height: 140%;
|
24
|
+
margin: 0; padding: 0 1.2em 1.2em 1.2em; }
|
25
|
+
a:link { color: #C87900; text-decoration: none;
|
26
|
+
border-bottom: 1px solid #C87900; }
|
27
|
+
a:visited { color: #C87900; text-decoration: none;
|
28
|
+
border-bottom: 1px dotted #C87900; }
|
29
|
+
a:hover { color: #F8A900; border-bottom-color: #F8A900; }
|
30
|
+
dt { font-weight: bold; }
|
31
|
+
h1 { font-size: +180%; font-style: italic;
|
32
|
+
font-weight: bold; margin-top: 1.5em; }
|
33
|
+
h2 { font-size: +140%; font-style: italic;
|
34
|
+
font-weight: bold; }
|
35
|
+
h3 { font-size: +110%; font-style: italic;
|
36
|
+
font-weight: normal; }
|
37
|
+
p { margin-top: .5em; margin-bottom: .5em; }
|
38
|
+
hr { margin-top: 1.5em; margin-bottom: 1.5em;
|
39
|
+
border: 1px solid #BBB; }
|
40
|
+
tt.literal { background: #F5FFD0; padding: 2px;
|
41
|
+
font-size: 110%; }
|
42
|
+
table.rst-docutils { border: 0; }
|
43
|
+
table.rst-docutils td { border: 0; padding: 5px 20px 5px 0px; }
|
44
|
+
|
45
|
+
/* Page Header & Footer
|
46
|
+
* - The standard page header consists of a navigation bar (with
|
47
|
+
* pointers to standard pages such as 'home' and 'trees'); a
|
48
|
+
* breadcrumbs list, which can be used to navigate to containing
|
49
|
+
* classes or modules; options links, to show/hide private
|
50
|
+
* variables and to show/hide frames; and a page title (using
|
51
|
+
* <h1>). The page title may be followed by a link to the
|
52
|
+
* corresponding source code (using 'span.codelink').
|
53
|
+
* - The footer consists of a navigation bar, a timestamp, and a
|
54
|
+
* pointer to epydoc's homepage.
|
55
|
+
*/
|
56
|
+
h1.epydoc { margin-top: .4em; margin-bottom: .4em;
|
57
|
+
font-size: +180%; font-weight: bold;
|
58
|
+
font-style: normal; }
|
59
|
+
h2.epydoc { font-size: +130%; font-weight: bold;
|
60
|
+
font-style: normal; }
|
61
|
+
h3.epydoc { font-size: +115%; font-weight: bold;
|
62
|
+
font-style: normal; }
|
63
|
+
table.navbar { background: #E6F8A0; color: #000000;
|
64
|
+
border-top: 1px solid #c0d0d0;
|
65
|
+
border-bottom: 1px solid #c0d0d0;
|
66
|
+
margin: -1px -1.2em 1em -1.2em; }
|
67
|
+
table.navbar th { padding: 2px 7px 2px 0px; }
|
68
|
+
th.navbar-select { background-color: transparent; }
|
69
|
+
th.navbar-select:before { content: ">" }
|
70
|
+
th.navbar-select:after { content: "<" }
|
71
|
+
table.navbar a { border: 0; }
|
72
|
+
span.breadcrumbs { font-size: 95%; font-weight: bold; }
|
73
|
+
span.options { font-size: 80%; }
|
74
|
+
span.codelink { font-size: 85%; }
|
75
|
+
td.footer { font-size: 85%; }
|
76
|
+
|
77
|
+
/* Table Headers
|
78
|
+
* - Each summary table and details section begins with a 'header'
|
79
|
+
* row. This row contains a section title (marked by
|
80
|
+
* 'span.table-header') as well as a show/hide private link
|
81
|
+
* (marked by 'span.options', defined above).
|
82
|
+
* - Summary tables that contain user-defined groups mark those
|
83
|
+
* groups using 'group header' rows.
|
84
|
+
*/
|
85
|
+
td.table-header { background: #B6C870; color: #000000;
|
86
|
+
border-bottom: 1px solid #FFF; }
|
87
|
+
span.table-header { font-size: 110%; font-weight: bold; }
|
88
|
+
th.group-header { text-align: left; font-style: italic;
|
89
|
+
font-size: 110%; }
|
90
|
+
td.spacer { width: 5%; }
|
91
|
+
|
92
|
+
/* Summary Tables (functions, variables, etc)
|
93
|
+
* - Each object is described by a single row of the table with
|
94
|
+
* two cells. The left cell gives the object's type, and is
|
95
|
+
* marked with 'code.summary-type'. The right cell gives the
|
96
|
+
* object's name and a summary description.
|
97
|
+
* - CSS styles for the table's header and group headers are
|
98
|
+
* defined above, under 'Table Headers'
|
99
|
+
*/
|
100
|
+
table.summary { border-collapse: collapse;
|
101
|
+
background: #E6F8A0; color: #000000;
|
102
|
+
margin: 1em 0 .5em 0;
|
103
|
+
border: 0; }
|
104
|
+
table.summary tr { border-bottom: 1px solid #BBB; }
|
105
|
+
td.summary a { font-weight: bold; }
|
106
|
+
code.summary-type { font-size: 85%; }
|
107
|
+
|
108
|
+
/* Details Tables (functions, variables, etc)
|
109
|
+
* - Each object is described in its own single-celled table.
|
110
|
+
* - A single-row summary table w/ table-header is used as
|
111
|
+
* a header for each details section (CSS style for table-header
|
112
|
+
* is defined above, under 'Table Headers').
|
113
|
+
*/
|
114
|
+
|
115
|
+
table.detsummary { margin-top: 2em; }
|
116
|
+
|
117
|
+
table.details { border-collapse: collapse;
|
118
|
+
background: #E6F8A0; color: #000000;
|
119
|
+
border-bottom: 1px solid #BBB;
|
120
|
+
margin: 0; }
|
121
|
+
table.details td { padding: .2em .2em .2em .5em; }
|
122
|
+
table.details table td { padding: 0; }
|
123
|
+
table.details h3 { margin: 5px 0 5px 0; font-size: 105%;
|
124
|
+
font-style: normal; }
|
125
|
+
|
126
|
+
table.details dd { display: inline; margin-left: 5px; }
|
127
|
+
table.details dl { margin-left: 5px; }
|
128
|
+
|
129
|
+
|
130
|
+
/* Index tables (identifier index, term index, etc)
|
131
|
+
* - link-index is used for indices containing lists of links
|
132
|
+
* (namely, the identifier index & term index).
|
133
|
+
* - index-where is used in link indices for the text indicating
|
134
|
+
* the container/source for each link.
|
135
|
+
* - metadata-index is used for indices containing metadata
|
136
|
+
* extracted from fields (namely, the bug index & todo index).
|
137
|
+
*/
|
138
|
+
table.link-index { border-collapse: collapse;
|
139
|
+
background: #F6FFB0; color: #000000;
|
140
|
+
border: 1px solid #608090; }
|
141
|
+
td.link-index { border-width: 0px; }
|
142
|
+
span.index-where { font-size: 70%; }
|
143
|
+
table.metadata-index { border-collapse: collapse;
|
144
|
+
background: #F6FFB0; color: #000000;
|
145
|
+
border: 1px solid #608090;
|
146
|
+
margin: .2em 0 0 0; }
|
147
|
+
td.metadata-index { border-width: 1px; border-style: solid; }
|
148
|
+
|
149
|
+
/* Function signatures
|
150
|
+
* - sig* is used for the signature in the details section.
|
151
|
+
* - .summary-sig* is used for the signature in the summary
|
152
|
+
* table, and when listing property accessor functions.
|
153
|
+
* */
|
154
|
+
.sig-name { color: #006080; }
|
155
|
+
.sig-arg { color: #008060; }
|
156
|
+
.sig-default { color: #602000; }
|
157
|
+
.summary-sig-name { font-weight: bold; }
|
158
|
+
.summary-sig-arg { color: #006040; }
|
159
|
+
.summary-sig-default { color: #501800; }
|
160
|
+
|
161
|
+
/* Variable values
|
162
|
+
* - In the 'variable details' sections, each varaible's value is
|
163
|
+
* listed in a 'pre.variable' box. The width of this box is
|
164
|
+
* restricted to 80 chars; if the value's repr is longer than
|
165
|
+
* this it will be wrapped, using a backslash marked with
|
166
|
+
* class 'variable-linewrap'. If the value's repr is longer
|
167
|
+
* than 3 lines, the rest will be ellided; and an ellipsis
|
168
|
+
* marker ('...' marked with 'variable-ellipsis') will be used.
|
169
|
+
* - If the value is a string, its quote marks will be marked
|
170
|
+
* with 'variable-quote'.
|
171
|
+
* - If the variable is a regexp, it is syntax-highlighted using
|
172
|
+
* the re* CSS classes.
|
173
|
+
*/
|
174
|
+
pre.variable { padding: .5em; margin: 0;
|
175
|
+
background-color: #dce4ec;
|
176
|
+
border: 1px solid #708890; }
|
177
|
+
.variable-linewrap { display: none; }
|
178
|
+
.variable-ellipsis { color: #604000; font-weight: bold; }
|
179
|
+
.variable-quote { color: #604000; font-weight: bold; }
|
180
|
+
.re { color: #000000; }
|
181
|
+
.re-char { color: #006030; }
|
182
|
+
.re-op { color: #600000; }
|
183
|
+
.re-group { color: #003060; }
|
184
|
+
.re-ref { color: #404040; }
|
185
|
+
|
186
|
+
/* Base tree
|
187
|
+
* - Used by class pages to display the base class hierarchy.
|
188
|
+
*/
|
189
|
+
pre.base-tree { font-size: 90%; margin: 1em 0 2em 0;
|
190
|
+
line-height: 100%;}
|
191
|
+
|
192
|
+
/* Frames-based table of contents headers
|
193
|
+
* - Consists of two frames: one for selecting modules; and
|
194
|
+
* the other listing the contents of the selected module.
|
195
|
+
* - h1.toc is used for each frame's heading
|
196
|
+
* - h2.toc is used for subheadings within each frame.
|
197
|
+
*/
|
198
|
+
h1.toc { text-align: center; font-size: 105%;
|
199
|
+
margin: 0; font-weight: bold;
|
200
|
+
padding: 0; }
|
201
|
+
h2.toc { font-size: 100%; font-weight: bold;
|
202
|
+
margin: 0.5em 0 0 -0.3em; }
|
203
|
+
|
204
|
+
/* Syntax Highlighting for Source Code
|
205
|
+
* - doctest examples are displayed in a 'pre.py-doctest' block.
|
206
|
+
* If the example is in a details table entry, then it will use
|
207
|
+
* the colors specified by the 'table pre.py-doctest' line.
|
208
|
+
* - Source code listings are displayed in a 'pre.py-src' block.
|
209
|
+
* Each line is marked with 'span.py-line' (used to draw a line
|
210
|
+
* down the left margin, separating the code from the line
|
211
|
+
* numbers). Line numbers are displayed with 'span.py-lineno'.
|
212
|
+
* The expand/collapse block toggle button is displayed with
|
213
|
+
* 'a.py-toggle' (Note: the CSS style for 'a.py-toggle' should not
|
214
|
+
* modify the font size of the text.)
|
215
|
+
* - If a source code page is opened with an anchor, then the
|
216
|
+
* corresponding code block will be highlighted. The code
|
217
|
+
* block's header is highlighted with 'py-highlight-hdr'; and
|
218
|
+
* the code block's body is highlighted with 'py-highlight'.
|
219
|
+
* - The remaining py-* classes are used to perform syntax
|
220
|
+
* highlighting (py-string for string literals, py-name for names,
|
221
|
+
* etc.)
|
222
|
+
*/
|
223
|
+
pre.rst-literal-block,
|
224
|
+
pre.py-doctest { margin-left: 1em; margin-right: 1.5em;
|
225
|
+
line-height: 150%;
|
226
|
+
background-color: #F5FFD0; padding: .5em;
|
227
|
+
border: 1px solid #B6C870;
|
228
|
+
font-size: 110%; }
|
229
|
+
pre.py-src { border: 1px solid #BBB; margin-top: 3em;
|
230
|
+
background: #f0f0f0; color: #000000;
|
231
|
+
line-height: 150%; }
|
232
|
+
span.py-line { margin-left: .2em; padding-left: .4em; }
|
233
|
+
span.py-lineno { border-right: 1px solid #BBB;
|
234
|
+
padding: .3em .5em .3em .5em;
|
235
|
+
font-style: italic; font-size: 90%; }
|
236
|
+
a.py-toggle { text-decoration: none; }
|
237
|
+
div.py-highlight-hdr { border-top: 1px solid #BBB;
|
238
|
+
background: #d0e0e0; }
|
239
|
+
div.py-highlight { border-bottom: 1px solid #BBB;
|
240
|
+
background: #d0e0e0; }
|
241
|
+
.py-prompt { color: #005050; font-weight: bold;}
|
242
|
+
.py-string { color: #006030; }
|
243
|
+
.py-comment { color: #003060; }
|
244
|
+
.py-keyword { color: #600000; }
|
245
|
+
.py-output { color: #404040; }
|
246
|
+
.py-name { color: #000050; }
|
247
|
+
.py-name:link { color: #000050; }
|
248
|
+
.py-name:visited { color: #000050; }
|
249
|
+
.py-number { color: #005000; }
|
250
|
+
.py-def-name { color: #000060; font-weight: bold; }
|
251
|
+
.py-base-class { color: #000060; }
|
252
|
+
.py-param { color: #000060; }
|
253
|
+
.py-docstring { color: #006030; }
|
254
|
+
.py-decorator { color: #804020; }
|
255
|
+
/* Use this if you don't want links to names underlined: */
|
256
|
+
/*a.py-name { text-decoration: none; }*/
|
257
|
+
|
258
|
+
/* Graphs & Diagrams
|
259
|
+
* - These CSS styles are used for graphs & diagrams generated using
|
260
|
+
* Graphviz dot. 'img.graph-without-title' is used for bare
|
261
|
+
* diagrams (to remove the border created by making the image
|
262
|
+
* clickable).
|
263
|
+
*/
|
264
|
+
img.graph-without-title { border: none; }
|
265
|
+
img.graph-with-title { border: 1px solid #000000; }
|
266
|
+
span.graph-title { font-weight: bold; }
|
267
|
+
span.graph-caption { }
|
268
|
+
|
269
|
+
/* General-purpose classes
|
270
|
+
* - 'p.indent-wrapped-lines' defines a paragraph whose first line
|
271
|
+
* is not indented, but whose subsequent lines are.
|
272
|
+
* - The 'nomargin-top' class is used to remove the top margin (e.g.
|
273
|
+
* from lists). The 'nomargin' class is used to remove both the
|
274
|
+
* top and bottom margin (but not the left or right margin --
|
275
|
+
* for lists, that would cause the bullets to disappear.)
|
276
|
+
*/
|
277
|
+
p.indent-wrapped-lines { padding: 0 0 0 7em; text-indent: -7em;
|
278
|
+
margin: 0; }
|
279
|
+
.nomargin-top { margin-top: 0; }
|
280
|
+
.nomargin { margin-top: 0; margin-bottom: 0; }
|
@@ -0,0 +1,205 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
"""
|
4
|
+
Codetags finder
|
5
|
+
~~~~~~~~~~~~~~~
|
6
|
+
|
7
|
+
Find code tags in specified files and/or directories
|
8
|
+
and create a report in HTML format.
|
9
|
+
|
10
|
+
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
|
11
|
+
:license: BSD, see LICENSE for details.
|
12
|
+
"""
|
13
|
+
|
14
|
+
import sys, os, re
|
15
|
+
import getopt
|
16
|
+
from os.path import join, abspath, isdir, isfile
|
17
|
+
|
18
|
+
|
19
|
+
TAGS = set(('XXX', 'TODO', 'FIXME', 'HACK'))
|
20
|
+
|
21
|
+
tag_re = re.compile(
|
22
|
+
r'(?P<tag>\b' + r'\b|\b'.join(TAGS) + r'\b)\s*'
|
23
|
+
r'(?: \( (?P<who> .*? ) \) )?'
|
24
|
+
r'\s*:?\s* (?P<what> .*? ) \s* $',
|
25
|
+
re.X)
|
26
|
+
|
27
|
+
binary_re = re.compile('[\x00-\x06\x0E-\x1F]')
|
28
|
+
|
29
|
+
|
30
|
+
def escape_html(text):
|
31
|
+
return text.replace('&', '&'). \
|
32
|
+
replace('<', '<'). \
|
33
|
+
replace('>', '>'). \
|
34
|
+
replace('"', '"')
|
35
|
+
|
36
|
+
def process_file(store, filename):
|
37
|
+
try:
|
38
|
+
f = open(filename, 'r')
|
39
|
+
except (IOError, OSError):
|
40
|
+
return False
|
41
|
+
llmatch = 0
|
42
|
+
try:
|
43
|
+
for lno, line in enumerate(f):
|
44
|
+
# just some random heuristics to filter out binary files
|
45
|
+
if lno < 100 and binary_re.search(line):
|
46
|
+
return False
|
47
|
+
m = tag_re.search(line)
|
48
|
+
if m:
|
49
|
+
store.setdefault(filename, []).append({
|
50
|
+
'lno': lno+1,
|
51
|
+
'tag': m.group('tag'),
|
52
|
+
'who': m.group('who') or '',
|
53
|
+
'what': escape_html(m.group('what')),
|
54
|
+
})
|
55
|
+
# 'what' cannot start at column 0
|
56
|
+
llmatch = m.start('what')
|
57
|
+
elif llmatch:
|
58
|
+
# continuation lines
|
59
|
+
# XXX: this is Python centric, doesn't work for
|
60
|
+
# JavaScript, for example.
|
61
|
+
if line[:llmatch].replace('#', '').isspace():
|
62
|
+
cont = line[llmatch:].strip()
|
63
|
+
if cont:
|
64
|
+
store[filename][-1]['what'] += ' ' + escape_html(cont)
|
65
|
+
continue
|
66
|
+
llmatch = 0
|
67
|
+
return True
|
68
|
+
finally:
|
69
|
+
f.close()
|
70
|
+
|
71
|
+
|
72
|
+
def main():
|
73
|
+
try:
|
74
|
+
gopts, args = getopt.getopt(sys.argv[1:], "vo:i:")
|
75
|
+
except getopt.GetoptError:
|
76
|
+
print ("Usage: %s [-v] [-i ignoredir]* [-o reportfile.html] "
|
77
|
+
"path ..." % sys.argv[0])
|
78
|
+
return 2
|
79
|
+
opts = {}
|
80
|
+
for opt, val in gopts:
|
81
|
+
if opt == '-i':
|
82
|
+
val = abspath(val)
|
83
|
+
opts.setdefault(opt, []).append(val)
|
84
|
+
|
85
|
+
if not args:
|
86
|
+
args = ['.']
|
87
|
+
|
88
|
+
if '-o' in opts:
|
89
|
+
output = abspath(opts['-o'][-1])
|
90
|
+
else:
|
91
|
+
output = abspath('tags.html')
|
92
|
+
|
93
|
+
verbose = '-v' in opts
|
94
|
+
|
95
|
+
store = {}
|
96
|
+
gnum = 0
|
97
|
+
num = 0
|
98
|
+
|
99
|
+
for path in args:
|
100
|
+
print "Searching for code tags in %s, please wait." % path
|
101
|
+
|
102
|
+
if isfile(path):
|
103
|
+
gnum += 1
|
104
|
+
if process_file(store, path):
|
105
|
+
if verbose:
|
106
|
+
print path + ": found %d tags" % \
|
107
|
+
(path in store and len(store[path]) or 0)
|
108
|
+
num += 1
|
109
|
+
else:
|
110
|
+
if verbose:
|
111
|
+
print path + ": binary or not readable"
|
112
|
+
continue
|
113
|
+
elif not isdir(path):
|
114
|
+
continue
|
115
|
+
|
116
|
+
for root, dirs, files in os.walk(path):
|
117
|
+
if '-i' in opts and abspath(root) in opts['-i']:
|
118
|
+
del dirs[:]
|
119
|
+
continue
|
120
|
+
if '.svn' in dirs:
|
121
|
+
dirs.remove('.svn')
|
122
|
+
for fn in files:
|
123
|
+
gnum += 1
|
124
|
+
if gnum % 50 == 0 and not verbose:
|
125
|
+
sys.stdout.write('.')
|
126
|
+
sys.stdout.flush()
|
127
|
+
|
128
|
+
fn = join(root, fn)
|
129
|
+
|
130
|
+
if fn.endswith('.pyc') or fn.endswith('.pyo'):
|
131
|
+
continue
|
132
|
+
elif '-i' in opts and abspath(fn) in opts['-i']:
|
133
|
+
continue
|
134
|
+
elif abspath(fn) == output:
|
135
|
+
continue
|
136
|
+
|
137
|
+
if fn[:2] == './': fn = fn[2:]
|
138
|
+
if process_file(store, fn):
|
139
|
+
if verbose:
|
140
|
+
print fn + ": found %d tags" % \
|
141
|
+
(fn in store and len(store[fn]) or 0)
|
142
|
+
num += 1
|
143
|
+
else:
|
144
|
+
if verbose:
|
145
|
+
print fn + ": binary or not readable"
|
146
|
+
print
|
147
|
+
|
148
|
+
print "Processed %d of %d files. Found %d tags in %d files." % (
|
149
|
+
num, gnum, sum(len(fitem) for fitem in store.itervalues()), len(store))
|
150
|
+
|
151
|
+
if not store:
|
152
|
+
return 0
|
153
|
+
|
154
|
+
HTML = '''\
|
155
|
+
<html>
|
156
|
+
<head>
|
157
|
+
<title>Code tags report</title>
|
158
|
+
<style type="text/css">
|
159
|
+
body { font-family: Trebuchet MS,Verdana,sans-serif;
|
160
|
+
width: 80%%; margin-left: auto; margin-right: auto; }
|
161
|
+
table { width: 100%%; border-spacing: 0;
|
162
|
+
border: 1px solid #CCC; }
|
163
|
+
th { font-weight: bold; background-color: #DDD }
|
164
|
+
td { padding: 2px 5px 2px 5px;
|
165
|
+
vertical-align: top; }
|
166
|
+
.tr0 { background-color: #EEEEEE; }
|
167
|
+
.tr1 { background-color: #F6F6F6; }
|
168
|
+
.tag { text-align: center; font-weight: bold; }
|
169
|
+
.tr0 .tag { background-color: #FFEEEE; }
|
170
|
+
.tr1 .tag { background-color: #FFDDDD; }
|
171
|
+
.head { padding-top: 10px; font-size: 100%%; font-weight: bold }
|
172
|
+
.XXX { color: #500; }
|
173
|
+
.FIXME { color: red; }
|
174
|
+
.TODO { color: #880; }
|
175
|
+
</style>
|
176
|
+
</head>
|
177
|
+
<body>
|
178
|
+
<h1>Code tags report for %s</h1>
|
179
|
+
<table>
|
180
|
+
<tr><th>Line</th><th>Tag</th><th>Who</th><th>Description</th></tr>
|
181
|
+
%s
|
182
|
+
</table>
|
183
|
+
</body>
|
184
|
+
</html>
|
185
|
+
'''
|
186
|
+
|
187
|
+
TABLE = '\n<tr><td class="head" colspan="4">File: %s</td>\n'
|
188
|
+
|
189
|
+
TR = ('<tr class="tr%d"><td class="lno">%%(lno)d</td>'
|
190
|
+
'<td class="tag %%(tag)s">%%(tag)s</td>'
|
191
|
+
'<td class="who">%%(who)s</td><td class="what">%%(what)s</td></tr>')
|
192
|
+
|
193
|
+
f = file(output, 'w')
|
194
|
+
table = '\n'.join(TABLE % fname +
|
195
|
+
'\n'.join(TR % (no % 2,) % entry
|
196
|
+
for no, entry in enumerate(store[fname]))
|
197
|
+
for fname in sorted(store))
|
198
|
+
f.write(HTML % (', '.join(map(abspath, args)), table))
|
199
|
+
f.close()
|
200
|
+
|
201
|
+
print "Report written to %s." % output
|
202
|
+
return 0
|
203
|
+
|
204
|
+
if __name__ == '__main__':
|
205
|
+
sys.exit(main())
|