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