bee_python 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/{build/README → README} +1 -1
- data/egg/egg/build.yml +11 -49
- data/egg/egg.yml +19 -27
- data/egg/http/build.erb +32 -36
- data/egg/http/libhttp.py +102 -0
- data/egg/http/pylint.cfg +236 -0
- data/egg/http/server.py +7 -0
- data/egg/http/test.erb +32 -0
- data/egg/http.yml +33 -29
- data/egg/mysql/mysql.py +8 -9
- data/egg/project/build.erb +21 -53
- data/egg/project/pylint.cfg +236 -0
- data/egg/project/test.py +2 -2
- data/egg/project.yml +23 -31
- data/egg/script/build.erb +18 -23
- data/egg/script/pylint.cfg +236 -0
- data/egg/script.yml +22 -18
- data/egg/source/source.py +6 -6
- data/egg/test/test.py +1 -1
- data/lib/bee_task_python.rb +3 -34
- data/python.yml +123 -0
- metadata +61 -503
- data/test/build.yml +0 -16
- data/test/tc_bee_task_python.rb +0 -27
- data/test/test_build.rb +0 -26
- data/test/test_build_listener.rb +0 -110
- data/test/ts_bee_python.rb +0 -26
- data/tools/common/__init__.py +0 -5
- data/tools/common/common/__init__.py +0 -140
- data/tools/common/common/__pkginfo__.py +0 -43
- data/tools/common/common/adbh.py +0 -35
- data/tools/common/common/cache.py +0 -114
- data/tools/common/common/changelog.py +0 -234
- data/tools/common/common/clcommands.py +0 -181
- data/tools/common/common/cli.py +0 -212
- data/tools/common/common/compat.py +0 -328
- data/tools/common/common/configuration.py +0 -1087
- data/tools/common/common/contexts.py +0 -58
- data/tools/common/common/corbautils.py +0 -117
- data/tools/common/common/daemon.py +0 -171
- data/tools/common/common/date.py +0 -279
- data/tools/common/common/db.py +0 -49
- data/tools/common/common/dbf.py +0 -229
- data/tools/common/common/debugger.py +0 -208
- data/tools/common/common/decorators.py +0 -190
- data/tools/common/common/deprecation.py +0 -118
- data/tools/common/common/fileutils.py +0 -409
- data/tools/common/common/graph.py +0 -259
- data/tools/common/common/html.py +0 -142
- data/tools/common/common/interface.py +0 -76
- data/tools/common/common/logging_ext.py +0 -166
- data/tools/common/common/modutils.py +0 -670
- data/tools/common/common/optik_ext.py +0 -383
- data/tools/common/common/optparser.py +0 -92
- data/tools/common/common/pdf_ext.py +0 -111
- data/tools/common/common/proc.py +0 -276
- data/tools/common/common/pyro_ext.py +0 -146
- data/tools/common/common/pytest.py +0 -754
- data/tools/common/common/shellutils.py +0 -383
- data/tools/common/common/sphinx_ext.py +0 -87
- data/tools/common/common/sphinxutils.py +0 -122
- data/tools/common/common/sqlgen.py +0 -31
- data/tools/common/common/table.py +0 -930
- data/tools/common/common/tasksqueue.py +0 -97
- data/tools/common/common/test/__init__.py +0 -1
- data/tools/common/common/test/data/ChangeLog +0 -184
- data/tools/common/common/test/data/MyPyPa-0.1.0-py2.5.egg +0 -0
- data/tools/common/common/test/data/__init__.py +0 -1
- data/tools/common/common/test/data/content_differ_dir/NOTHING +0 -0
- data/tools/common/common/test/data/content_differ_dir/README +0 -1
- data/tools/common/common/test/data/content_differ_dir/subdir/coin +0 -1
- data/tools/common/common/test/data/content_differ_dir/subdir/toto.txt +0 -53
- data/tools/common/common/test/data/file_differ_dir/NOTHING +0 -0
- data/tools/common/common/test/data/file_differ_dir/README +0 -1
- data/tools/common/common/test/data/file_differ_dir/subdir/toto.txt +0 -53
- 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 +0 -9
- data/tools/common/common/test/data/module.py +0 -88
- data/tools/common/common/test/data/module2.py +0 -77
- data/tools/common/common/test/data/newlines.txt +0 -3
- data/tools/common/common/test/data/noendingnewline.py +0 -36
- data/tools/common/common/test/data/nonregr.py +0 -14
- 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 +0 -1
- data/tools/common/common/test/data/reference_dir/subdir/coin +0 -1
- data/tools/common/common/test/data/reference_dir/subdir/toto.txt +0 -53
- data/tools/common/common/test/data/same_dir/NOTHING +0 -0
- data/tools/common/common/test/data/same_dir/README +0 -1
- data/tools/common/common/test/data/same_dir/subdir/coin +0 -1
- data/tools/common/common/test/data/same_dir/subdir/toto.txt +0 -53
- data/tools/common/common/test/data/spam.txt +0 -9
- data/tools/common/common/test/data/sub/doc.txt +0 -1
- data/tools/common/common/test/data/sub/momo.py +0 -1
- data/tools/common/common/test/data/subdir_differ_dir/NOTHING +0 -0
- data/tools/common/common/test/data/subdir_differ_dir/README +0 -1
- data/tools/common/common/test/data/subdir_differ_dir/subdir/coin +0 -1
- data/tools/common/common/test/data/subdir_differ_dir/subdir/toto.txt +0 -53
- data/tools/common/common/test/data/test.ini +0 -20
- data/tools/common/common/test/data/test1.msg +0 -30
- data/tools/common/common/test/data/test2.msg +0 -42
- data/tools/common/common/test/data/write_protected_file.txt +0 -0
- data/tools/common/common/test/foomod.py +0 -17
- data/tools/common/common/test/unittest_cache.py +0 -129
- data/tools/common/common/test/unittest_changelog.py +0 -37
- data/tools/common/common/test/unittest_compat.py +0 -239
- data/tools/common/common/test/unittest_configuration.py +0 -348
- data/tools/common/common/test/unittest_date.py +0 -154
- data/tools/common/common/test/unittest_decorators.py +0 -62
- data/tools/common/common/test/unittest_deprecation.py +0 -76
- data/tools/common/common/test/unittest_fileutils.py +0 -133
- data/tools/common/common/test/unittest_graph.py +0 -50
- data/tools/common/common/test/unittest_html.py +0 -76
- data/tools/common/common/test/unittest_interface.py +0 -87
- data/tools/common/common/test/unittest_modutils.py +0 -244
- data/tools/common/common/test/unittest_pytest.py +0 -50
- data/tools/common/common/test/unittest_shellutils.py +0 -248
- data/tools/common/common/test/unittest_table.py +0 -448
- data/tools/common/common/test/unittest_taskqueue.py +0 -71
- data/tools/common/common/test/unittest_testlib.py +0 -956
- data/tools/common/common/test/unittest_textutils.py +0 -247
- data/tools/common/common/test/unittest_tree.py +0 -248
- data/tools/common/common/test/unittest_umessage.py +0 -55
- data/tools/common/common/test/unittest_ureports_html.py +0 -64
- data/tools/common/common/test/unittest_ureports_text.py +0 -105
- data/tools/common/common/test/unittest_xmlutils.py +0 -75
- data/tools/common/common/test/utils.py +0 -87
- data/tools/common/common/testlib.py +0 -1927
- data/tools/common/common/textutils.py +0 -476
- data/tools/common/common/tree.py +0 -372
- data/tools/common/common/umessage.py +0 -161
- data/tools/common/common/ureports/__init__.py +0 -174
- data/tools/common/common/ureports/docbook_writer.py +0 -139
- data/tools/common/common/ureports/html_writer.py +0 -131
- data/tools/common/common/ureports/nodes.py +0 -201
- data/tools/common/common/ureports/text_writer.py +0 -140
- data/tools/common/common/vcgutils.py +0 -216
- data/tools/common/common/visitor.py +0 -107
- data/tools/common/common/xmlrpcutils.py +0 -136
- data/tools/common/common/xmlutils.py +0 -61
- data/tools/coverage/coverage.py +0 -602
- data/tools/epydoc/__init__.py +0 -227
- data/tools/epydoc/__init__.pyc +0 -0
- data/tools/epydoc/apidoc.py +0 -2203
- data/tools/epydoc/apidoc.pyc +0 -0
- data/tools/epydoc/checker.py +0 -349
- data/tools/epydoc/checker.pyc +0 -0
- data/tools/epydoc/cli.py +0 -1470
- data/tools/epydoc/cli.pyc +0 -0
- data/tools/epydoc/compat.py +0 -250
- data/tools/epydoc/compat.pyc +0 -0
- data/tools/epydoc/docbuilder.py +0 -1358
- data/tools/epydoc/docbuilder.pyc +0 -0
- data/tools/epydoc/docintrospecter.py +0 -1056
- data/tools/epydoc/docintrospecter.pyc +0 -0
- data/tools/epydoc/docparser.py +0 -2113
- data/tools/epydoc/docparser.pyc +0 -0
- data/tools/epydoc/docstringparser.py +0 -1111
- data/tools/epydoc/docstringparser.pyc +0 -0
- data/tools/epydoc/docwriter/__init__.py +0 -12
- data/tools/epydoc/docwriter/__init__.pyc +0 -0
- data/tools/epydoc/docwriter/dotgraph.py +0 -1351
- data/tools/epydoc/docwriter/dotgraph.pyc +0 -0
- data/tools/epydoc/docwriter/html.py +0 -3491
- data/tools/epydoc/docwriter/html.pyc +0 -0
- data/tools/epydoc/docwriter/html_colorize.py +0 -909
- data/tools/epydoc/docwriter/html_colorize.pyc +0 -0
- data/tools/epydoc/docwriter/html_css.py +0 -550
- data/tools/epydoc/docwriter/html_css.pyc +0 -0
- data/tools/epydoc/docwriter/html_help.py +0 -190
- data/tools/epydoc/docwriter/html_help.pyc +0 -0
- data/tools/epydoc/docwriter/latex.py +0 -1187
- data/tools/epydoc/docwriter/latex.pyc +0 -0
- data/tools/epydoc/docwriter/plaintext.py +0 -276
- data/tools/epydoc/docwriter/plaintext.pyc +0 -0
- data/tools/epydoc/docwriter/xlink.py +0 -505
- data/tools/epydoc/docwriter/xlink.pyc +0 -0
- data/tools/epydoc/gui.py +0 -1148
- data/tools/epydoc/gui.pyc +0 -0
- data/tools/epydoc/log.py +0 -204
- data/tools/epydoc/log.pyc +0 -0
- data/tools/epydoc/markup/__init__.py +0 -623
- data/tools/epydoc/markup/__init__.pyc +0 -0
- data/tools/epydoc/markup/doctest.py +0 -311
- data/tools/epydoc/markup/doctest.pyc +0 -0
- data/tools/epydoc/markup/epytext.py +0 -2116
- data/tools/epydoc/markup/epytext.pyc +0 -0
- data/tools/epydoc/markup/javadoc.py +0 -250
- data/tools/epydoc/markup/javadoc.pyc +0 -0
- data/tools/epydoc/markup/plaintext.py +0 -78
- data/tools/epydoc/markup/plaintext.pyc +0 -0
- data/tools/epydoc/markup/pyval_repr.py +0 -532
- data/tools/epydoc/markup/pyval_repr.pyc +0 -0
- data/tools/epydoc/markup/restructuredtext.py +0 -906
- data/tools/epydoc/markup/restructuredtext.pyc +0 -0
- data/tools/epydoc/test/__init__.py +0 -97
- data/tools/epydoc/test/__init__.pyc +0 -0
- data/tools/epydoc/test/util.py +0 -226
- data/tools/epydoc/test/util.pyc +0 -0
- data/tools/epydoc/util.py +0 -289
- data/tools/epydoc/util.pyc +0 -0
- data/tools/logilab/logilab/__init__.py +0 -5
- data/tools/logilab/logilab/astng/__init__.py +0 -82
- data/tools/logilab/logilab/astng/__pkginfo__.py +0 -76
- data/tools/logilab/logilab/astng/_exceptions.py +0 -64
- data/tools/logilab/logilab/astng/_nodes_ast.py +0 -667
- data/tools/logilab/logilab/astng/_nodes_compiler.py +0 -758
- data/tools/logilab/logilab/astng/bases.py +0 -608
- data/tools/logilab/logilab/astng/builder.py +0 -239
- data/tools/logilab/logilab/astng/inference.py +0 -426
- data/tools/logilab/logilab/astng/inspector.py +0 -289
- data/tools/logilab/logilab/astng/manager.py +0 -421
- data/tools/logilab/logilab/astng/mixins.py +0 -165
- data/tools/logilab/logilab/astng/node_classes.py +0 -848
- data/tools/logilab/logilab/astng/nodes.py +0 -85
- data/tools/logilab/logilab/astng/nodes_as_string.py +0 -389
- data/tools/logilab/logilab/astng/patchcomptransformer.py +0 -159
- data/tools/logilab/logilab/astng/protocols.py +0 -333
- data/tools/logilab/logilab/astng/raw_building.py +0 -212
- data/tools/logilab/logilab/astng/rebuilder.py +0 -307
- data/tools/logilab/logilab/astng/scoped_nodes.py +0 -951
- data/tools/logilab/logilab/astng/test/__init__.py +0 -19
- 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 +0 -33
- data/tools/logilab/logilab/astng/test/data/SSL1/__init__.py +0 -20
- data/tools/logilab/logilab/astng/test/data/__init__.py +0 -20
- data/tools/logilab/logilab/astng/test/data/all.py +0 -29
- data/tools/logilab/logilab/astng/test/data/appl/__init__.py +0 -23
- data/tools/logilab/logilab/astng/test/data/appl/myConnection.py +0 -30
- data/tools/logilab/logilab/astng/test/data/format.py +0 -34
- data/tools/logilab/logilab/astng/test/data/module.py +0 -90
- data/tools/logilab/logilab/astng/test/data/module2.py +0 -112
- data/tools/logilab/logilab/astng/test/data/noendingnewline.py +0 -57
- data/tools/logilab/logilab/astng/test/data/nonregr.py +0 -76
- data/tools/logilab/logilab/astng/test/data/notall.py +0 -28
- data/tools/logilab/logilab/astng/test/data2/__init__.py +0 -20
- data/tools/logilab/logilab/astng/test/data2/clientmodule_test.py +0 -51
- data/tools/logilab/logilab/astng/test/data2/suppliermodule_test.py +0 -32
- data/tools/logilab/logilab/astng/test/regrtest.py +0 -135
- data/tools/logilab/logilab/astng/test/regrtest_data/absimport.py +0 -22
- data/tools/logilab/logilab/astng/test/regrtest_data/descriptor_crash.py +0 -31
- data/tools/logilab/logilab/astng/test/regrtest_data/import_package_subpackage_module.py +0 -68
- data/tools/logilab/logilab/astng/test/regrtest_data/package/__init__.py +0 -24
- data/tools/logilab/logilab/astng/test/regrtest_data/package/subpackage/__init__.py +0 -20
- data/tools/logilab/logilab/astng/test/regrtest_data/package/subpackage/module.py +0 -20
- data/tools/logilab/logilab/astng/test/unittest_builder.py +0 -684
- data/tools/logilab/logilab/astng/test/unittest_inference.py +0 -1112
- data/tools/logilab/logilab/astng/test/unittest_inspector.py +0 -105
- data/tools/logilab/logilab/astng/test/unittest_lookup.py +0 -302
- data/tools/logilab/logilab/astng/test/unittest_manager.py +0 -98
- data/tools/logilab/logilab/astng/test/unittest_nodes.py +0 -302
- data/tools/logilab/logilab/astng/test/unittest_scoped_nodes.py +0 -501
- data/tools/logilab/logilab/astng/test/unittest_utils.py +0 -104
- data/tools/logilab/logilab/astng/utils.py +0 -342
- data/tools/logilab/logilab/common/__init__.py +0 -140
- data/tools/logilab/logilab/common/__pkginfo__.py +0 -43
- data/tools/logilab/logilab/common/adbh.py +0 -35
- data/tools/logilab/logilab/common/cache.py +0 -114
- data/tools/logilab/logilab/common/changelog.py +0 -234
- data/tools/logilab/logilab/common/clcommands.py +0 -181
- data/tools/logilab/logilab/common/cli.py +0 -212
- data/tools/logilab/logilab/common/compat.py +0 -328
- data/tools/logilab/logilab/common/configuration.py +0 -1087
- data/tools/logilab/logilab/common/contexts.py +0 -58
- data/tools/logilab/logilab/common/corbautils.py +0 -117
- data/tools/logilab/logilab/common/daemon.py +0 -171
- data/tools/logilab/logilab/common/date.py +0 -279
- data/tools/logilab/logilab/common/db.py +0 -49
- data/tools/logilab/logilab/common/dbf.py +0 -229
- data/tools/logilab/logilab/common/debugger.py +0 -208
- data/tools/logilab/logilab/common/decorators.py +0 -190
- data/tools/logilab/logilab/common/deprecation.py +0 -118
- data/tools/logilab/logilab/common/fileutils.py +0 -409
- data/tools/logilab/logilab/common/graph.py +0 -259
- data/tools/logilab/logilab/common/html.py +0 -142
- data/tools/logilab/logilab/common/interface.py +0 -76
- data/tools/logilab/logilab/common/logging_ext.py +0 -166
- data/tools/logilab/logilab/common/modutils.py +0 -670
- data/tools/logilab/logilab/common/optik_ext.py +0 -383
- data/tools/logilab/logilab/common/optparser.py +0 -92
- data/tools/logilab/logilab/common/pdf_ext.py +0 -111
- data/tools/logilab/logilab/common/proc.py +0 -276
- data/tools/logilab/logilab/common/pyro_ext.py +0 -146
- data/tools/logilab/logilab/common/pytest.py +0 -754
- data/tools/logilab/logilab/common/shellutils.py +0 -383
- data/tools/logilab/logilab/common/sphinx_ext.py +0 -87
- data/tools/logilab/logilab/common/sphinxutils.py +0 -122
- data/tools/logilab/logilab/common/sqlgen.py +0 -31
- data/tools/logilab/logilab/common/table.py +0 -930
- data/tools/logilab/logilab/common/tasksqueue.py +0 -97
- data/tools/logilab/logilab/common/test/__init__.py +0 -1
- data/tools/logilab/logilab/common/test/data/ChangeLog +0 -184
- 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 +0 -1
- data/tools/logilab/logilab/common/test/data/content_differ_dir/NOTHING +0 -0
- data/tools/logilab/logilab/common/test/data/content_differ_dir/README +0 -1
- data/tools/logilab/logilab/common/test/data/content_differ_dir/subdir/coin +0 -1
- data/tools/logilab/logilab/common/test/data/content_differ_dir/subdir/toto.txt +0 -53
- data/tools/logilab/logilab/common/test/data/file_differ_dir/NOTHING +0 -0
- data/tools/logilab/logilab/common/test/data/file_differ_dir/README +0 -1
- data/tools/logilab/logilab/common/test/data/file_differ_dir/subdir/toto.txt +0 -53
- 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 +0 -9
- data/tools/logilab/logilab/common/test/data/module.py +0 -88
- data/tools/logilab/logilab/common/test/data/module2.py +0 -77
- data/tools/logilab/logilab/common/test/data/newlines.txt +0 -3
- data/tools/logilab/logilab/common/test/data/noendingnewline.py +0 -36
- data/tools/logilab/logilab/common/test/data/nonregr.py +0 -14
- 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 +0 -1
- data/tools/logilab/logilab/common/test/data/reference_dir/subdir/coin +0 -1
- data/tools/logilab/logilab/common/test/data/reference_dir/subdir/toto.txt +0 -53
- data/tools/logilab/logilab/common/test/data/same_dir/NOTHING +0 -0
- data/tools/logilab/logilab/common/test/data/same_dir/README +0 -1
- data/tools/logilab/logilab/common/test/data/same_dir/subdir/coin +0 -1
- data/tools/logilab/logilab/common/test/data/same_dir/subdir/toto.txt +0 -53
- data/tools/logilab/logilab/common/test/data/spam.txt +0 -9
- data/tools/logilab/logilab/common/test/data/sub/doc.txt +0 -1
- data/tools/logilab/logilab/common/test/data/sub/momo.py +0 -1
- data/tools/logilab/logilab/common/test/data/subdir_differ_dir/NOTHING +0 -0
- data/tools/logilab/logilab/common/test/data/subdir_differ_dir/README +0 -1
- data/tools/logilab/logilab/common/test/data/subdir_differ_dir/subdir/coin +0 -1
- data/tools/logilab/logilab/common/test/data/subdir_differ_dir/subdir/toto.txt +0 -53
- data/tools/logilab/logilab/common/test/data/test.ini +0 -20
- data/tools/logilab/logilab/common/test/data/test1.msg +0 -30
- data/tools/logilab/logilab/common/test/data/test2.msg +0 -42
- data/tools/logilab/logilab/common/test/data/write_protected_file.txt +0 -0
- data/tools/logilab/logilab/common/test/foomod.py +0 -17
- data/tools/logilab/logilab/common/test/unittest_cache.py +0 -129
- data/tools/logilab/logilab/common/test/unittest_changelog.py +0 -37
- data/tools/logilab/logilab/common/test/unittest_compat.py +0 -239
- data/tools/logilab/logilab/common/test/unittest_configuration.py +0 -348
- data/tools/logilab/logilab/common/test/unittest_date.py +0 -154
- data/tools/logilab/logilab/common/test/unittest_decorators.py +0 -62
- data/tools/logilab/logilab/common/test/unittest_deprecation.py +0 -76
- data/tools/logilab/logilab/common/test/unittest_fileutils.py +0 -133
- data/tools/logilab/logilab/common/test/unittest_graph.py +0 -50
- data/tools/logilab/logilab/common/test/unittest_html.py +0 -76
- data/tools/logilab/logilab/common/test/unittest_interface.py +0 -87
- data/tools/logilab/logilab/common/test/unittest_modutils.py +0 -244
- data/tools/logilab/logilab/common/test/unittest_pytest.py +0 -50
- data/tools/logilab/logilab/common/test/unittest_shellutils.py +0 -248
- data/tools/logilab/logilab/common/test/unittest_table.py +0 -448
- data/tools/logilab/logilab/common/test/unittest_taskqueue.py +0 -71
- data/tools/logilab/logilab/common/test/unittest_testlib.py +0 -956
- data/tools/logilab/logilab/common/test/unittest_textutils.py +0 -247
- data/tools/logilab/logilab/common/test/unittest_tree.py +0 -248
- data/tools/logilab/logilab/common/test/unittest_umessage.py +0 -55
- data/tools/logilab/logilab/common/test/unittest_ureports_html.py +0 -64
- data/tools/logilab/logilab/common/test/unittest_ureports_text.py +0 -105
- data/tools/logilab/logilab/common/test/unittest_xmlutils.py +0 -75
- data/tools/logilab/logilab/common/test/utils.py +0 -87
- data/tools/logilab/logilab/common/testlib.py +0 -1927
- data/tools/logilab/logilab/common/textutils.py +0 -476
- data/tools/logilab/logilab/common/tree.py +0 -372
- data/tools/logilab/logilab/common/umessage.py +0 -161
- data/tools/logilab/logilab/common/ureports/__init__.py +0 -174
- data/tools/logilab/logilab/common/ureports/docbook_writer.py +0 -139
- data/tools/logilab/logilab/common/ureports/html_writer.py +0 -131
- data/tools/logilab/logilab/common/ureports/nodes.py +0 -201
- data/tools/logilab/logilab/common/ureports/text_writer.py +0 -140
- data/tools/logilab/logilab/common/vcgutils.py +0 -216
- data/tools/logilab/logilab/common/visitor.py +0 -107
- data/tools/logilab/logilab/common/xmlrpcutils.py +0 -136
- data/tools/logilab/logilab/common/xmlutils.py +0 -61
- data/tools/pychecker/COPYRIGHT +0 -31
- data/tools/pychecker/ChangeLog +0 -349
- data/tools/pychecker/CodeChecks.py +0 -1969
- data/tools/pychecker/CodeChecks.pyc +0 -0
- data/tools/pychecker/CodeChecks.pyo +0 -0
- data/tools/pychecker/Config.py +0 -475
- data/tools/pychecker/Config.pyc +0 -0
- data/tools/pychecker/Config.pyo +0 -0
- data/tools/pychecker/KNOWN_BUGS +0 -100
- data/tools/pychecker/MAINTAINERS +0 -81
- data/tools/pychecker/NEWS +0 -406
- data/tools/pychecker/OP.py +0 -131
- data/tools/pychecker/OP.pyc +0 -0
- data/tools/pychecker/OP.pyo +0 -0
- data/tools/pychecker/OptionTypes.py +0 -117
- data/tools/pychecker/OptionTypes.pyc +0 -0
- data/tools/pychecker/OptionTypes.pyo +0 -0
- data/tools/pychecker/README +0 -152
- data/tools/pychecker/Stack.py +0 -115
- data/tools/pychecker/Stack.pyc +0 -0
- data/tools/pychecker/Stack.pyo +0 -0
- data/tools/pychecker/TODO +0 -101
- data/tools/pychecker/VERSION +0 -1
- data/tools/pychecker/Warning.py +0 -50
- data/tools/pychecker/Warning.pyc +0 -0
- data/tools/pychecker/Warning.pyo +0 -0
- data/tools/pychecker/__init__.py +0 -17
- data/tools/pychecker/__init__.pyc +0 -0
- data/tools/pychecker/__init__.pyo +0 -0
- data/tools/pychecker/checker.py +0 -961
- data/tools/pychecker/checker.pyc +0 -0
- data/tools/pychecker/checker.pyo +0 -0
- data/tools/pychecker/function.py +0 -159
- data/tools/pychecker/function.pyc +0 -0
- data/tools/pychecker/function.pyo +0 -0
- data/tools/pychecker/msgs.py +0 -175
- data/tools/pychecker/msgs.pyc +0 -0
- data/tools/pychecker/msgs.pyo +0 -0
- data/tools/pychecker/options.py +0 -275
- data/tools/pychecker/options.pyc +0 -0
- data/tools/pychecker/options.pyo +0 -0
- data/tools/pychecker/pcmodules.py +0 -19
- data/tools/pychecker/pcmodules.pyc +0 -0
- data/tools/pychecker/pcmodules.pyo +0 -0
- data/tools/pychecker/printer.py +0 -47
- data/tools/pychecker/printer.pyc +0 -0
- data/tools/pychecker/printer.pyo +0 -0
- data/tools/pychecker/python.py +0 -427
- data/tools/pychecker/python.pyc +0 -0
- data/tools/pychecker/python.pyo +0 -0
- data/tools/pychecker/utils.py +0 -102
- data/tools/pychecker/utils.pyc +0 -0
- data/tools/pychecker/utils.pyo +0 -0
- data/tools/pychecker/warn.py +0 -778
- data/tools/pychecker/warn.pyc +0 -0
- data/tools/pychecker/warn.pyo +0 -0
- data/tools/pylint2/pylint/__init__.py +0 -16
- data/tools/pylint2/pylint/__pkginfo__.py +0 -67
- data/tools/pylint2/pylint/checkers/__init__.py +0 -155
- data/tools/pylint2/pylint/checkers/base.py +0 -749
- data/tools/pylint2/pylint/checkers/classes.py +0 -527
- data/tools/pylint2/pylint/checkers/design_analysis.py +0 -344
- data/tools/pylint2/pylint/checkers/exceptions.py +0 -183
- data/tools/pylint2/pylint/checkers/format.py +0 -367
- data/tools/pylint2/pylint/checkers/imports.py +0 -379
- data/tools/pylint2/pylint/checkers/logging.py +0 -98
- data/tools/pylint2/pylint/checkers/misc.py +0 -128
- data/tools/pylint2/pylint/checkers/newstyle.py +0 -107
- data/tools/pylint2/pylint/checkers/raw_metrics.py +0 -125
- data/tools/pylint2/pylint/checkers/similar.py +0 -333
- data/tools/pylint2/pylint/checkers/string_format.py +0 -239
- data/tools/pylint2/pylint/checkers/typecheck.py +0 -364
- data/tools/pylint2/pylint/checkers/utils.py +0 -208
- data/tools/pylint2/pylint/checkers/variables.py +0 -498
- data/tools/pylint2/pylint/config.py +0 -149
- data/tools/pylint2/pylint/epylint.py +0 -149
- data/tools/pylint2/pylint/gui.py +0 -433
- data/tools/pylint2/pylint/interfaces.py +0 -98
- data/tools/pylint2/pylint/lint.py +0 -914
- data/tools/pylint2/pylint/pyreverse/__init__.py +0 -5
- data/tools/pylint2/pylint/pyreverse/diadefslib.py +0 -229
- data/tools/pylint2/pylint/pyreverse/diagrams.py +0 -247
- data/tools/pylint2/pylint/pyreverse/main.py +0 -123
- data/tools/pylint2/pylint/pyreverse/utils.py +0 -131
- data/tools/pylint2/pylint/pyreverse/writer.py +0 -196
- data/tools/pylint2/pylint/reporters/__init__.py +0 -67
- data/tools/pylint2/pylint/reporters/guireporter.py +0 -36
- data/tools/pylint2/pylint/reporters/html.py +0 -69
- data/tools/pylint2/pylint/reporters/text.py +0 -156
- data/tools/pylint2/pylint/utils.py +0 -518
- data/tools/pylint2/pylint.py +0 -16
@@ -1,216 +0,0 @@
|
|
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]
|
@@ -1,107 +0,0 @@
|
|
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)
|
@@ -1,136 +0,0 @@
|
|
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
|
@@ -1,61 +0,0 @@
|
|
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
|