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,216 @@
|
|
1
|
+
# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
|
2
|
+
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
|
3
|
+
#
|
4
|
+
# This file is part of logilab-common.
|
5
|
+
#
|
6
|
+
# logilab-common is free software: you can redistribute it and/or modify it under
|
7
|
+
# the terms of the GNU Lesser General Public License as published by the Free
|
8
|
+
# Software Foundation, either version 2.1 of the License, or (at your option) any
|
9
|
+
# later version.
|
10
|
+
#
|
11
|
+
# logilab-common is distributed in the hope that it will be useful, but WITHOUT
|
12
|
+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
13
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
14
|
+
# details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU Lesser General Public License along
|
17
|
+
# with logilab-common. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
"""Functions to generate files readable with Georg Sander's vcg
|
19
|
+
(Visualization of Compiler Graphs).
|
20
|
+
|
21
|
+
You can download vcg at http://rw4.cs.uni-sb.de/~sander/html/gshome.html
|
22
|
+
Note that vcg exists as a debian package.
|
23
|
+
|
24
|
+
See vcg's documentation for explanation about the different values that
|
25
|
+
maybe used for the functions parameters.
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
"""
|
31
|
+
__docformat__ = "restructuredtext en"
|
32
|
+
|
33
|
+
import string
|
34
|
+
|
35
|
+
ATTRS_VAL = {
|
36
|
+
'algos': ('dfs', 'tree', 'minbackward',
|
37
|
+
'left_to_right','right_to_left',
|
38
|
+
'top_to_bottom','bottom_to_top',
|
39
|
+
'maxdepth', 'maxdepthslow', 'mindepth', 'mindepthslow',
|
40
|
+
'mindegree', 'minindegree', 'minoutdegree',
|
41
|
+
'maxdegree','maxindegree', 'maxoutdegree'),
|
42
|
+
'booleans': ('yes', 'no'),
|
43
|
+
'colors': ('black', 'white', 'blue', 'red', 'green', 'yellow',
|
44
|
+
'magenta', 'lightgrey',
|
45
|
+
'cyan', 'darkgrey', 'darkblue', 'darkred', 'darkgreen',
|
46
|
+
'darkyellow', 'darkmagenta', 'darkcyan', 'gold',
|
47
|
+
'lightblue', 'lightred', 'lightgreen', 'lightyellow',
|
48
|
+
'lightmagenta', 'lightcyan', 'lilac', 'turquoise',
|
49
|
+
'aquamarine', 'khaki', 'purple', 'yellowgreen', 'pink',
|
50
|
+
'orange', 'orchid'),
|
51
|
+
'shapes': ('box', 'ellipse', 'rhomb', 'triangle'),
|
52
|
+
'textmodes': ('center', 'left_justify', 'right_justify'),
|
53
|
+
'arrowstyles': ('solid', 'line', 'none'),
|
54
|
+
'linestyles': ('continuous', 'dashed', 'dotted', 'invisible'),
|
55
|
+
}
|
56
|
+
|
57
|
+
# meaning of possible values:
|
58
|
+
# O -> string
|
59
|
+
# 1 -> int
|
60
|
+
# list -> value in list
|
61
|
+
GRAPH_ATTRS = {
|
62
|
+
'title' : 0,
|
63
|
+
'label' : 0,
|
64
|
+
'color': ATTRS_VAL['colors'],
|
65
|
+
'textcolor': ATTRS_VAL['colors'],
|
66
|
+
'bordercolor': ATTRS_VAL['colors'],
|
67
|
+
'width': 1,
|
68
|
+
'height': 1,
|
69
|
+
'borderwidth': 1,
|
70
|
+
'textmode': ATTRS_VAL['textmodes'],
|
71
|
+
'shape': ATTRS_VAL['shapes'],
|
72
|
+
'shrink': 1,
|
73
|
+
'stretch': 1,
|
74
|
+
'orientation': ATTRS_VAL['algos'],
|
75
|
+
'vertical_order': 1,
|
76
|
+
'horizontal_order': 1,
|
77
|
+
'xspace': 1,
|
78
|
+
'yspace': 1,
|
79
|
+
'layoutalgorithm' : ATTRS_VAL['algos'],
|
80
|
+
'late_edge_labels' : ATTRS_VAL['booleans'],
|
81
|
+
'display_edge_labels': ATTRS_VAL['booleans'],
|
82
|
+
'dirty_edge_labels' : ATTRS_VAL['booleans'],
|
83
|
+
'finetuning': ATTRS_VAL['booleans'],
|
84
|
+
'manhattan_edges': ATTRS_VAL['booleans'],
|
85
|
+
'smanhattan_edges': ATTRS_VAL['booleans'],
|
86
|
+
'port_sharing': ATTRS_VAL['booleans'],
|
87
|
+
'edges': ATTRS_VAL['booleans'],
|
88
|
+
'nodes': ATTRS_VAL['booleans'],
|
89
|
+
'splines': ATTRS_VAL['booleans'],
|
90
|
+
}
|
91
|
+
NODE_ATTRS = {
|
92
|
+
'title' : 0,
|
93
|
+
'label' : 0,
|
94
|
+
'color': ATTRS_VAL['colors'],
|
95
|
+
'textcolor': ATTRS_VAL['colors'],
|
96
|
+
'bordercolor': ATTRS_VAL['colors'],
|
97
|
+
'width': 1,
|
98
|
+
'height': 1,
|
99
|
+
'borderwidth': 1,
|
100
|
+
'textmode': ATTRS_VAL['textmodes'],
|
101
|
+
'shape': ATTRS_VAL['shapes'],
|
102
|
+
'shrink': 1,
|
103
|
+
'stretch': 1,
|
104
|
+
'vertical_order': 1,
|
105
|
+
'horizontal_order': 1,
|
106
|
+
}
|
107
|
+
EDGE_ATTRS = {
|
108
|
+
'sourcename' : 0,
|
109
|
+
'targetname' : 0,
|
110
|
+
'label' : 0,
|
111
|
+
'linestyle' : ATTRS_VAL['linestyles'],
|
112
|
+
'class' : 1,
|
113
|
+
'thickness' : 0,
|
114
|
+
'color': ATTRS_VAL['colors'],
|
115
|
+
'textcolor': ATTRS_VAL['colors'],
|
116
|
+
'arrowcolor': ATTRS_VAL['colors'],
|
117
|
+
'backarrowcolor': ATTRS_VAL['colors'],
|
118
|
+
'arrowsize': 1,
|
119
|
+
'backarrowsize': 1,
|
120
|
+
'arrowstyle': ATTRS_VAL['arrowstyles'],
|
121
|
+
'backarrowstyle': ATTRS_VAL['arrowstyles'],
|
122
|
+
'textmode': ATTRS_VAL['textmodes'],
|
123
|
+
'priority': 1,
|
124
|
+
'anchor': 1,
|
125
|
+
'horizontal_order': 1,
|
126
|
+
}
|
127
|
+
|
128
|
+
|
129
|
+
# Misc utilities ###############################################################
|
130
|
+
|
131
|
+
def latin_to_vcg(st):
|
132
|
+
"""Convert latin characters using vcg escape sequence.
|
133
|
+
"""
|
134
|
+
for char in st:
|
135
|
+
if char not in string.ascii_letters:
|
136
|
+
try:
|
137
|
+
num = ord(char)
|
138
|
+
if num >= 192:
|
139
|
+
st = st.replace(char, r'\fi%d'%ord(char))
|
140
|
+
except:
|
141
|
+
pass
|
142
|
+
return st
|
143
|
+
|
144
|
+
|
145
|
+
class VCGPrinter:
|
146
|
+
"""A vcg graph writer.
|
147
|
+
"""
|
148
|
+
|
149
|
+
def __init__(self, output_stream):
|
150
|
+
self._stream = output_stream
|
151
|
+
self._indent = ''
|
152
|
+
|
153
|
+
def open_graph(self, **args):
|
154
|
+
"""open a vcg graph
|
155
|
+
"""
|
156
|
+
self._stream.write('%sgraph:{\n'%self._indent)
|
157
|
+
self._inc_indent()
|
158
|
+
self._write_attributes(GRAPH_ATTRS, **args)
|
159
|
+
|
160
|
+
def close_graph(self):
|
161
|
+
"""close a vcg graph
|
162
|
+
"""
|
163
|
+
self._dec_indent()
|
164
|
+
self._stream.write('%s}\n'%self._indent)
|
165
|
+
|
166
|
+
|
167
|
+
def node(self, title, **args):
|
168
|
+
"""draw a node
|
169
|
+
"""
|
170
|
+
self._stream.write('%snode: {title:"%s"' % (self._indent, title))
|
171
|
+
self._write_attributes(NODE_ATTRS, **args)
|
172
|
+
self._stream.write('}\n')
|
173
|
+
|
174
|
+
|
175
|
+
def edge(self, from_node, to_node, edge_type='', **args):
|
176
|
+
"""draw an edge from a node to another.
|
177
|
+
"""
|
178
|
+
self._stream.write(
|
179
|
+
'%s%sedge: {sourcename:"%s" targetname:"%s"' % (
|
180
|
+
self._indent, edge_type, from_node, to_node))
|
181
|
+
self._write_attributes(EDGE_ATTRS, **args)
|
182
|
+
self._stream.write('}\n')
|
183
|
+
|
184
|
+
|
185
|
+
# private ##################################################################
|
186
|
+
|
187
|
+
def _write_attributes(self, attributes_dict, **args):
|
188
|
+
"""write graph, node or edge attributes
|
189
|
+
"""
|
190
|
+
for key, value in args.items():
|
191
|
+
try:
|
192
|
+
_type = attributes_dict[key]
|
193
|
+
except KeyError:
|
194
|
+
raise Exception('''no such attribute %s
|
195
|
+
possible attributes are %s''' % (key, attributes_dict.keys()))
|
196
|
+
|
197
|
+
if not _type:
|
198
|
+
self._stream.write('%s%s:"%s"\n' % (self._indent, key, value))
|
199
|
+
elif _type == 1:
|
200
|
+
self._stream.write('%s%s:%s\n' % (self._indent, key,
|
201
|
+
int(value)))
|
202
|
+
elif value in _type:
|
203
|
+
self._stream.write('%s%s:%s\n' % (self._indent, key, value))
|
204
|
+
else:
|
205
|
+
raise Exception('''value %s isn\'t correct for attribute %s
|
206
|
+
correct values are %s''' % (value, key, _type))
|
207
|
+
|
208
|
+
def _inc_indent(self):
|
209
|
+
"""increment indentation
|
210
|
+
"""
|
211
|
+
self._indent = ' %s' % self._indent
|
212
|
+
|
213
|
+
def _dec_indent(self):
|
214
|
+
"""decrement indentation
|
215
|
+
"""
|
216
|
+
self._indent = self._indent[:-2]
|
@@ -0,0 +1,107 @@
|
|
1
|
+
# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
|
2
|
+
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
|
3
|
+
#
|
4
|
+
# This file is part of logilab-common.
|
5
|
+
#
|
6
|
+
# logilab-common is free software: you can redistribute it and/or modify it under
|
7
|
+
# the terms of the GNU Lesser General Public License as published by the Free
|
8
|
+
# Software Foundation, either version 2.1 of the License, or (at your option) any
|
9
|
+
# later version.
|
10
|
+
#
|
11
|
+
# logilab-common is distributed in the hope that it will be useful, but WITHOUT
|
12
|
+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
13
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
14
|
+
# details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU Lesser General Public License along
|
17
|
+
# with logilab-common. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
"""A generic visitor abstract implementation.
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
"""
|
24
|
+
__docformat__ = "restructuredtext en"
|
25
|
+
|
26
|
+
def no_filter(_):
|
27
|
+
return 1
|
28
|
+
|
29
|
+
# Iterators ###################################################################
|
30
|
+
class FilteredIterator(object):
|
31
|
+
|
32
|
+
def __init__(self, node, list_func, filter_func=None):
|
33
|
+
self._next = [(node, 0)]
|
34
|
+
if filter_func is None:
|
35
|
+
filter_func = no_filter
|
36
|
+
self._list = list_func(node, filter_func)
|
37
|
+
|
38
|
+
def next(self):
|
39
|
+
try:
|
40
|
+
return self._list.pop(0)
|
41
|
+
except :
|
42
|
+
return None
|
43
|
+
|
44
|
+
# Base Visitor ################################################################
|
45
|
+
class Visitor(object):
|
46
|
+
|
47
|
+
def __init__(self, iterator_class, filter_func=None):
|
48
|
+
self._iter_class = iterator_class
|
49
|
+
self.filter = filter_func
|
50
|
+
|
51
|
+
def visit(self, node, *args, **kargs):
|
52
|
+
"""
|
53
|
+
launch the visit on a given node
|
54
|
+
|
55
|
+
call 'open_visit' before the beginning of the visit, with extra args
|
56
|
+
given
|
57
|
+
when all nodes have been visited, call the 'close_visit' method
|
58
|
+
"""
|
59
|
+
self.open_visit(node, *args, **kargs)
|
60
|
+
return self.close_visit(self._visit(node))
|
61
|
+
|
62
|
+
def _visit(self, node):
|
63
|
+
iterator = self._get_iterator(node)
|
64
|
+
n = iterator.next()
|
65
|
+
while n:
|
66
|
+
result = n.accept(self)
|
67
|
+
n = iterator.next()
|
68
|
+
return result
|
69
|
+
|
70
|
+
def _get_iterator(self, node):
|
71
|
+
return self._iter_class(node, self.filter)
|
72
|
+
|
73
|
+
def open_visit(self, *args, **kargs):
|
74
|
+
"""
|
75
|
+
method called at the beginning of the visit
|
76
|
+
"""
|
77
|
+
pass
|
78
|
+
|
79
|
+
def close_visit(self, result):
|
80
|
+
"""
|
81
|
+
method called at the end of the visit
|
82
|
+
"""
|
83
|
+
return result
|
84
|
+
|
85
|
+
# standard visited mixin ######################################################
|
86
|
+
class VisitedMixIn(object):
|
87
|
+
"""
|
88
|
+
Visited interface allow node visitors to use the node
|
89
|
+
"""
|
90
|
+
def get_visit_name(self):
|
91
|
+
"""
|
92
|
+
return the visit name for the mixed class. When calling 'accept', the
|
93
|
+
method <'visit_' + name returned by this method> will be called on the
|
94
|
+
visitor
|
95
|
+
"""
|
96
|
+
try:
|
97
|
+
return self.TYPE.replace('-', '_')
|
98
|
+
except:
|
99
|
+
return self.__class__.__name__.lower()
|
100
|
+
|
101
|
+
def accept(self, visitor, *args, **kwargs):
|
102
|
+
func = getattr(visitor, 'visit_%s' % self.get_visit_name())
|
103
|
+
return func(self, *args, **kwargs)
|
104
|
+
|
105
|
+
def leave(self, visitor, *args, **kwargs):
|
106
|
+
func = getattr(visitor, 'leave_%s' % self.get_visit_name())
|
107
|
+
return func(self, *args, **kwargs)
|
@@ -0,0 +1,136 @@
|
|
1
|
+
# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
|
2
|
+
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
|
3
|
+
#
|
4
|
+
# This file is part of logilab-common.
|
5
|
+
#
|
6
|
+
# logilab-common is free software: you can redistribute it and/or modify it under
|
7
|
+
# the terms of the GNU Lesser General Public License as published by the Free
|
8
|
+
# Software Foundation, either version 2.1 of the License, or (at your option) any
|
9
|
+
# later version.
|
10
|
+
#
|
11
|
+
# logilab-common is distributed in the hope that it will be useful, but WITHOUT
|
12
|
+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
13
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
14
|
+
# details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU Lesser General Public License along
|
17
|
+
# with logilab-common. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
"""XML-RPC utilities.
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
"""
|
24
|
+
__docformat__ = "restructuredtext en"
|
25
|
+
|
26
|
+
import xmlrpclib
|
27
|
+
from base64 import encodestring
|
28
|
+
#from cStringIO import StringIO
|
29
|
+
|
30
|
+
ProtocolError = xmlrpclib.ProtocolError
|
31
|
+
|
32
|
+
## class BasicAuthTransport(xmlrpclib.Transport):
|
33
|
+
## def __init__(self, username=None, password=None):
|
34
|
+
## self.username = username
|
35
|
+
## self.password = password
|
36
|
+
## self.verbose = None
|
37
|
+
## self.has_ssl = httplib.__dict__.has_key("HTTPConnection")
|
38
|
+
|
39
|
+
## def request(self, host, handler, request_body, verbose=None):
|
40
|
+
## # issue XML-RPC request
|
41
|
+
## if self.has_ssl:
|
42
|
+
## if host.startswith("https:"): h = httplib.HTTPSConnection(host)
|
43
|
+
## else: h = httplib.HTTPConnection(host)
|
44
|
+
## else: h = httplib.HTTP(host)
|
45
|
+
|
46
|
+
## h.putrequest("POST", handler)
|
47
|
+
|
48
|
+
## # required by HTTP/1.1
|
49
|
+
## if not self.has_ssl: # HTTPConnection already does 1.1
|
50
|
+
## h.putheader("Host", host)
|
51
|
+
## h.putheader("Connection", "close")
|
52
|
+
|
53
|
+
## if request_body: h.send(request_body)
|
54
|
+
## if self.has_ssl:
|
55
|
+
## response = h.getresponse()
|
56
|
+
## if response.status != 200:
|
57
|
+
## raise xmlrpclib.ProtocolError(host + handler,
|
58
|
+
## response.status,
|
59
|
+
## response.reason,
|
60
|
+
## response.msg)
|
61
|
+
## file = response.fp
|
62
|
+
## else:
|
63
|
+
## errcode, errmsg, headers = h.getreply()
|
64
|
+
## if errcode != 200:
|
65
|
+
## raise xmlrpclib.ProtocolError(host + handler, errcode,
|
66
|
+
## errmsg, headers)
|
67
|
+
|
68
|
+
## file = h.getfile()
|
69
|
+
|
70
|
+
## return self.parse_response(file)
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
class AuthMixin:
|
75
|
+
"""basic http authentication mixin for xmlrpc transports"""
|
76
|
+
|
77
|
+
def __init__(self, username, password, encoding):
|
78
|
+
self.verbose = 0
|
79
|
+
self.username = username
|
80
|
+
self.password = password
|
81
|
+
self.encoding = encoding
|
82
|
+
|
83
|
+
def request(self, host, handler, request_body, verbose=0):
|
84
|
+
"""issue XML-RPC request"""
|
85
|
+
h = self.make_connection(host)
|
86
|
+
h.putrequest("POST", handler)
|
87
|
+
# required by XML-RPC
|
88
|
+
h.putheader("User-Agent", self.user_agent)
|
89
|
+
h.putheader("Content-Type", "text/xml")
|
90
|
+
h.putheader("Content-Length", str(len(request_body)))
|
91
|
+
h.putheader("Host", host)
|
92
|
+
h.putheader("Connection", "close")
|
93
|
+
# basic auth
|
94
|
+
if self.username is not None and self.password is not None:
|
95
|
+
h.putheader("AUTHORIZATION", "Basic %s" % encodestring(
|
96
|
+
"%s:%s" % (self.username, self.password)).replace("\012", ""))
|
97
|
+
h.endheaders()
|
98
|
+
# send body
|
99
|
+
if request_body:
|
100
|
+
h.send(request_body)
|
101
|
+
# get and check reply
|
102
|
+
errcode, errmsg, headers = h.getreply()
|
103
|
+
if errcode != 200:
|
104
|
+
raise ProtocolError(host + handler, errcode, errmsg, headers)
|
105
|
+
file = h.getfile()
|
106
|
+
## # FIXME: encoding ??? iirc, this fix a bug in xmlrpclib but...
|
107
|
+
## data = h.getfile().read()
|
108
|
+
## if self.encoding != 'UTF-8':
|
109
|
+
## data = data.replace("version='1.0'",
|
110
|
+
## "version='1.0' encoding='%s'" % self.encoding)
|
111
|
+
## result = StringIO()
|
112
|
+
## result.write(data)
|
113
|
+
## result.seek(0)
|
114
|
+
## return self.parse_response(result)
|
115
|
+
return self.parse_response(file)
|
116
|
+
|
117
|
+
class BasicAuthTransport(AuthMixin, xmlrpclib.Transport):
|
118
|
+
"""basic http authentication transport"""
|
119
|
+
|
120
|
+
class BasicAuthSafeTransport(AuthMixin, xmlrpclib.SafeTransport):
|
121
|
+
"""basic https authentication transport"""
|
122
|
+
|
123
|
+
|
124
|
+
def connect(url, user=None, passwd=None, encoding='ISO-8859-1'):
|
125
|
+
"""return an xml rpc server on <url>, using user / password if specified
|
126
|
+
"""
|
127
|
+
if user or passwd:
|
128
|
+
assert user and passwd is not None
|
129
|
+
if url.startswith('https://'):
|
130
|
+
transport = BasicAuthSafeTransport(user, passwd, encoding)
|
131
|
+
else:
|
132
|
+
transport = BasicAuthTransport(user, passwd, encoding)
|
133
|
+
else:
|
134
|
+
transport = None
|
135
|
+
server = xmlrpclib.ServerProxy(url, transport, encoding=encoding)
|
136
|
+
return server
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
|
3
|
+
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
|
4
|
+
#
|
5
|
+
# This file is part of logilab-common.
|
6
|
+
#
|
7
|
+
# logilab-common is free software: you can redistribute it and/or modify it under
|
8
|
+
# the terms of the GNU Lesser General Public License as published by the Free
|
9
|
+
# Software Foundation, either version 2.1 of the License, or (at your option) any
|
10
|
+
# later version.
|
11
|
+
#
|
12
|
+
# logilab-common is distributed in the hope that it will be useful, but WITHOUT
|
13
|
+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
14
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
15
|
+
# details.
|
16
|
+
#
|
17
|
+
# You should have received a copy of the GNU Lesser General Public License along
|
18
|
+
# with logilab-common. If not, see <http://www.gnu.org/licenses/>.
|
19
|
+
"""XML utilities.
|
20
|
+
|
21
|
+
This module contains useful functions for parsing and using XML data. For the
|
22
|
+
moment, there is only one function that can parse the data inside a processing
|
23
|
+
instruction and return a Python dictionary.
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
"""
|
29
|
+
__docformat__ = "restructuredtext en"
|
30
|
+
|
31
|
+
import re
|
32
|
+
|
33
|
+
RE_DOUBLE_QUOTE = re.compile('([\w\-\.]+)="([^"]+)"')
|
34
|
+
RE_SIMPLE_QUOTE = re.compile("([\w\-\.]+)='([^']+)'")
|
35
|
+
|
36
|
+
def parse_pi_data(pi_data):
|
37
|
+
"""
|
38
|
+
Utility function that parses the data contained in an XML
|
39
|
+
processing instruction and returns a dictionary of keywords and their
|
40
|
+
associated values (most of the time, the processing instructions contain
|
41
|
+
data like ``keyword="value"``, if a keyword is not associated to a value,
|
42
|
+
for example ``keyword``, it will be associated to ``None``).
|
43
|
+
|
44
|
+
:param pi_data: data contained in an XML processing instruction.
|
45
|
+
:type pi_data: unicode
|
46
|
+
|
47
|
+
:returns: Dictionary of the keywords (Unicode strings) associated to
|
48
|
+
their values (Unicode strings) as they were defined in the
|
49
|
+
data.
|
50
|
+
:rtype: dict
|
51
|
+
"""
|
52
|
+
results = {}
|
53
|
+
for elt in pi_data.split():
|
54
|
+
if RE_DOUBLE_QUOTE.match(elt):
|
55
|
+
kwd, val = RE_DOUBLE_QUOTE.match(elt).groups()
|
56
|
+
elif RE_SIMPLE_QUOTE.match(elt):
|
57
|
+
kwd, val = RE_SIMPLE_QUOTE.match(elt).groups()
|
58
|
+
else:
|
59
|
+
kwd, val = elt, None
|
60
|
+
results[kwd] = val
|
61
|
+
return results
|
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
# coding=utf-8
|
3
|
+
|
4
|
+
# Script to compile a Python source file passed on command line. Called
|
5
|
+
# by python.compile task.
|
6
|
+
|
7
|
+
import sys
|
8
|
+
import py_compile
|
9
|
+
|
10
|
+
source = sys.argv[1]
|
11
|
+
try:
|
12
|
+
py_compile.compile(source, doraise=True)
|
13
|
+
sys.exit(0)
|
14
|
+
except py_compile.PyCompileError:
|
15
|
+
py_compile.compile(source)
|
16
|
+
sys.exit(1)
|