bee_python 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +202 -0
- data/build/README +23 -0
- data/egg/egg/build.yml +70 -0
- data/egg/egg/ez_setup.py +280 -0
- data/egg/egg/script.py +12 -0
- data/egg/egg/setup.erb +11 -0
- data/egg/egg/suite.py +37 -0
- data/egg/egg/test.py +31 -0
- data/egg/egg.yml +69 -0
- data/egg/http/build.erb +53 -0
- data/egg/http/server.py +34 -0
- data/egg/http.yml +50 -0
- data/egg/mysql/mysql.py +43 -0
- data/egg/mysql.yml +44 -0
- data/egg/project/build.erb +77 -0
- data/egg/project/script.py +42 -0
- data/egg/project/test.py +31 -0
- data/egg/project.yml +59 -0
- data/egg/script/build.erb +35 -0
- data/egg/script/script.py +42 -0
- data/egg/script.yml +50 -0
- data/egg/soap/build.erb +52 -0
- data/egg/soap/client.py +18 -0
- data/egg/soap/server.py +30 -0
- data/egg/soap.yml +58 -0
- data/egg/source/source.py +42 -0
- data/egg/source.yml +47 -0
- data/egg/test/test.py +28 -0
- data/egg/test.yml +44 -0
- data/egg/xmlrpc/build.erb +52 -0
- data/egg/xmlrpc/client.py +22 -0
- data/egg/xmlrpc/server.py +24 -0
- data/egg/xmlrpc.yml +51 -0
- data/lib/bee_task_python.rb +390 -0
- data/test/build.yml +16 -0
- data/test/tc_bee_task_python.rb +27 -0
- data/test/test_build.rb +26 -0
- data/test/test_build_listener.rb +62 -0
- data/test/ts_bee_python.rb +26 -0
- data/tools/common/__init__.py +5 -0
- data/tools/common/common/__init__.py +140 -0
- data/tools/common/common/__pkginfo__.py +43 -0
- data/tools/common/common/adbh.py +35 -0
- data/tools/common/common/cache.py +114 -0
- data/tools/common/common/changelog.py +234 -0
- data/tools/common/common/clcommands.py +181 -0
- data/tools/common/common/cli.py +212 -0
- data/tools/common/common/compat.py +328 -0
- data/tools/common/common/configuration.py +1087 -0
- data/tools/common/common/contexts.py +58 -0
- data/tools/common/common/corbautils.py +117 -0
- data/tools/common/common/daemon.py +171 -0
- data/tools/common/common/date.py +279 -0
- data/tools/common/common/db.py +49 -0
- data/tools/common/common/dbf.py +229 -0
- data/tools/common/common/debugger.py +208 -0
- data/tools/common/common/decorators.py +190 -0
- data/tools/common/common/deprecation.py +118 -0
- data/tools/common/common/fileutils.py +409 -0
- data/tools/common/common/graph.py +259 -0
- data/tools/common/common/html.py +142 -0
- data/tools/common/common/interface.py +76 -0
- data/tools/common/common/logging_ext.py +166 -0
- data/tools/common/common/modutils.py +670 -0
- data/tools/common/common/optik_ext.py +383 -0
- data/tools/common/common/optparser.py +92 -0
- data/tools/common/common/pdf_ext.py +111 -0
- data/tools/common/common/proc.py +276 -0
- data/tools/common/common/pyro_ext.py +146 -0
- data/tools/common/common/pytest.py +754 -0
- data/tools/common/common/shellutils.py +383 -0
- data/tools/common/common/sphinx_ext.py +87 -0
- data/tools/common/common/sphinxutils.py +122 -0
- data/tools/common/common/sqlgen.py +31 -0
- data/tools/common/common/table.py +930 -0
- data/tools/common/common/tasksqueue.py +97 -0
- data/tools/common/common/test/__init__.py +1 -0
- data/tools/common/common/test/data/ChangeLog +184 -0
- data/tools/common/common/test/data/MyPyPa-0.1.0-py2.5.egg +0 -0
- data/tools/common/common/test/data/__init__.py +1 -0
- data/tools/common/common/test/data/content_differ_dir/NOTHING +0 -0
- data/tools/common/common/test/data/content_differ_dir/README +1 -0
- data/tools/common/common/test/data/content_differ_dir/subdir/coin +1 -0
- data/tools/common/common/test/data/content_differ_dir/subdir/toto.txt +53 -0
- data/tools/common/common/test/data/file_differ_dir/NOTHING +0 -0
- data/tools/common/common/test/data/file_differ_dir/README +1 -0
- data/tools/common/common/test/data/file_differ_dir/subdir/toto.txt +53 -0
- data/tools/common/common/test/data/file_differ_dir/subdirtwo/Hello +0 -0
- data/tools/common/common/test/data/find_test/__init__.py +0 -0
- data/tools/common/common/test/data/find_test/foo.txt +0 -0
- data/tools/common/common/test/data/find_test/module.py +0 -0
- data/tools/common/common/test/data/find_test/module2.py +0 -0
- data/tools/common/common/test/data/find_test/newlines.txt +0 -0
- data/tools/common/common/test/data/find_test/noendingnewline.py +0 -0
- data/tools/common/common/test/data/find_test/nonregr.py +0 -0
- data/tools/common/common/test/data/find_test/normal_file.txt +0 -0
- data/tools/common/common/test/data/find_test/spam.txt +0 -0
- data/tools/common/common/test/data/find_test/sub/doc.txt +0 -0
- data/tools/common/common/test/data/find_test/sub/momo.py +0 -0
- data/tools/common/common/test/data/find_test/test.ini +0 -0
- data/tools/common/common/test/data/find_test/test1.msg +0 -0
- data/tools/common/common/test/data/find_test/test2.msg +0 -0
- data/tools/common/common/test/data/find_test/write_protected_file.txt +0 -0
- data/tools/common/common/test/data/foo.txt +9 -0
- data/tools/common/common/test/data/module.py +88 -0
- data/tools/common/common/test/data/module2.py +77 -0
- data/tools/common/common/test/data/newlines.txt +3 -0
- data/tools/common/common/test/data/noendingnewline.py +36 -0
- data/tools/common/common/test/data/nonregr.py +14 -0
- data/tools/common/common/test/data/normal_file.txt +0 -0
- data/tools/common/common/test/data/reference_dir/NOTHING +0 -0
- data/tools/common/common/test/data/reference_dir/README +1 -0
- data/tools/common/common/test/data/reference_dir/subdir/coin +1 -0
- data/tools/common/common/test/data/reference_dir/subdir/toto.txt +53 -0
- data/tools/common/common/test/data/same_dir/NOTHING +0 -0
- data/tools/common/common/test/data/same_dir/README +1 -0
- data/tools/common/common/test/data/same_dir/subdir/coin +1 -0
- data/tools/common/common/test/data/same_dir/subdir/toto.txt +53 -0
- data/tools/common/common/test/data/spam.txt +9 -0
- data/tools/common/common/test/data/sub/doc.txt +1 -0
- data/tools/common/common/test/data/sub/momo.py +1 -0
- data/tools/common/common/test/data/subdir_differ_dir/NOTHING +0 -0
- data/tools/common/common/test/data/subdir_differ_dir/README +1 -0
- data/tools/common/common/test/data/subdir_differ_dir/subdir/coin +1 -0
- data/tools/common/common/test/data/subdir_differ_dir/subdir/toto.txt +53 -0
- data/tools/common/common/test/data/test.ini +20 -0
- data/tools/common/common/test/data/test1.msg +30 -0
- data/tools/common/common/test/data/test2.msg +42 -0
- data/tools/common/common/test/data/write_protected_file.txt +0 -0
- data/tools/common/common/test/foomod.py +17 -0
- data/tools/common/common/test/unittest_cache.py +129 -0
- data/tools/common/common/test/unittest_changelog.py +37 -0
- data/tools/common/common/test/unittest_compat.py +239 -0
- data/tools/common/common/test/unittest_configuration.py +348 -0
- data/tools/common/common/test/unittest_date.py +154 -0
- data/tools/common/common/test/unittest_decorators.py +62 -0
- data/tools/common/common/test/unittest_deprecation.py +76 -0
- data/tools/common/common/test/unittest_fileutils.py +133 -0
- data/tools/common/common/test/unittest_graph.py +50 -0
- data/tools/common/common/test/unittest_html.py +76 -0
- data/tools/common/common/test/unittest_interface.py +87 -0
- data/tools/common/common/test/unittest_modutils.py +244 -0
- data/tools/common/common/test/unittest_pytest.py +50 -0
- data/tools/common/common/test/unittest_shellutils.py +248 -0
- data/tools/common/common/test/unittest_table.py +448 -0
- data/tools/common/common/test/unittest_taskqueue.py +71 -0
- data/tools/common/common/test/unittest_testlib.py +956 -0
- data/tools/common/common/test/unittest_textutils.py +247 -0
- data/tools/common/common/test/unittest_tree.py +248 -0
- data/tools/common/common/test/unittest_umessage.py +55 -0
- data/tools/common/common/test/unittest_ureports_html.py +64 -0
- data/tools/common/common/test/unittest_ureports_text.py +105 -0
- data/tools/common/common/test/unittest_xmlutils.py +75 -0
- data/tools/common/common/test/utils.py +87 -0
- data/tools/common/common/testlib.py +1927 -0
- data/tools/common/common/textutils.py +476 -0
- data/tools/common/common/tree.py +372 -0
- data/tools/common/common/umessage.py +161 -0
- data/tools/common/common/ureports/__init__.py +174 -0
- data/tools/common/common/ureports/docbook_writer.py +139 -0
- data/tools/common/common/ureports/html_writer.py +131 -0
- data/tools/common/common/ureports/nodes.py +201 -0
- data/tools/common/common/ureports/text_writer.py +140 -0
- data/tools/common/common/vcgutils.py +216 -0
- data/tools/common/common/visitor.py +107 -0
- data/tools/common/common/xmlrpcutils.py +136 -0
- data/tools/common/common/xmlutils.py +61 -0
- data/tools/compile/compile.py +16 -0
- data/tools/coverage/coverage.py +602 -0
- data/tools/epydoc/__init__.py +227 -0
- data/tools/epydoc/__init__.pyc +0 -0
- data/tools/epydoc/apidoc.py +2203 -0
- data/tools/epydoc/apidoc.pyc +0 -0
- data/tools/epydoc/checker.py +349 -0
- data/tools/epydoc/checker.pyc +0 -0
- data/tools/epydoc/cli.py +1470 -0
- data/tools/epydoc/cli.pyc +0 -0
- data/tools/epydoc/compat.py +250 -0
- data/tools/epydoc/compat.pyc +0 -0
- data/tools/epydoc/docbuilder.py +1358 -0
- data/tools/epydoc/docbuilder.pyc +0 -0
- data/tools/epydoc/docintrospecter.py +1056 -0
- data/tools/epydoc/docintrospecter.pyc +0 -0
- data/tools/epydoc/docparser.py +2113 -0
- data/tools/epydoc/docparser.pyc +0 -0
- data/tools/epydoc/docstringparser.py +1111 -0
- data/tools/epydoc/docstringparser.pyc +0 -0
- data/tools/epydoc/docwriter/__init__.py +12 -0
- data/tools/epydoc/docwriter/__init__.pyc +0 -0
- data/tools/epydoc/docwriter/dotgraph.py +1351 -0
- data/tools/epydoc/docwriter/dotgraph.pyc +0 -0
- data/tools/epydoc/docwriter/html.py +3491 -0
- data/tools/epydoc/docwriter/html.pyc +0 -0
- data/tools/epydoc/docwriter/html_colorize.py +909 -0
- data/tools/epydoc/docwriter/html_colorize.pyc +0 -0
- data/tools/epydoc/docwriter/html_css.py +550 -0
- data/tools/epydoc/docwriter/html_css.pyc +0 -0
- data/tools/epydoc/docwriter/html_help.py +190 -0
- data/tools/epydoc/docwriter/html_help.pyc +0 -0
- data/tools/epydoc/docwriter/latex.py +1187 -0
- data/tools/epydoc/docwriter/latex.pyc +0 -0
- data/tools/epydoc/docwriter/plaintext.py +276 -0
- data/tools/epydoc/docwriter/plaintext.pyc +0 -0
- data/tools/epydoc/docwriter/xlink.py +505 -0
- data/tools/epydoc/docwriter/xlink.pyc +0 -0
- data/tools/epydoc/gui.py +1148 -0
- data/tools/epydoc/gui.pyc +0 -0
- data/tools/epydoc/log.py +204 -0
- data/tools/epydoc/log.pyc +0 -0
- data/tools/epydoc/markup/__init__.py +623 -0
- data/tools/epydoc/markup/__init__.pyc +0 -0
- data/tools/epydoc/markup/doctest.py +311 -0
- data/tools/epydoc/markup/doctest.pyc +0 -0
- data/tools/epydoc/markup/epytext.py +2116 -0
- data/tools/epydoc/markup/epytext.pyc +0 -0
- data/tools/epydoc/markup/javadoc.py +250 -0
- data/tools/epydoc/markup/javadoc.pyc +0 -0
- data/tools/epydoc/markup/plaintext.py +78 -0
- data/tools/epydoc/markup/plaintext.pyc +0 -0
- data/tools/epydoc/markup/pyval_repr.py +532 -0
- data/tools/epydoc/markup/pyval_repr.pyc +0 -0
- data/tools/epydoc/markup/restructuredtext.py +906 -0
- data/tools/epydoc/markup/restructuredtext.pyc +0 -0
- data/tools/epydoc/test/__init__.py +97 -0
- data/tools/epydoc/test/__init__.pyc +0 -0
- data/tools/epydoc/test/util.py +226 -0
- data/tools/epydoc/test/util.pyc +0 -0
- data/tools/epydoc/util.py +289 -0
- data/tools/epydoc/util.pyc +0 -0
- data/tools/logilab/logilab/__init__.py +5 -0
- data/tools/logilab/logilab/astng/__init__.py +82 -0
- data/tools/logilab/logilab/astng/__pkginfo__.py +76 -0
- data/tools/logilab/logilab/astng/_exceptions.py +64 -0
- data/tools/logilab/logilab/astng/_nodes_ast.py +667 -0
- data/tools/logilab/logilab/astng/_nodes_compiler.py +758 -0
- data/tools/logilab/logilab/astng/bases.py +608 -0
- data/tools/logilab/logilab/astng/builder.py +239 -0
- data/tools/logilab/logilab/astng/inference.py +426 -0
- data/tools/logilab/logilab/astng/inspector.py +289 -0
- data/tools/logilab/logilab/astng/manager.py +421 -0
- data/tools/logilab/logilab/astng/mixins.py +165 -0
- data/tools/logilab/logilab/astng/node_classes.py +848 -0
- data/tools/logilab/logilab/astng/nodes.py +85 -0
- data/tools/logilab/logilab/astng/nodes_as_string.py +389 -0
- data/tools/logilab/logilab/astng/patchcomptransformer.py +159 -0
- data/tools/logilab/logilab/astng/protocols.py +333 -0
- data/tools/logilab/logilab/astng/raw_building.py +212 -0
- data/tools/logilab/logilab/astng/rebuilder.py +307 -0
- data/tools/logilab/logilab/astng/scoped_nodes.py +951 -0
- data/tools/logilab/logilab/astng/test/__init__.py +19 -0
- data/tools/logilab/logilab/astng/test/data/MyPyPa-0.1.0-py2.5.egg +0 -0
- data/tools/logilab/logilab/astng/test/data/MyPyPa-0.1.0-py2.5.zip +0 -0
- data/tools/logilab/logilab/astng/test/data/SSL1/Connection1.py +33 -0
- data/tools/logilab/logilab/astng/test/data/SSL1/__init__.py +20 -0
- data/tools/logilab/logilab/astng/test/data/__init__.py +20 -0
- data/tools/logilab/logilab/astng/test/data/all.py +29 -0
- data/tools/logilab/logilab/astng/test/data/appl/__init__.py +23 -0
- data/tools/logilab/logilab/astng/test/data/appl/myConnection.py +30 -0
- data/tools/logilab/logilab/astng/test/data/format.py +34 -0
- data/tools/logilab/logilab/astng/test/data/module.py +90 -0
- data/tools/logilab/logilab/astng/test/data/module2.py +112 -0
- data/tools/logilab/logilab/astng/test/data/noendingnewline.py +57 -0
- data/tools/logilab/logilab/astng/test/data/nonregr.py +76 -0
- data/tools/logilab/logilab/astng/test/data/notall.py +28 -0
- data/tools/logilab/logilab/astng/test/data2/__init__.py +20 -0
- data/tools/logilab/logilab/astng/test/data2/clientmodule_test.py +51 -0
- data/tools/logilab/logilab/astng/test/data2/suppliermodule_test.py +32 -0
- data/tools/logilab/logilab/astng/test/regrtest.py +135 -0
- data/tools/logilab/logilab/astng/test/regrtest_data/absimport.py +22 -0
- data/tools/logilab/logilab/astng/test/regrtest_data/descriptor_crash.py +31 -0
- data/tools/logilab/logilab/astng/test/regrtest_data/import_package_subpackage_module.py +68 -0
- data/tools/logilab/logilab/astng/test/regrtest_data/package/__init__.py +24 -0
- data/tools/logilab/logilab/astng/test/regrtest_data/package/subpackage/__init__.py +20 -0
- data/tools/logilab/logilab/astng/test/regrtest_data/package/subpackage/module.py +20 -0
- data/tools/logilab/logilab/astng/test/unittest_builder.py +684 -0
- data/tools/logilab/logilab/astng/test/unittest_inference.py +1112 -0
- data/tools/logilab/logilab/astng/test/unittest_inspector.py +105 -0
- data/tools/logilab/logilab/astng/test/unittest_lookup.py +302 -0
- data/tools/logilab/logilab/astng/test/unittest_manager.py +98 -0
- data/tools/logilab/logilab/astng/test/unittest_nodes.py +302 -0
- data/tools/logilab/logilab/astng/test/unittest_scoped_nodes.py +501 -0
- data/tools/logilab/logilab/astng/test/unittest_utils.py +104 -0
- data/tools/logilab/logilab/astng/utils.py +342 -0
- data/tools/logilab/logilab/common/__init__.py +140 -0
- data/tools/logilab/logilab/common/__pkginfo__.py +43 -0
- data/tools/logilab/logilab/common/adbh.py +35 -0
- data/tools/logilab/logilab/common/cache.py +114 -0
- data/tools/logilab/logilab/common/changelog.py +234 -0
- data/tools/logilab/logilab/common/clcommands.py +181 -0
- data/tools/logilab/logilab/common/cli.py +212 -0
- data/tools/logilab/logilab/common/compat.py +328 -0
- data/tools/logilab/logilab/common/configuration.py +1087 -0
- data/tools/logilab/logilab/common/contexts.py +58 -0
- data/tools/logilab/logilab/common/corbautils.py +117 -0
- data/tools/logilab/logilab/common/daemon.py +171 -0
- data/tools/logilab/logilab/common/date.py +279 -0
- data/tools/logilab/logilab/common/db.py +49 -0
- data/tools/logilab/logilab/common/dbf.py +229 -0
- data/tools/logilab/logilab/common/debugger.py +208 -0
- data/tools/logilab/logilab/common/decorators.py +190 -0
- data/tools/logilab/logilab/common/deprecation.py +118 -0
- data/tools/logilab/logilab/common/fileutils.py +409 -0
- data/tools/logilab/logilab/common/graph.py +259 -0
- data/tools/logilab/logilab/common/html.py +142 -0
- data/tools/logilab/logilab/common/interface.py +76 -0
- data/tools/logilab/logilab/common/logging_ext.py +166 -0
- data/tools/logilab/logilab/common/modutils.py +670 -0
- data/tools/logilab/logilab/common/optik_ext.py +383 -0
- data/tools/logilab/logilab/common/optparser.py +92 -0
- data/tools/logilab/logilab/common/pdf_ext.py +111 -0
- data/tools/logilab/logilab/common/proc.py +276 -0
- data/tools/logilab/logilab/common/pyro_ext.py +146 -0
- data/tools/logilab/logilab/common/pytest.py +754 -0
- data/tools/logilab/logilab/common/shellutils.py +383 -0
- data/tools/logilab/logilab/common/sphinx_ext.py +87 -0
- data/tools/logilab/logilab/common/sphinxutils.py +122 -0
- data/tools/logilab/logilab/common/sqlgen.py +31 -0
- data/tools/logilab/logilab/common/table.py +930 -0
- data/tools/logilab/logilab/common/tasksqueue.py +97 -0
- data/tools/logilab/logilab/common/test/__init__.py +1 -0
- data/tools/logilab/logilab/common/test/data/ChangeLog +184 -0
- data/tools/logilab/logilab/common/test/data/MyPyPa-0.1.0-py2.5.egg +0 -0
- data/tools/logilab/logilab/common/test/data/__init__.py +1 -0
- data/tools/logilab/logilab/common/test/data/content_differ_dir/NOTHING +0 -0
- data/tools/logilab/logilab/common/test/data/content_differ_dir/README +1 -0
- data/tools/logilab/logilab/common/test/data/content_differ_dir/subdir/coin +1 -0
- data/tools/logilab/logilab/common/test/data/content_differ_dir/subdir/toto.txt +53 -0
- data/tools/logilab/logilab/common/test/data/file_differ_dir/NOTHING +0 -0
- data/tools/logilab/logilab/common/test/data/file_differ_dir/README +1 -0
- data/tools/logilab/logilab/common/test/data/file_differ_dir/subdir/toto.txt +53 -0
- data/tools/logilab/logilab/common/test/data/file_differ_dir/subdirtwo/Hello +0 -0
- data/tools/logilab/logilab/common/test/data/find_test/__init__.py +0 -0
- data/tools/logilab/logilab/common/test/data/find_test/foo.txt +0 -0
- data/tools/logilab/logilab/common/test/data/find_test/module.py +0 -0
- data/tools/logilab/logilab/common/test/data/find_test/module2.py +0 -0
- data/tools/logilab/logilab/common/test/data/find_test/newlines.txt +0 -0
- data/tools/logilab/logilab/common/test/data/find_test/noendingnewline.py +0 -0
- data/tools/logilab/logilab/common/test/data/find_test/nonregr.py +0 -0
- data/tools/logilab/logilab/common/test/data/find_test/normal_file.txt +0 -0
- data/tools/logilab/logilab/common/test/data/find_test/spam.txt +0 -0
- data/tools/logilab/logilab/common/test/data/find_test/sub/doc.txt +0 -0
- data/tools/logilab/logilab/common/test/data/find_test/sub/momo.py +0 -0
- data/tools/logilab/logilab/common/test/data/find_test/test.ini +0 -0
- data/tools/logilab/logilab/common/test/data/find_test/test1.msg +0 -0
- data/tools/logilab/logilab/common/test/data/find_test/test2.msg +0 -0
- data/tools/logilab/logilab/common/test/data/find_test/write_protected_file.txt +0 -0
- data/tools/logilab/logilab/common/test/data/foo.txt +9 -0
- data/tools/logilab/logilab/common/test/data/module.py +88 -0
- data/tools/logilab/logilab/common/test/data/module2.py +77 -0
- data/tools/logilab/logilab/common/test/data/newlines.txt +3 -0
- data/tools/logilab/logilab/common/test/data/noendingnewline.py +36 -0
- data/tools/logilab/logilab/common/test/data/nonregr.py +14 -0
- data/tools/logilab/logilab/common/test/data/normal_file.txt +0 -0
- data/tools/logilab/logilab/common/test/data/reference_dir/NOTHING +0 -0
- data/tools/logilab/logilab/common/test/data/reference_dir/README +1 -0
- data/tools/logilab/logilab/common/test/data/reference_dir/subdir/coin +1 -0
- data/tools/logilab/logilab/common/test/data/reference_dir/subdir/toto.txt +53 -0
- data/tools/logilab/logilab/common/test/data/same_dir/NOTHING +0 -0
- data/tools/logilab/logilab/common/test/data/same_dir/README +1 -0
- data/tools/logilab/logilab/common/test/data/same_dir/subdir/coin +1 -0
- data/tools/logilab/logilab/common/test/data/same_dir/subdir/toto.txt +53 -0
- data/tools/logilab/logilab/common/test/data/spam.txt +9 -0
- data/tools/logilab/logilab/common/test/data/sub/doc.txt +1 -0
- data/tools/logilab/logilab/common/test/data/sub/momo.py +1 -0
- data/tools/logilab/logilab/common/test/data/subdir_differ_dir/NOTHING +0 -0
- data/tools/logilab/logilab/common/test/data/subdir_differ_dir/README +1 -0
- data/tools/logilab/logilab/common/test/data/subdir_differ_dir/subdir/coin +1 -0
- data/tools/logilab/logilab/common/test/data/subdir_differ_dir/subdir/toto.txt +53 -0
- data/tools/logilab/logilab/common/test/data/test.ini +20 -0
- data/tools/logilab/logilab/common/test/data/test1.msg +30 -0
- data/tools/logilab/logilab/common/test/data/test2.msg +42 -0
- data/tools/logilab/logilab/common/test/data/write_protected_file.txt +0 -0
- data/tools/logilab/logilab/common/test/foomod.py +17 -0
- data/tools/logilab/logilab/common/test/unittest_cache.py +129 -0
- data/tools/logilab/logilab/common/test/unittest_changelog.py +37 -0
- data/tools/logilab/logilab/common/test/unittest_compat.py +239 -0
- data/tools/logilab/logilab/common/test/unittest_configuration.py +348 -0
- data/tools/logilab/logilab/common/test/unittest_date.py +154 -0
- data/tools/logilab/logilab/common/test/unittest_decorators.py +62 -0
- data/tools/logilab/logilab/common/test/unittest_deprecation.py +76 -0
- data/tools/logilab/logilab/common/test/unittest_fileutils.py +133 -0
- data/tools/logilab/logilab/common/test/unittest_graph.py +50 -0
- data/tools/logilab/logilab/common/test/unittest_html.py +76 -0
- data/tools/logilab/logilab/common/test/unittest_interface.py +87 -0
- data/tools/logilab/logilab/common/test/unittest_modutils.py +244 -0
- data/tools/logilab/logilab/common/test/unittest_pytest.py +50 -0
- data/tools/logilab/logilab/common/test/unittest_shellutils.py +248 -0
- data/tools/logilab/logilab/common/test/unittest_table.py +448 -0
- data/tools/logilab/logilab/common/test/unittest_taskqueue.py +71 -0
- data/tools/logilab/logilab/common/test/unittest_testlib.py +956 -0
- data/tools/logilab/logilab/common/test/unittest_textutils.py +247 -0
- data/tools/logilab/logilab/common/test/unittest_tree.py +248 -0
- data/tools/logilab/logilab/common/test/unittest_umessage.py +55 -0
- data/tools/logilab/logilab/common/test/unittest_ureports_html.py +64 -0
- data/tools/logilab/logilab/common/test/unittest_ureports_text.py +105 -0
- data/tools/logilab/logilab/common/test/unittest_xmlutils.py +75 -0
- data/tools/logilab/logilab/common/test/utils.py +87 -0
- data/tools/logilab/logilab/common/testlib.py +1927 -0
- data/tools/logilab/logilab/common/textutils.py +476 -0
- data/tools/logilab/logilab/common/tree.py +372 -0
- data/tools/logilab/logilab/common/umessage.py +161 -0
- data/tools/logilab/logilab/common/ureports/__init__.py +174 -0
- data/tools/logilab/logilab/common/ureports/docbook_writer.py +139 -0
- data/tools/logilab/logilab/common/ureports/html_writer.py +131 -0
- data/tools/logilab/logilab/common/ureports/nodes.py +201 -0
- data/tools/logilab/logilab/common/ureports/text_writer.py +140 -0
- data/tools/logilab/logilab/common/vcgutils.py +216 -0
- data/tools/logilab/logilab/common/visitor.py +107 -0
- data/tools/logilab/logilab/common/xmlrpcutils.py +136 -0
- data/tools/logilab/logilab/common/xmlutils.py +61 -0
- data/tools/pychecker/COPYRIGHT +31 -0
- data/tools/pychecker/ChangeLog +349 -0
- data/tools/pychecker/CodeChecks.py +1969 -0
- data/tools/pychecker/CodeChecks.pyc +0 -0
- data/tools/pychecker/CodeChecks.pyo +0 -0
- data/tools/pychecker/Config.py +475 -0
- data/tools/pychecker/Config.pyc +0 -0
- data/tools/pychecker/Config.pyo +0 -0
- data/tools/pychecker/KNOWN_BUGS +100 -0
- data/tools/pychecker/MAINTAINERS +81 -0
- data/tools/pychecker/NEWS +406 -0
- data/tools/pychecker/OP.py +131 -0
- data/tools/pychecker/OP.pyc +0 -0
- data/tools/pychecker/OP.pyo +0 -0
- data/tools/pychecker/OptionTypes.py +117 -0
- data/tools/pychecker/OptionTypes.pyc +0 -0
- data/tools/pychecker/OptionTypes.pyo +0 -0
- data/tools/pychecker/README +152 -0
- data/tools/pychecker/Stack.py +115 -0
- data/tools/pychecker/Stack.pyc +0 -0
- data/tools/pychecker/Stack.pyo +0 -0
- data/tools/pychecker/TODO +101 -0
- data/tools/pychecker/VERSION +1 -0
- data/tools/pychecker/Warning.py +50 -0
- data/tools/pychecker/Warning.pyc +0 -0
- data/tools/pychecker/Warning.pyo +0 -0
- data/tools/pychecker/__init__.py +17 -0
- data/tools/pychecker/__init__.pyc +0 -0
- data/tools/pychecker/__init__.pyo +0 -0
- data/tools/pychecker/checker.py +961 -0
- data/tools/pychecker/checker.pyc +0 -0
- data/tools/pychecker/checker.pyo +0 -0
- data/tools/pychecker/function.py +159 -0
- data/tools/pychecker/function.pyc +0 -0
- data/tools/pychecker/function.pyo +0 -0
- data/tools/pychecker/msgs.py +175 -0
- data/tools/pychecker/msgs.pyc +0 -0
- data/tools/pychecker/msgs.pyo +0 -0
- data/tools/pychecker/options.py +275 -0
- data/tools/pychecker/options.pyc +0 -0
- data/tools/pychecker/options.pyo +0 -0
- data/tools/pychecker/pcmodules.py +19 -0
- data/tools/pychecker/pcmodules.pyc +0 -0
- data/tools/pychecker/pcmodules.pyo +0 -0
- data/tools/pychecker/printer.py +47 -0
- data/tools/pychecker/printer.pyc +0 -0
- data/tools/pychecker/printer.pyo +0 -0
- data/tools/pychecker/python.py +427 -0
- data/tools/pychecker/python.pyc +0 -0
- data/tools/pychecker/python.pyo +0 -0
- data/tools/pychecker/utils.py +102 -0
- data/tools/pychecker/utils.pyc +0 -0
- data/tools/pychecker/utils.pyo +0 -0
- data/tools/pychecker/warn.py +778 -0
- data/tools/pychecker/warn.pyc +0 -0
- data/tools/pychecker/warn.pyo +0 -0
- data/tools/pylint2/pylint/__init__.py +16 -0
- data/tools/pylint2/pylint/__pkginfo__.py +67 -0
- data/tools/pylint2/pylint/checkers/__init__.py +155 -0
- data/tools/pylint2/pylint/checkers/base.py +749 -0
- data/tools/pylint2/pylint/checkers/classes.py +527 -0
- data/tools/pylint2/pylint/checkers/design_analysis.py +344 -0
- data/tools/pylint2/pylint/checkers/exceptions.py +183 -0
- data/tools/pylint2/pylint/checkers/format.py +367 -0
- data/tools/pylint2/pylint/checkers/imports.py +379 -0
- data/tools/pylint2/pylint/checkers/logging.py +98 -0
- data/tools/pylint2/pylint/checkers/misc.py +128 -0
- data/tools/pylint2/pylint/checkers/newstyle.py +107 -0
- data/tools/pylint2/pylint/checkers/raw_metrics.py +125 -0
- data/tools/pylint2/pylint/checkers/similar.py +333 -0
- data/tools/pylint2/pylint/checkers/string_format.py +239 -0
- data/tools/pylint2/pylint/checkers/typecheck.py +364 -0
- data/tools/pylint2/pylint/checkers/utils.py +208 -0
- data/tools/pylint2/pylint/checkers/variables.py +498 -0
- data/tools/pylint2/pylint/config.py +149 -0
- data/tools/pylint2/pylint/epylint.py +149 -0
- data/tools/pylint2/pylint/gui.py +433 -0
- data/tools/pylint2/pylint/interfaces.py +98 -0
- data/tools/pylint2/pylint/lint.py +914 -0
- data/tools/pylint2/pylint/pyreverse/__init__.py +5 -0
- data/tools/pylint2/pylint/pyreverse/diadefslib.py +229 -0
- data/tools/pylint2/pylint/pyreverse/diagrams.py +247 -0
- data/tools/pylint2/pylint/pyreverse/main.py +123 -0
- data/tools/pylint2/pylint/pyreverse/utils.py +131 -0
- data/tools/pylint2/pylint/pyreverse/writer.py +196 -0
- data/tools/pylint2/pylint/reporters/__init__.py +67 -0
- data/tools/pylint2/pylint/reporters/guireporter.py +36 -0
- data/tools/pylint2/pylint/reporters/html.py +69 -0
- data/tools/pylint2/pylint/reporters/text.py +156 -0
- data/tools/pylint2/pylint/utils.py +518 -0
- data/tools/pylint2/pylint.py +16 -0
- data/tools/test/suite.py +35 -0
- metadata +566 -0
@@ -0,0 +1,311 @@
|
|
1
|
+
#
|
2
|
+
# doctest.py: Syntax Highlighting for doctest blocks
|
3
|
+
# Edward Loper
|
4
|
+
#
|
5
|
+
# Created [06/28/03 02:52 AM]
|
6
|
+
# $Id: doctest.py,v 1.1 2009/11/26 13:20:49 casa Exp $
|
7
|
+
#
|
8
|
+
|
9
|
+
"""
|
10
|
+
Syntax highlighting for doctest blocks. This module defines two
|
11
|
+
functions, L{doctest_to_html()} and L{doctest_to_latex()}, which can
|
12
|
+
be used to perform syntax highlighting on doctest blocks. It also
|
13
|
+
defines the more general C{colorize_doctest()}, which could be used to
|
14
|
+
do syntac highlighting on doctest blocks with other output formats.
|
15
|
+
(Both C{doctest_to_html()} and C{doctest_to_latex()} are defined using
|
16
|
+
C{colorize_doctest()}.)
|
17
|
+
"""
|
18
|
+
__docformat__ = 'epytext en'
|
19
|
+
|
20
|
+
import re
|
21
|
+
from epydoc.util import plaintext_to_html, plaintext_to_latex
|
22
|
+
|
23
|
+
__all__ = ['doctest_to_html', 'doctest_to_latex',
|
24
|
+
'DoctestColorizer', 'XMLDoctestColorizer',
|
25
|
+
'HTMLDoctestColorizer', 'LaTeXDoctestColorizer']
|
26
|
+
|
27
|
+
def doctest_to_html(s):
|
28
|
+
"""
|
29
|
+
Perform syntax highlighting on the given doctest string, and
|
30
|
+
return the resulting HTML code. This code consists of a C{<pre>}
|
31
|
+
block with class=py-doctest. Syntax highlighting is performed
|
32
|
+
using the following css classes:
|
33
|
+
|
34
|
+
- C{py-prompt} -- the Python PS1 prompt (>>>)
|
35
|
+
- C{py-more} -- the Python PS2 prompt (...)
|
36
|
+
- C{py-keyword} -- a Python keyword (for, if, etc.)
|
37
|
+
- C{py-builtin} -- a Python builtin name (abs, dir, etc.)
|
38
|
+
- C{py-string} -- a string literal
|
39
|
+
- C{py-comment} -- a comment
|
40
|
+
- C{py-except} -- an exception traceback (up to the next >>>)
|
41
|
+
- C{py-output} -- the output from a doctest block.
|
42
|
+
- C{py-defname} -- the name of a function or class defined by
|
43
|
+
a C{def} or C{class} statement.
|
44
|
+
"""
|
45
|
+
return HTMLDoctestColorizer().colorize_doctest(s)
|
46
|
+
|
47
|
+
def doctest_to_latex(s):
|
48
|
+
"""
|
49
|
+
Perform syntax highlighting on the given doctest string, and
|
50
|
+
return the resulting LaTeX code. This code consists of an
|
51
|
+
C{alltt} environment. Syntax highlighting is performed using
|
52
|
+
the following new latex commands, which must be defined externally:
|
53
|
+
- C{\pysrcprompt} -- the Python PS1 prompt (>>>)
|
54
|
+
- C{\pysrcmore} -- the Python PS2 prompt (...)
|
55
|
+
- C{\pysrckeyword} -- a Python keyword (for, if, etc.)
|
56
|
+
- C{\pysrcbuiltin} -- a Python builtin name (abs, dir, etc.)
|
57
|
+
- C{\pysrcstring} -- a string literal
|
58
|
+
- C{\pysrccomment} -- a comment
|
59
|
+
- C{\pysrcexcept} -- an exception traceback (up to the next >>>)
|
60
|
+
- C{\pysrcoutput} -- the output from a doctest block.
|
61
|
+
- C{\pysrcdefname} -- the name of a function or class defined by
|
62
|
+
a C{def} or C{class} statement.
|
63
|
+
"""
|
64
|
+
return LaTeXDoctestColorizer().colorize_doctest(s)
|
65
|
+
|
66
|
+
class DoctestColorizer:
|
67
|
+
"""
|
68
|
+
An abstract base class for performing syntax highlighting on
|
69
|
+
doctest blocks and other bits of Python code. Subclasses should
|
70
|
+
provide definitions for:
|
71
|
+
|
72
|
+
- The L{markup()} method, which takes a substring and a tag, and
|
73
|
+
returns a colorized version of the substring.
|
74
|
+
- The L{PREFIX} and L{SUFFIX} variables, which will be added
|
75
|
+
to the beginning and end of the strings returned by
|
76
|
+
L{colorize_codeblock} and L{colorize_doctest}.
|
77
|
+
"""
|
78
|
+
|
79
|
+
#: A string that is added to the beginning of the strings
|
80
|
+
#: returned by L{colorize_codeblock} and L{colorize_doctest}.
|
81
|
+
#: Typically, this string begins a preformatted area.
|
82
|
+
PREFIX = None
|
83
|
+
|
84
|
+
#: A string that is added to the end of the strings
|
85
|
+
#: returned by L{colorize_codeblock} and L{colorize_doctest}.
|
86
|
+
#: Typically, this string ends a preformatted area.
|
87
|
+
SUFFIX = None
|
88
|
+
|
89
|
+
#: A list of the names of all Python keywords. ('as' is included
|
90
|
+
#: even though it is technically not a keyword.)
|
91
|
+
_KEYWORDS = ("and del for is raise"
|
92
|
+
"assert elif from lambda return"
|
93
|
+
"break else global not try"
|
94
|
+
"class except if or while"
|
95
|
+
"continue exec import pass yield"
|
96
|
+
"def finally in print as").split()
|
97
|
+
|
98
|
+
#: A list of all Python builtins.
|
99
|
+
_BUILTINS = [_BI for _BI in dir(__builtins__)
|
100
|
+
if not _BI.startswith('__')]
|
101
|
+
|
102
|
+
#: A regexp group that matches keywords.
|
103
|
+
_KEYWORD_GRP = '|'.join([r'\b%s\b' % _KW for _KW in _KEYWORDS])
|
104
|
+
|
105
|
+
#: A regexp group that matches Python builtins.
|
106
|
+
_BUILTIN_GRP = (r'(?<!\.)(?:%s)' % '|'.join([r'\b%s\b' % _BI
|
107
|
+
for _BI in _BUILTINS]))
|
108
|
+
|
109
|
+
#: A regexp group that matches Python strings.
|
110
|
+
_STRING_GRP = '|'.join(
|
111
|
+
[r'("""("""|.*?((?!").)"""))', r'("("|.*?((?!").)"))',
|
112
|
+
r"('''('''|.*?[^\\']'''))", r"('('|.*?[^\\']'))"])
|
113
|
+
|
114
|
+
#: A regexp group that matches Python comments.
|
115
|
+
_COMMENT_GRP = '(#.*?$)'
|
116
|
+
|
117
|
+
#: A regexp group that matches Python ">>>" prompts.
|
118
|
+
_PROMPT1_GRP = r'^[ \t]*>>>(?:[ \t]|$)'
|
119
|
+
|
120
|
+
#: A regexp group that matches Python "..." prompts.
|
121
|
+
_PROMPT2_GRP = r'^[ \t]*\.\.\.(?:[ \t]|$)'
|
122
|
+
|
123
|
+
#: A regexp group that matches function and class definitions.
|
124
|
+
_DEFINE_GRP = r'\b(?:def|class)[ \t]+\w+'
|
125
|
+
|
126
|
+
#: A regexp that matches Python prompts
|
127
|
+
PROMPT_RE = re.compile('(%s|%s)' % (_PROMPT1_GRP, _PROMPT2_GRP),
|
128
|
+
re.MULTILINE | re.DOTALL)
|
129
|
+
|
130
|
+
#: A regexp that matches Python "..." prompts.
|
131
|
+
PROMPT2_RE = re.compile('(%s)' % _PROMPT2_GRP,
|
132
|
+
re.MULTILINE | re.DOTALL)
|
133
|
+
|
134
|
+
#: A regexp that matches doctest exception blocks.
|
135
|
+
EXCEPT_RE = re.compile(r'^[ \t]*Traceback \(most recent call last\):.*',
|
136
|
+
re.DOTALL | re.MULTILINE)
|
137
|
+
|
138
|
+
#: A regexp that matches doctest directives.
|
139
|
+
DOCTEST_DIRECTIVE_RE = re.compile(r'#[ \t]*doctest:.*')
|
140
|
+
|
141
|
+
#: A regexp that matches all of the regions of a doctest block
|
142
|
+
#: that should be colored.
|
143
|
+
DOCTEST_RE = re.compile(
|
144
|
+
r'(.*?)((?P<STRING>%s)|(?P<COMMENT>%s)|(?P<DEFINE>%s)|'
|
145
|
+
r'(?P<KEYWORD>%s)|(?P<BUILTIN>%s)|'
|
146
|
+
r'(?P<PROMPT1>%s)|(?P<PROMPT2>%s)|(?P<EOS>\Z))' % (
|
147
|
+
_STRING_GRP, _COMMENT_GRP, _DEFINE_GRP, _KEYWORD_GRP, _BUILTIN_GRP,
|
148
|
+
_PROMPT1_GRP, _PROMPT2_GRP), re.MULTILINE | re.DOTALL)
|
149
|
+
|
150
|
+
#: This regular expression is used to find doctest examples in a
|
151
|
+
#: string. This is copied from the standard Python doctest.py
|
152
|
+
#: module (after the refactoring in Python 2.4+).
|
153
|
+
DOCTEST_EXAMPLE_RE = re.compile(r'''
|
154
|
+
# Source consists of a PS1 line followed by zero or more PS2 lines.
|
155
|
+
(?P<source>
|
156
|
+
(?:^(?P<indent> [ ]*) >>> .*) # PS1 line
|
157
|
+
(?:\n [ ]* \.\.\. .*)* # PS2 lines
|
158
|
+
\n?)
|
159
|
+
# Want consists of any non-blank lines that do not start with PS1.
|
160
|
+
(?P<want> (?:(?![ ]*$) # Not a blank line
|
161
|
+
(?![ ]*>>>) # Not a line starting with PS1
|
162
|
+
.*$\n? # But any other line
|
163
|
+
)*)
|
164
|
+
''', re.MULTILINE | re.VERBOSE)
|
165
|
+
|
166
|
+
def colorize_inline(self, s):
|
167
|
+
"""
|
168
|
+
Colorize a string containing Python code. Do not add the
|
169
|
+
L{PREFIX} and L{SUFFIX} strings to the returned value. This
|
170
|
+
method is intended for generating syntax-highlighted strings
|
171
|
+
that are appropriate for inclusion as inline expressions.
|
172
|
+
"""
|
173
|
+
return self.DOCTEST_RE.sub(self.subfunc, s)
|
174
|
+
|
175
|
+
def colorize_codeblock(self, s):
|
176
|
+
"""
|
177
|
+
Colorize a string containing only Python code. This method
|
178
|
+
differs from L{colorize_doctest} in that it will not search
|
179
|
+
for doctest prompts when deciding how to colorize the string.
|
180
|
+
"""
|
181
|
+
body = self.DOCTEST_RE.sub(self.subfunc, s)
|
182
|
+
return self.PREFIX + body + self.SUFFIX
|
183
|
+
|
184
|
+
def colorize_doctest(self, s, strip_directives=False):
|
185
|
+
"""
|
186
|
+
Colorize a string containing one or more doctest examples.
|
187
|
+
"""
|
188
|
+
output = []
|
189
|
+
charno = 0
|
190
|
+
for m in self.DOCTEST_EXAMPLE_RE.finditer(s):
|
191
|
+
# Parse the doctest example:
|
192
|
+
pysrc, want = m.group('source', 'want')
|
193
|
+
# Pre-example text:
|
194
|
+
output.append(s[charno:m.start()])
|
195
|
+
# Example source code:
|
196
|
+
output.append(self.DOCTEST_RE.sub(self.subfunc, pysrc))
|
197
|
+
# Example output:
|
198
|
+
if want:
|
199
|
+
if self.EXCEPT_RE.match(want):
|
200
|
+
output += '\n'.join([self.markup(line, 'except')
|
201
|
+
for line in want.split('\n')])
|
202
|
+
else:
|
203
|
+
output += '\n'.join([self.markup(line, 'output')
|
204
|
+
for line in want.split('\n')])
|
205
|
+
# Update charno
|
206
|
+
charno = m.end()
|
207
|
+
# Add any remaining post-example text.
|
208
|
+
output.append(s[charno:])
|
209
|
+
|
210
|
+
return self.PREFIX + ''.join(output) + self.SUFFIX
|
211
|
+
|
212
|
+
def subfunc(self, match):
|
213
|
+
other, text = match.group(1, 2)
|
214
|
+
#print 'M %20r %20r' % (other, text) # <- for debugging
|
215
|
+
if other:
|
216
|
+
other = '\n'.join([self.markup(line, 'other')
|
217
|
+
for line in other.split('\n')])
|
218
|
+
|
219
|
+
if match.group('PROMPT1'):
|
220
|
+
return other + self.markup(text, 'prompt')
|
221
|
+
elif match.group('PROMPT2'):
|
222
|
+
return other + self.markup(text, 'more')
|
223
|
+
elif match.group('KEYWORD'):
|
224
|
+
return other + self.markup(text, 'keyword')
|
225
|
+
elif match.group('BUILTIN'):
|
226
|
+
return other + self.markup(text, 'builtin')
|
227
|
+
elif match.group('COMMENT'):
|
228
|
+
return other + self.markup(text, 'comment')
|
229
|
+
elif match.group('STRING') and '\n' not in text:
|
230
|
+
return other + self.markup(text, 'string')
|
231
|
+
elif match.group('STRING'):
|
232
|
+
# It's a multiline string; colorize the string & prompt
|
233
|
+
# portion of each line.
|
234
|
+
pieces = []
|
235
|
+
for line in text.split('\n'):
|
236
|
+
if self.PROMPT2_RE.match(line):
|
237
|
+
if len(line) > 4:
|
238
|
+
pieces.append(self.markup(line[:4], 'more') +
|
239
|
+
self.markup(line[4:], 'string'))
|
240
|
+
else:
|
241
|
+
pieces.append(self.markup(line[:4], 'more'))
|
242
|
+
elif line:
|
243
|
+
pieces.append(self.markup(line, 'string'))
|
244
|
+
else:
|
245
|
+
pieces.append('')
|
246
|
+
return other + '\n'.join(pieces)
|
247
|
+
elif match.group('DEFINE'):
|
248
|
+
m = re.match('(?P<def>\w+)(?P<space>\s+)(?P<name>\w+)', text)
|
249
|
+
return other + (self.markup(m.group('def'), 'keyword') +
|
250
|
+
self.markup(m.group('space'), 'other') +
|
251
|
+
self.markup(m.group('name'), 'defname'))
|
252
|
+
elif match.group('EOS') is not None:
|
253
|
+
return other
|
254
|
+
else:
|
255
|
+
assert 0, 'Unexpected match!'
|
256
|
+
|
257
|
+
def markup(self, s, tag):
|
258
|
+
"""
|
259
|
+
Apply syntax highlighting to a single substring from a doctest
|
260
|
+
block. C{s} is the substring, and C{tag} is the tag that
|
261
|
+
should be applied to the substring. C{tag} will be one of the
|
262
|
+
following strings:
|
263
|
+
|
264
|
+
- C{prompt} -- the Python PS1 prompt (>>>)
|
265
|
+
- C{more} -- the Python PS2 prompt (...)
|
266
|
+
- C{keyword} -- a Python keyword (for, if, etc.)
|
267
|
+
- C{builtin} -- a Python builtin name (abs, dir, etc.)
|
268
|
+
- C{string} -- a string literal
|
269
|
+
- C{comment} -- a comment
|
270
|
+
- C{except} -- an exception traceback (up to the next >>>)
|
271
|
+
- C{output} -- the output from a doctest block.
|
272
|
+
- C{defname} -- the name of a function or class defined by
|
273
|
+
a C{def} or C{class} statement.
|
274
|
+
- C{other} -- anything else (does *not* include output.)
|
275
|
+
"""
|
276
|
+
raise AssertionError("Abstract method")
|
277
|
+
|
278
|
+
class XMLDoctestColorizer(DoctestColorizer):
|
279
|
+
"""
|
280
|
+
A subclass of DoctestColorizer that generates XML-like output.
|
281
|
+
This class is mainly intended to be used for testing purposes.
|
282
|
+
"""
|
283
|
+
PREFIX = '<colorized>\n'
|
284
|
+
SUFFIX = '</colorized>\n'
|
285
|
+
def markup(self, s, tag):
|
286
|
+
s = s.replace('&', '&').replace('<', '<').replace('>', '>')
|
287
|
+
if tag == 'other': return s
|
288
|
+
else: return '<%s>%s</%s>' % (tag, s, tag)
|
289
|
+
|
290
|
+
class HTMLDoctestColorizer(DoctestColorizer):
|
291
|
+
"""A subclass of DoctestColorizer that generates HTML output."""
|
292
|
+
PREFIX = '<pre class="py-doctest">\n'
|
293
|
+
SUFFIX = '</pre>\n'
|
294
|
+
def markup(self, s, tag):
|
295
|
+
if tag == 'other':
|
296
|
+
return plaintext_to_html(s)
|
297
|
+
else:
|
298
|
+
return ('<span class="py-%s">%s</span>' %
|
299
|
+
(tag, plaintext_to_html(s)))
|
300
|
+
|
301
|
+
class LaTeXDoctestColorizer(DoctestColorizer):
|
302
|
+
"""A subclass of DoctestColorizer that generates LaTeX output."""
|
303
|
+
PREFIX = '\\begin{alltt}\n'
|
304
|
+
SUFFIX = '\\end{alltt}\n'
|
305
|
+
def markup(self, s, tag):
|
306
|
+
if tag == 'other':
|
307
|
+
return plaintext_to_latex(s)
|
308
|
+
else:
|
309
|
+
return '\\pysrc%s{%s}' % (tag, plaintext_to_latex(s))
|
310
|
+
|
311
|
+
|
Binary file
|