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
Binary file
|
@@ -0,0 +1,97 @@
|
|
1
|
+
# epydoc -- Regression testing
|
2
|
+
#
|
3
|
+
# Copyright (C) 2005 Edward Loper
|
4
|
+
# Author: Edward Loper <edloper@loper.org>
|
5
|
+
# URL: <http://epydoc.sf.net>
|
6
|
+
#
|
7
|
+
# $Id: __init__.py,v 1.1 2009/11/26 13:20:53 casa Exp $
|
8
|
+
|
9
|
+
"""
|
10
|
+
Regression testing.
|
11
|
+
"""
|
12
|
+
__docformat__ = 'epytext en'
|
13
|
+
|
14
|
+
import unittest, doctest, epydoc, os, os.path, re, sys
|
15
|
+
|
16
|
+
def main():
|
17
|
+
try:
|
18
|
+
doctest.register_optionflag
|
19
|
+
except:
|
20
|
+
print ("\n"
|
21
|
+
"The regression test suite requires a more recent version of\n"
|
22
|
+
"doctest (e.g., the version that ships with Python 2.4 or 2.5).\n"
|
23
|
+
"Please place a new version of doctest on your path before \n"
|
24
|
+
"running the test suite.\n")
|
25
|
+
return
|
26
|
+
|
27
|
+
|
28
|
+
PY24 = doctest.register_optionflag('PYTHON2.4')
|
29
|
+
"""Flag indicating that a doctest example requires Python 2.4+"""
|
30
|
+
|
31
|
+
PY25 = doctest.register_optionflag('PYTHON2.5')
|
32
|
+
"""Flag indicating that a doctest example requires Python 2.5+"""
|
33
|
+
|
34
|
+
class DocTestParser(doctest.DocTestParser):
|
35
|
+
"""
|
36
|
+
Custom doctest parser that adds support for two new flags
|
37
|
+
+PYTHON2.4 and +PYTHON2.5.
|
38
|
+
"""
|
39
|
+
def parse(self, string, name='<string>'):
|
40
|
+
pieces = doctest.DocTestParser.parse(self, string, name)
|
41
|
+
for i, val in enumerate(pieces):
|
42
|
+
if (isinstance(val, doctest.Example) and
|
43
|
+
((val.options.get(PY24, False) and
|
44
|
+
sys.version[:2] < (2,4)) or
|
45
|
+
(val.options.get(PY25, False) and
|
46
|
+
sys.version[:2] < (2,5)))):
|
47
|
+
pieces[i] = doctest.Example('1', '1')
|
48
|
+
return pieces
|
49
|
+
|
50
|
+
# Turn on debugging.
|
51
|
+
epydoc.DEBUG = True
|
52
|
+
|
53
|
+
# Options for doctest:
|
54
|
+
options = doctest.ELLIPSIS
|
55
|
+
doctest.set_unittest_reportflags(doctest.REPORT_UDIFF)
|
56
|
+
|
57
|
+
# Use a custom parser
|
58
|
+
parser = DocTestParser()
|
59
|
+
|
60
|
+
# Find all test cases.
|
61
|
+
tests = []
|
62
|
+
testdir = os.path.join(os.path.split(__file__)[0])
|
63
|
+
if testdir == '': testdir = '.'
|
64
|
+
for filename in os.listdir(testdir):
|
65
|
+
if (filename.endswith('.doctest') and
|
66
|
+
check_requirements(os.path.join(testdir, filename))):
|
67
|
+
tests.append(doctest.DocFileSuite(filename, optionflags=options,
|
68
|
+
parser=parser))
|
69
|
+
|
70
|
+
# Run all test cases.
|
71
|
+
unittest.TextTestRunner(verbosity=2).run(unittest.TestSuite(tests))
|
72
|
+
|
73
|
+
def check_requirements(filename):
|
74
|
+
"""
|
75
|
+
Search for strings of the form::
|
76
|
+
|
77
|
+
[Require: <module>]
|
78
|
+
|
79
|
+
If any are found, then try importing the module named <module>.
|
80
|
+
If the import fails, then return False. If all required modules
|
81
|
+
are found, return True. (This includes the case where no
|
82
|
+
requirements are listed.)
|
83
|
+
"""
|
84
|
+
s = open(filename).read()
|
85
|
+
for m in re.finditer('(?mi)^[ ]*\:RequireModule:(.*)$', s):
|
86
|
+
module = m.group(1).strip()
|
87
|
+
try:
|
88
|
+
__import__(module)
|
89
|
+
except ImportError:
|
90
|
+
print ('Skipping %r (required module %r not found)' %
|
91
|
+
(os.path.split(filename)[-1], module))
|
92
|
+
return False
|
93
|
+
return True
|
94
|
+
|
95
|
+
|
96
|
+
if __name__=='__main__':
|
97
|
+
main()
|
Binary file
|
@@ -0,0 +1,226 @@
|
|
1
|
+
#
|
2
|
+
# epydoc -- Utility functions used by regression tests (*.doctest)
|
3
|
+
# Edward Loper
|
4
|
+
#
|
5
|
+
# Created [01/30/01 05:18 PM]
|
6
|
+
# $Id: util.py,v 1.1 2009/11/26 13:20:53 casa Exp $
|
7
|
+
#
|
8
|
+
|
9
|
+
"""
|
10
|
+
Utility functions used by the regression tests (C{*.doctest}).
|
11
|
+
"""
|
12
|
+
__docformat__ = 'epytext en'
|
13
|
+
|
14
|
+
import tempfile, re, os, os.path, textwrap, sys
|
15
|
+
from epydoc.docbuilder import build_doc, build_doc_index
|
16
|
+
from epydoc.docparser import parse_docs
|
17
|
+
from epydoc.docintrospecter import introspect_docs
|
18
|
+
from epydoc.apidoc import ClassDoc, RoutineDoc
|
19
|
+
from epydoc.markup import ParsedDocstring
|
20
|
+
from epydoc.docwriter.html import HTMLWriter
|
21
|
+
|
22
|
+
######################################################################
|
23
|
+
#{ Test Functions
|
24
|
+
######################################################################
|
25
|
+
|
26
|
+
def buildvaluedoc(s):
|
27
|
+
"""
|
28
|
+
This test function takes a string containing the contents of a
|
29
|
+
module. It writes the string contents to a file, imports the file
|
30
|
+
as a module, and uses build_doc to build documentation, and
|
31
|
+
returns it as a C{ValueDoc} object.
|
32
|
+
"""
|
33
|
+
tmp_dir = write_pystring_to_tmp_dir(s)
|
34
|
+
val_doc = build_doc(os.path.join(tmp_dir, 'epydoc_test.py'))
|
35
|
+
cleanup_tmp_dir(tmp_dir)
|
36
|
+
return val_doc
|
37
|
+
|
38
|
+
def runbuilder(s, attribs='', build=None, exclude=''):
|
39
|
+
"""
|
40
|
+
This test function takes a string containing the contents of a
|
41
|
+
module. It writes the string contents to a file, imports the file
|
42
|
+
as a module, and uses build_doc to build documentation, and pretty
|
43
|
+
prints the resulting ModuleDoc object. The C{attribs} argument
|
44
|
+
specifies which attributes of the C{APIDoc}s should be displayed.
|
45
|
+
The C{build} argument gives the name of a variable in the module
|
46
|
+
whose documentation should be built, instead of bilding docs for
|
47
|
+
the whole module.
|
48
|
+
"""
|
49
|
+
# Write it to a temp file.
|
50
|
+
tmp_dir = write_pystring_to_tmp_dir(s)
|
51
|
+
# Build it.
|
52
|
+
val_doc = build_doc(os.path.join(tmp_dir, 'epydoc_test.py'))
|
53
|
+
if build: val_doc = val_doc.variables[build].value
|
54
|
+
# Display it.
|
55
|
+
if isinstance(val_doc, ClassDoc):
|
56
|
+
for val in val_doc.variables.values():
|
57
|
+
if isinstance(val.value, RoutineDoc):
|
58
|
+
fun_to_plain(val.value)
|
59
|
+
s = val_doc.pp(include=attribs.split(),exclude=exclude.split())
|
60
|
+
s = re.sub(r"(filename = ).*", r"\1...", s)
|
61
|
+
s = re.sub(r"(<module 'epydoc_test' from ).*", r'\1...', s)
|
62
|
+
s = re.sub(r"(<function \w+ at )0x\w+>", r"\1...>", s)
|
63
|
+
s = re.sub(r"(<\w+ object at )0x\w+>", r"\1...>", s)
|
64
|
+
print s
|
65
|
+
# Clean up.
|
66
|
+
cleanup_tmp_dir(tmp_dir)
|
67
|
+
|
68
|
+
def runparser(s, attribs='', show=None, exclude=''):
|
69
|
+
"""
|
70
|
+
This test function takes a string containing the contents of a
|
71
|
+
module, and writes it to a file, uses `parse_docs` to parse it,
|
72
|
+
and pretty prints the resulting ModuleDoc object. The `attribs`
|
73
|
+
argument specifies which attributes of the `APIDoc`s should be
|
74
|
+
displayed. The `show` argument, if specifies, gives the name of
|
75
|
+
the object in the module that should be displayed (but the whole
|
76
|
+
module will always be inspected; this just selects what to
|
77
|
+
display).
|
78
|
+
"""
|
79
|
+
# Write it to a temp file.
|
80
|
+
tmp_dir = write_pystring_to_tmp_dir(s)
|
81
|
+
# Parse it.
|
82
|
+
val_doc = parse_docs(os.path.join(tmp_dir, 'epydoc_test.py'))
|
83
|
+
if show is not None:
|
84
|
+
for name in show.split('.'):
|
85
|
+
if isinstance(val_doc, ClassDoc):
|
86
|
+
val_doc = val_doc.local_variables[name].value
|
87
|
+
else:
|
88
|
+
val_doc = val_doc.variables[name].value
|
89
|
+
# Display it.
|
90
|
+
s = val_doc.pp(include=attribs.split(), exclude=exclude.split())
|
91
|
+
s = re.sub(r"filename = .*", "filename = ...", s)
|
92
|
+
print s
|
93
|
+
# Clean up.
|
94
|
+
cleanup_tmp_dir(tmp_dir)
|
95
|
+
|
96
|
+
def runintrospecter(s, attribs='', introspect=None, exclude=''):
|
97
|
+
"""
|
98
|
+
This test function takes a string containing the contents of a
|
99
|
+
module. It writes the string contents to a file, imports the file
|
100
|
+
as a module, and uses C{introspect_docs} to introspect it, and
|
101
|
+
pretty prints the resulting ModuleDoc object. The C{attribs}
|
102
|
+
argument specifies which attributes of the C{APIDoc}s should be
|
103
|
+
displayed. The C{introspect} argument gives the name of a variable
|
104
|
+
in the module whose value should be introspected, instead of
|
105
|
+
introspecting the whole module.
|
106
|
+
"""
|
107
|
+
# Write it to a temp file.
|
108
|
+
tmp_dir = write_pystring_to_tmp_dir(s)
|
109
|
+
# Import it.
|
110
|
+
sys.path.insert(0, tmp_dir)
|
111
|
+
if introspect is None:
|
112
|
+
import epydoc_test as val
|
113
|
+
else:
|
114
|
+
exec("from epydoc_test import %s as val" % introspect)
|
115
|
+
del sys.path[0]
|
116
|
+
# Introspect it.
|
117
|
+
val_doc = introspect_docs(val)
|
118
|
+
# Display it.
|
119
|
+
s = val_doc.pp(include=attribs.split(),exclude=exclude.split())
|
120
|
+
s = re.sub(r"(filename = ).*", r"\1...", s)
|
121
|
+
s = re.sub(r"(<module 'epydoc_test' from ).*", r'\1...', s)
|
122
|
+
s = re.sub(r"(<function \w+ at )0x\w+>", r"\1...>", s)
|
123
|
+
s = re.sub(r"(<\w+ object at )0x\w+>", r"\1...>", s)
|
124
|
+
print s
|
125
|
+
# Clean up.
|
126
|
+
cleanup_tmp_dir(tmp_dir)
|
127
|
+
|
128
|
+
def print_warnings():
|
129
|
+
"""
|
130
|
+
Register a logger that will print warnings & errors.
|
131
|
+
"""
|
132
|
+
from epydoc import log
|
133
|
+
del log._loggers[:]
|
134
|
+
log.register_logger(log.SimpleLogger(log.DOCSTRING_WARNING))
|
135
|
+
|
136
|
+
def testencoding(s, introspect=True, parse=True, debug=False):
|
137
|
+
"""
|
138
|
+
An end-to-end test for unicode encodings. This function takes a
|
139
|
+
given string, writes it to a python file, and processes that
|
140
|
+
file's documentation. It then generates HTML output from the
|
141
|
+
documentation, extracts all docstrings from the generated HTML
|
142
|
+
output, and displays them. (In order to extract & display all
|
143
|
+
docstrings, it monkey-patches the HMTLwriter.docstring_to_html()
|
144
|
+
method.)"""
|
145
|
+
# Monkey-patch docstring_to_html
|
146
|
+
original_docstring_to_html = HTMLWriter.docstring_to_html
|
147
|
+
HTMLWriter.docstring_to_html = print_docstring_as_html
|
148
|
+
|
149
|
+
# Write s to a temporary file.
|
150
|
+
tmp_dir = tempfile.mkdtemp()
|
151
|
+
path = os.path.join(tmp_dir, 'enc_test.py')
|
152
|
+
out = open(path, 'w')
|
153
|
+
out.write(textwrap.dedent(s))
|
154
|
+
out.close()
|
155
|
+
# Build docs for it
|
156
|
+
docindex = build_doc_index([path], introspect, parse)
|
157
|
+
if docindex is None: return
|
158
|
+
sys.modules.pop('enc_test', None)
|
159
|
+
# Write html output.
|
160
|
+
writer = HTMLWriter(docindex, mark_docstrings=True)
|
161
|
+
writer.write(tmp_dir)
|
162
|
+
for file in os.listdir(tmp_dir):
|
163
|
+
os.unlink(os.path.join(tmp_dir,file))
|
164
|
+
os.rmdir(tmp_dir)
|
165
|
+
|
166
|
+
# Restore the HTMLWriter class to its original state.
|
167
|
+
HTMLWriter.docstring_to_html = original_docstring_to_html
|
168
|
+
|
169
|
+
######################################################################
|
170
|
+
#{ Helper Functions
|
171
|
+
######################################################################
|
172
|
+
|
173
|
+
def write_pystring_to_tmp_dir(s):
|
174
|
+
tmp_dir = tempfile.mkdtemp()
|
175
|
+
out = open(os.path.join(tmp_dir, 'epydoc_test.py'), 'w')
|
176
|
+
out.write(textwrap.dedent(s))
|
177
|
+
out.close()
|
178
|
+
return tmp_dir
|
179
|
+
|
180
|
+
def cleanup_tmp_dir(tmp_dir):
|
181
|
+
os.unlink(os.path.join(tmp_dir, 'epydoc_test.py'))
|
182
|
+
try: os.unlink(os.path.join(tmp_dir, 'epydoc_test.pyc'))
|
183
|
+
except OSError: pass
|
184
|
+
os.rmdir(tmp_dir)
|
185
|
+
sys.modules.pop('epydoc_test', None)
|
186
|
+
|
187
|
+
def to_plain(docstring):
|
188
|
+
"""Conver a parsed docstring into plain text"""
|
189
|
+
if isinstance(docstring, ParsedDocstring):
|
190
|
+
docstring = docstring.to_plaintext(None)
|
191
|
+
return docstring.rstrip()
|
192
|
+
|
193
|
+
def fun_to_plain(val_doc):
|
194
|
+
"""Convert parsed docstrings in text from a RoutineDoc"""
|
195
|
+
for k, v in val_doc.arg_types.items():
|
196
|
+
val_doc.arg_types[k] = to_plain(v)
|
197
|
+
for i, (k, v) in enumerate(val_doc.arg_descrs):
|
198
|
+
val_doc.arg_descrs[i] = (k, to_plain(v))
|
199
|
+
|
200
|
+
def print_docstring_as_html(self, parsed_docstring, *varargs, **kwargs):
|
201
|
+
"""
|
202
|
+
Convert the given parsed_docstring to HTML and print it. Ignore
|
203
|
+
any other arguments. This function is used by L{testencoding} to
|
204
|
+
monkey-patch the HTMLWriter class's docstring_to_html() method.
|
205
|
+
"""
|
206
|
+
s = parsed_docstring.to_html(None).strip()
|
207
|
+
s = s.encode('ascii', 'xmlcharrefreplace')
|
208
|
+
s = remove_surrogates(s)
|
209
|
+
print s
|
210
|
+
return ''
|
211
|
+
|
212
|
+
def remove_surrogates(s):
|
213
|
+
"""
|
214
|
+
The following is a helper function, used to convert two-character
|
215
|
+
surrogate sequences into single characters. This is needed
|
216
|
+
because some systems create surrogates but others don't.
|
217
|
+
"""
|
218
|
+
pieces = re.split('(&#\d+;)', s)
|
219
|
+
for i in range(3, len(pieces)-1, 2):
|
220
|
+
if pieces[i-1] != '': continue
|
221
|
+
high,low = int(pieces[i-2][2:-1]), int(pieces[i][2:-1])
|
222
|
+
if 0xd800 <= high <= 0xdbff and 0xdc00 <= low <= 0xdfff:
|
223
|
+
pieces[i-2] = '&#%d;' % (((high&0x3ff)<<10) +
|
224
|
+
(low&0x3ff) + 0x10000)
|
225
|
+
pieces[i] = ''
|
226
|
+
return ''.join(pieces)
|
Binary file
|
@@ -0,0 +1,289 @@
|
|
1
|
+
# epydoc -- Utility functions
|
2
|
+
#
|
3
|
+
# Copyright (C) 2005 Edward Loper
|
4
|
+
# Author: Edward Loper <edloper@loper.org>
|
5
|
+
# URL: <http://epydoc.sf.net>
|
6
|
+
#
|
7
|
+
# $Id: util.py,v 1.1 2009/11/26 13:20:42 casa Exp $
|
8
|
+
|
9
|
+
"""
|
10
|
+
Miscellaneous utility functions that are used by multiple modules.
|
11
|
+
|
12
|
+
@group Python source types: is_module_file, is_package_dir, is_pyname,
|
13
|
+
py_src_filename
|
14
|
+
@group Text processing: wordwrap, decode_with_backslashreplace,
|
15
|
+
plaintext_to_html
|
16
|
+
"""
|
17
|
+
__docformat__ = 'epytext en'
|
18
|
+
|
19
|
+
import os, os.path, re
|
20
|
+
|
21
|
+
######################################################################
|
22
|
+
## Python Source Types
|
23
|
+
######################################################################
|
24
|
+
|
25
|
+
PY_SRC_EXTENSIONS = ['.py', '.pyw']
|
26
|
+
PY_BIN_EXTENSIONS = ['.pyc', '.so', '.pyd']
|
27
|
+
|
28
|
+
def is_module_file(path):
|
29
|
+
# Make sure it's a file name.
|
30
|
+
if not isinstance(path, basestring):
|
31
|
+
return False
|
32
|
+
(dir, filename) = os.path.split(path)
|
33
|
+
(basename, extension) = os.path.splitext(filename)
|
34
|
+
return (os.path.isfile(path) and
|
35
|
+
re.match('[a-zA-Z_]\w*$', basename) and
|
36
|
+
extension in PY_SRC_EXTENSIONS+PY_BIN_EXTENSIONS)
|
37
|
+
|
38
|
+
def is_src_filename(filename):
|
39
|
+
if not isinstance(filename, basestring): return False
|
40
|
+
if not os.path.exists(filename): return False
|
41
|
+
return os.path.splitext(filename)[1] in PY_SRC_EXTENSIONS
|
42
|
+
|
43
|
+
def is_package_dir(dirname):
|
44
|
+
"""
|
45
|
+
Return true if the given directory is a valid package directory
|
46
|
+
(i.e., it names a directory that contains a valid __init__ file,
|
47
|
+
and its name is a valid identifier).
|
48
|
+
"""
|
49
|
+
# Make sure it's a directory name.
|
50
|
+
if not isinstance(dirname, basestring):
|
51
|
+
return False
|
52
|
+
if not os.path.isdir(dirname):
|
53
|
+
return False
|
54
|
+
dirname = os.path.abspath(dirname)
|
55
|
+
# Make sure it's a valid identifier. (Special case for
|
56
|
+
# "foo/", where os.path.split -> ("foo", "").)
|
57
|
+
(parent, dir) = os.path.split(dirname)
|
58
|
+
if dir == '': (parent, dir) = os.path.split(parent)
|
59
|
+
|
60
|
+
# The following constraint was removed because of sourceforge
|
61
|
+
# bug #1787028 -- in some cases (eg eggs), it's too strict.
|
62
|
+
#if not re.match('\w+$', dir):
|
63
|
+
# return False
|
64
|
+
|
65
|
+
for name in os.listdir(dirname):
|
66
|
+
filename = os.path.join(dirname, name)
|
67
|
+
if name.startswith('__init__.') and is_module_file(filename):
|
68
|
+
return True
|
69
|
+
else:
|
70
|
+
return False
|
71
|
+
|
72
|
+
def is_pyname(name):
|
73
|
+
return re.match(r"\w+(\.\w+)*$", name)
|
74
|
+
|
75
|
+
def py_src_filename(filename):
|
76
|
+
basefile, extension = os.path.splitext(filename)
|
77
|
+
if extension in PY_SRC_EXTENSIONS:
|
78
|
+
return filename
|
79
|
+
else:
|
80
|
+
for ext in PY_SRC_EXTENSIONS:
|
81
|
+
if os.path.isfile('%s%s' % (basefile, ext)):
|
82
|
+
return '%s%s' % (basefile, ext)
|
83
|
+
else:
|
84
|
+
raise ValueError('Could not find a corresponding '
|
85
|
+
'Python source file for %r.' % filename)
|
86
|
+
|
87
|
+
def munge_script_name(filename):
|
88
|
+
name = os.path.split(filename)[1]
|
89
|
+
name = re.sub(r'\W', '_', name)
|
90
|
+
return 'script-'+name
|
91
|
+
|
92
|
+
######################################################################
|
93
|
+
## Text Processing
|
94
|
+
######################################################################
|
95
|
+
|
96
|
+
def decode_with_backslashreplace(s):
|
97
|
+
r"""
|
98
|
+
Convert the given 8-bit string into unicode, treating any
|
99
|
+
character c such that ord(c)<128 as an ascii character, and
|
100
|
+
converting any c such that ord(c)>128 into a backslashed escape
|
101
|
+
sequence.
|
102
|
+
|
103
|
+
>>> decode_with_backslashreplace('abc\xff\xe8')
|
104
|
+
u'abc\\xff\\xe8'
|
105
|
+
"""
|
106
|
+
# s.encode('string-escape') is not appropriate here, since it
|
107
|
+
# also adds backslashes to some ascii chars (eg \ and ').
|
108
|
+
assert isinstance(s, str)
|
109
|
+
return (s
|
110
|
+
.decode('latin1')
|
111
|
+
.encode('ascii', 'backslashreplace')
|
112
|
+
.decode('ascii'))
|
113
|
+
|
114
|
+
def wordwrap(str, indent=0, right=75, startindex=0, splitchars=''):
|
115
|
+
"""
|
116
|
+
Word-wrap the given string. I.e., add newlines to the string such
|
117
|
+
that any lines that are longer than C{right} are broken into
|
118
|
+
shorter lines (at the first whitespace sequence that occurs before
|
119
|
+
index C{right}). If the given string contains newlines, they will
|
120
|
+
I{not} be removed. Any lines that begin with whitespace will not
|
121
|
+
be wordwrapped.
|
122
|
+
|
123
|
+
@param indent: If specified, then indent each line by this number
|
124
|
+
of spaces.
|
125
|
+
@type indent: C{int}
|
126
|
+
@param right: The right margin for word wrapping. Lines that are
|
127
|
+
longer than C{right} will be broken at the first whitespace
|
128
|
+
sequence before the right margin.
|
129
|
+
@type right: C{int}
|
130
|
+
@param startindex: If specified, then assume that the first line
|
131
|
+
is already preceeded by C{startindex} characters.
|
132
|
+
@type startindex: C{int}
|
133
|
+
@param splitchars: A list of non-whitespace characters which can
|
134
|
+
be used to split a line. (E.g., use '/\\' to allow path names
|
135
|
+
to be split over multiple lines.)
|
136
|
+
@rtype: C{str}
|
137
|
+
"""
|
138
|
+
if splitchars:
|
139
|
+
chunks = re.split(r'( +|\n|[^ \n%s]*[%s])' %
|
140
|
+
(re.escape(splitchars), re.escape(splitchars)),
|
141
|
+
str.expandtabs())
|
142
|
+
else:
|
143
|
+
chunks = re.split(r'( +|\n)', str.expandtabs())
|
144
|
+
result = [' '*(indent-startindex)]
|
145
|
+
charindex = max(indent, startindex)
|
146
|
+
for chunknum, chunk in enumerate(chunks):
|
147
|
+
if (charindex+len(chunk) > right and charindex > 0) or chunk == '\n':
|
148
|
+
result.append('\n' + ' '*indent)
|
149
|
+
charindex = indent
|
150
|
+
if chunk[:1] not in ('\n', ' '):
|
151
|
+
result.append(chunk)
|
152
|
+
charindex += len(chunk)
|
153
|
+
else:
|
154
|
+
result.append(chunk)
|
155
|
+
charindex += len(chunk)
|
156
|
+
return ''.join(result).rstrip()+'\n'
|
157
|
+
|
158
|
+
def plaintext_to_html(s):
|
159
|
+
"""
|
160
|
+
@return: An HTML string that encodes the given plaintext string.
|
161
|
+
In particular, special characters (such as C{'<'} and C{'&'})
|
162
|
+
are escaped.
|
163
|
+
@rtype: C{string}
|
164
|
+
"""
|
165
|
+
s = s.replace('&', '&').replace('"', '"')
|
166
|
+
s = s.replace('<', '<').replace('>', '>')
|
167
|
+
return s
|
168
|
+
|
169
|
+
def plaintext_to_latex(str, nbsp=0, breakany=0):
|
170
|
+
"""
|
171
|
+
@return: A LaTeX string that encodes the given plaintext string.
|
172
|
+
In particular, special characters (such as C{'$'} and C{'_'})
|
173
|
+
are escaped, and tabs are expanded.
|
174
|
+
@rtype: C{string}
|
175
|
+
@param breakany: Insert hyphenation marks, so that LaTeX can
|
176
|
+
break the resulting string at any point. This is useful for
|
177
|
+
small boxes (e.g., the type box in the variable list table).
|
178
|
+
@param nbsp: Replace every space with a non-breaking space
|
179
|
+
(C{'~'}).
|
180
|
+
"""
|
181
|
+
# These get converted to hyphenation points later
|
182
|
+
if breakany: str = re.sub('(.)', '\\1\1', str)
|
183
|
+
|
184
|
+
# These get converted to \textbackslash later.
|
185
|
+
str = str.replace('\\', '\0')
|
186
|
+
|
187
|
+
# Expand tabs
|
188
|
+
str = str.expandtabs()
|
189
|
+
|
190
|
+
# These elements need to be backslashed.
|
191
|
+
str = re.sub(r'([#$&%_\${}])', r'\\\1', str)
|
192
|
+
|
193
|
+
# These elements have special names.
|
194
|
+
str = str.replace('|', '{\\textbar}')
|
195
|
+
str = str.replace('<', '{\\textless}')
|
196
|
+
str = str.replace('>', '{\\textgreater}')
|
197
|
+
str = str.replace('^', '{\\textasciicircum}')
|
198
|
+
str = str.replace('~', '{\\textasciitilde}')
|
199
|
+
str = str.replace('\0', r'{\textbackslash}')
|
200
|
+
|
201
|
+
# replace spaces with non-breaking spaces
|
202
|
+
if nbsp: str = str.replace(' ', '~')
|
203
|
+
|
204
|
+
# Convert \1's to hyphenation points.
|
205
|
+
if breakany: str = str.replace('\1', r'\-')
|
206
|
+
|
207
|
+
return str
|
208
|
+
|
209
|
+
class RunSubprocessError(OSError):
|
210
|
+
def __init__(self, cmd, out, err):
|
211
|
+
OSError.__init__(self, '%s failed' % cmd[0])
|
212
|
+
self.out = out
|
213
|
+
self.err = err
|
214
|
+
|
215
|
+
def run_subprocess(cmd, data=None):
|
216
|
+
"""
|
217
|
+
Execute the command C{cmd} in a subprocess.
|
218
|
+
|
219
|
+
@param cmd: The command to execute, specified as a list
|
220
|
+
of string.
|
221
|
+
@param data: A string containing data to send to the
|
222
|
+
subprocess.
|
223
|
+
@return: A tuple C{(out, err)}.
|
224
|
+
@raise OSError: If there is any problem executing the
|
225
|
+
command, or if its exitval is not 0.
|
226
|
+
"""
|
227
|
+
if isinstance(cmd, basestring):
|
228
|
+
cmd = cmd.split()
|
229
|
+
|
230
|
+
# Under Python 2.4+, use subprocess
|
231
|
+
try:
|
232
|
+
from subprocess import Popen, PIPE
|
233
|
+
pipe = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
|
234
|
+
out, err = pipe.communicate(data)
|
235
|
+
if hasattr(pipe, 'returncode'):
|
236
|
+
if pipe.returncode == 0:
|
237
|
+
return out, err
|
238
|
+
else:
|
239
|
+
raise RunSubprocessError(cmd, out, err)
|
240
|
+
else:
|
241
|
+
# Assume that there was an error iff anything was written
|
242
|
+
# to the child's stderr.
|
243
|
+
if err == '':
|
244
|
+
return out, err
|
245
|
+
else:
|
246
|
+
raise RunSubprocessError(cmd, out, err)
|
247
|
+
except ImportError:
|
248
|
+
pass
|
249
|
+
|
250
|
+
# Under Python 2.3 or earlier, on unix, use popen2.Popen3 so we
|
251
|
+
# can access the return value.
|
252
|
+
import popen2
|
253
|
+
if hasattr(popen2, 'Popen3'):
|
254
|
+
pipe = popen2.Popen3(' '.join(cmd), True)
|
255
|
+
to_child = pipe.tochild
|
256
|
+
from_child = pipe.fromchild
|
257
|
+
child_err = pipe.childerr
|
258
|
+
if data:
|
259
|
+
to_child.write(data)
|
260
|
+
to_child.close()
|
261
|
+
out = err = ''
|
262
|
+
while pipe.poll() is None:
|
263
|
+
out += from_child.read()
|
264
|
+
err += child_err.read()
|
265
|
+
out += from_child.read()
|
266
|
+
err += child_err.read()
|
267
|
+
if pipe.wait() == 0:
|
268
|
+
return out, err
|
269
|
+
else:
|
270
|
+
raise RunSubprocessError(cmd, out, err)
|
271
|
+
|
272
|
+
# Under Python 2.3 or earlier, on non-unix, use os.popen3
|
273
|
+
else:
|
274
|
+
to_child, from_child, child_err = os.popen3(' '.join(cmd), 'b')
|
275
|
+
if data:
|
276
|
+
try:
|
277
|
+
to_child.write(data)
|
278
|
+
# Guard for a broken pipe error
|
279
|
+
except IOError, e:
|
280
|
+
raise OSError(e)
|
281
|
+
to_child.close()
|
282
|
+
out = from_child.read()
|
283
|
+
err = child_err.read()
|
284
|
+
# Assume that there was an error iff anything was written
|
285
|
+
# to the child's stderr.
|
286
|
+
if err == '':
|
287
|
+
return out, err
|
288
|
+
else:
|
289
|
+
raise RunSubprocessError(cmd, out, err)
|
Binary file
|