bee_python 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- 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,505 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
A Docutils_ interpreted text role for cross-API reference support.
|
3
|
-
|
4
|
-
This module allows a Docutils_ document to refer to elements defined in
|
5
|
-
external API documentation. It is possible to refer to many external API
|
6
|
-
from the same document.
|
7
|
-
|
8
|
-
Each API documentation is assigned a new interpreted text role: using such
|
9
|
-
interpreted text, an user can specify an object name inside an API
|
10
|
-
documentation. The system will convert such text into an url and generate a
|
11
|
-
reference to it. For example, if the API ``db`` is defined, being a database
|
12
|
-
package, then a certain method may be referred as::
|
13
|
-
|
14
|
-
:db:`Connection.cursor()`
|
15
|
-
|
16
|
-
To define a new API, an *index file* must be provided. This file contains
|
17
|
-
a mapping from the object name to the URL part required to resolve such object.
|
18
|
-
|
19
|
-
Index file
|
20
|
-
----------
|
21
|
-
|
22
|
-
Each line in the the index file describes an object.
|
23
|
-
|
24
|
-
Each line contains the fully qualified name of the object and the URL at which
|
25
|
-
the documentation is located. The fields are separated by a ``<tab>``
|
26
|
-
character.
|
27
|
-
|
28
|
-
The URL's in the file are relative from the documentation root: the system can
|
29
|
-
be configured to add a prefix in front of each returned URL.
|
30
|
-
|
31
|
-
Allowed names
|
32
|
-
-------------
|
33
|
-
|
34
|
-
When a name is used in an API text role, it is split over any *separator*.
|
35
|
-
The separators defined are '``.``', '``::``', '``->``'. All the text from the
|
36
|
-
first noise char (neither a separator nor alphanumeric or '``_``') is
|
37
|
-
discarded. The same algorithm is applied when the index file is read.
|
38
|
-
|
39
|
-
First the sequence of name parts is looked for in the provided index file.
|
40
|
-
If no matching name is found, a partial match against the trailing part of the
|
41
|
-
names in the index is performed. If no object is found, or if the trailing part
|
42
|
-
of the name may refer to many objects, a warning is issued and no reference
|
43
|
-
is created.
|
44
|
-
|
45
|
-
Configuration
|
46
|
-
-------------
|
47
|
-
|
48
|
-
This module provides the class `ApiLinkReader` a replacement for the Docutils
|
49
|
-
standalone reader. Such reader specifies the settings required for the
|
50
|
-
API canonical roles configuration. The same command line options are exposed by
|
51
|
-
Epydoc.
|
52
|
-
|
53
|
-
The script ``apirst2html.py`` is a frontend for the `ApiLinkReader` reader.
|
54
|
-
|
55
|
-
API Linking Options::
|
56
|
-
|
57
|
-
--external-api=NAME
|
58
|
-
Define a new API document. A new interpreted text
|
59
|
-
role NAME will be added.
|
60
|
-
--external-api-file=NAME:FILENAME
|
61
|
-
Use records in FILENAME to resolve objects in the API
|
62
|
-
named NAME.
|
63
|
-
--external-api-root=NAME:STRING
|
64
|
-
Use STRING as prefix for the URL generated from the
|
65
|
-
API NAME.
|
66
|
-
|
67
|
-
.. _Docutils: http://docutils.sourceforge.net/
|
68
|
-
"""
|
69
|
-
|
70
|
-
# $Id: xlink.py,v 1.1 2009/11/26 13:20:48 casa Exp $
|
71
|
-
__version__ = "$Revision: 1.1 $"[11:-2]
|
72
|
-
__author__ = "Daniele Varrazzo"
|
73
|
-
__copyright__ = "Copyright (C) 2007 by Daniele Varrazzo"
|
74
|
-
__docformat__ = 'reStructuredText en'
|
75
|
-
|
76
|
-
import re
|
77
|
-
import sys
|
78
|
-
from optparse import OptionValueError
|
79
|
-
|
80
|
-
from epydoc import log
|
81
|
-
|
82
|
-
class UrlGenerator:
|
83
|
-
"""
|
84
|
-
Generate URL from an object name.
|
85
|
-
"""
|
86
|
-
class IndexAmbiguous(IndexError):
|
87
|
-
"""
|
88
|
-
The name looked for is ambiguous
|
89
|
-
"""
|
90
|
-
|
91
|
-
def get_url(self, name):
|
92
|
-
"""Look for a name and return the matching URL documentation.
|
93
|
-
|
94
|
-
First look for a fully qualified name. If not found, try with partial
|
95
|
-
name.
|
96
|
-
|
97
|
-
If no url exists for the given object, return `None`.
|
98
|
-
|
99
|
-
:Parameters:
|
100
|
-
`name` : `str`
|
101
|
-
the name to look for
|
102
|
-
|
103
|
-
:return: the URL that can be used to reach the `name` documentation.
|
104
|
-
`None` if no such URL exists.
|
105
|
-
:rtype: `str`
|
106
|
-
|
107
|
-
:Exceptions:
|
108
|
-
- `IndexError`: no object found with `name`
|
109
|
-
- `DocUrlGenerator.IndexAmbiguous` : more than one object found with
|
110
|
-
a non-fully qualified name; notice that this is an ``IndexError``
|
111
|
-
subclass
|
112
|
-
"""
|
113
|
-
raise NotImplementedError
|
114
|
-
|
115
|
-
def get_canonical_name(self, name):
|
116
|
-
"""
|
117
|
-
Convert an object name into a canonical name.
|
118
|
-
|
119
|
-
the canonical name of an object is a tuple of strings containing its
|
120
|
-
name fragments, splitted on any allowed separator ('``.``', '``::``',
|
121
|
-
'``->``').
|
122
|
-
|
123
|
-
Noise such parenthesis to indicate a function is discarded.
|
124
|
-
|
125
|
-
:Parameters:
|
126
|
-
`name` : `str`
|
127
|
-
an object name, such as ``os.path.prefix()`` or ``lib::foo::bar``
|
128
|
-
|
129
|
-
:return: the fully qualified name such ``('os', 'path', 'prefix')`` and
|
130
|
-
``('lib', 'foo', 'bar')``
|
131
|
-
:rtype: `tuple` of `str`
|
132
|
-
"""
|
133
|
-
rv = []
|
134
|
-
for m in self._SEP_RE.finditer(name):
|
135
|
-
groups = m.groups()
|
136
|
-
if groups[0] is not None:
|
137
|
-
rv.append(groups[0])
|
138
|
-
elif groups[2] is not None:
|
139
|
-
break
|
140
|
-
|
141
|
-
return tuple(rv)
|
142
|
-
|
143
|
-
_SEP_RE = re.compile(r"""(?x)
|
144
|
-
# Tokenize the input into keyword, separator, noise
|
145
|
-
([a-zA-Z0-9_]+) | # A keyword is a alphanum word
|
146
|
-
( \. | \:\: | \-\> ) | # These are the allowed separators
|
147
|
-
(.) # If it doesn't fit, it's noise.
|
148
|
-
# Matching a single noise char is enough, because it
|
149
|
-
# is used to break the tokenization as soon as some noise
|
150
|
-
# is found.
|
151
|
-
""")
|
152
|
-
|
153
|
-
|
154
|
-
class VoidUrlGenerator(UrlGenerator):
|
155
|
-
"""
|
156
|
-
Don't actually know any url, but don't report any error.
|
157
|
-
|
158
|
-
Useful if an index file is not available, but a document linking to it
|
159
|
-
is to be generated, and warnings are to be avoided.
|
160
|
-
|
161
|
-
Don't report any object as missing, Don't return any url anyway.
|
162
|
-
"""
|
163
|
-
def get_url(self, name):
|
164
|
-
return None
|
165
|
-
|
166
|
-
|
167
|
-
class DocUrlGenerator(UrlGenerator):
|
168
|
-
"""
|
169
|
-
Read a *documentation index* and generate URL's for it.
|
170
|
-
"""
|
171
|
-
def __init__(self):
|
172
|
-
self._exact_matches = {}
|
173
|
-
"""
|
174
|
-
A map from an object fully qualified name to its URL.
|
175
|
-
|
176
|
-
Values are both the name as tuple of fragments and as read from the
|
177
|
-
records (see `load_records()`), mostly to help `_partial_names` to
|
178
|
-
perform lookup for unambiguous names.
|
179
|
-
"""
|
180
|
-
|
181
|
-
self._partial_names= {}
|
182
|
-
"""
|
183
|
-
A map from partial names to the fully qualified names they may refer.
|
184
|
-
|
185
|
-
The keys are the possible left sub-tuples of fully qualified names,
|
186
|
-
the values are list of strings as provided by the index.
|
187
|
-
|
188
|
-
If the list for a given tuple contains a single item, the partial
|
189
|
-
match is not ambuguous. In this case the string can be looked up in
|
190
|
-
`_exact_matches`.
|
191
|
-
|
192
|
-
If the name fragment is ambiguous, a warning may be issued to the user.
|
193
|
-
The items can be used to provide an informative message to the user,
|
194
|
-
to help him qualifying the name in a unambiguous manner.
|
195
|
-
"""
|
196
|
-
|
197
|
-
self.prefix = ''
|
198
|
-
"""
|
199
|
-
Prefix portion for the URL's returned by `get_url()`.
|
200
|
-
"""
|
201
|
-
|
202
|
-
self._filename = None
|
203
|
-
"""
|
204
|
-
Not very important: only for logging.
|
205
|
-
"""
|
206
|
-
|
207
|
-
def get_url(self, name):
|
208
|
-
cname = self.get_canonical_name(name)
|
209
|
-
url = self._exact_matches.get(cname, None)
|
210
|
-
if url is None:
|
211
|
-
|
212
|
-
# go for a partial match
|
213
|
-
vals = self._partial_names.get(cname)
|
214
|
-
if vals is None:
|
215
|
-
raise IndexError(
|
216
|
-
"no object named '%s' found" % (name))
|
217
|
-
|
218
|
-
elif len(vals) == 1:
|
219
|
-
url = self._exact_matches[vals[0]]
|
220
|
-
|
221
|
-
else:
|
222
|
-
raise self.IndexAmbiguous(
|
223
|
-
"found %d objects that '%s' may refer to: %s"
|
224
|
-
% (len(vals), name, ", ".join(["'%s'" % n for n in vals])))
|
225
|
-
|
226
|
-
return self.prefix + url
|
227
|
-
|
228
|
-
#{ Content loading
|
229
|
-
# ---------------
|
230
|
-
|
231
|
-
def clear(self):
|
232
|
-
"""
|
233
|
-
Clear the current class content.
|
234
|
-
"""
|
235
|
-
self._exact_matches.clear()
|
236
|
-
self._partial_names.clear()
|
237
|
-
|
238
|
-
def load_index(self, f):
|
239
|
-
"""
|
240
|
-
Read the content of an index file.
|
241
|
-
|
242
|
-
Populate the internal maps with the file content using `load_records()`.
|
243
|
-
|
244
|
-
:Parameters:
|
245
|
-
f : `str` or file
|
246
|
-
a file name or file-like object fron which read the index.
|
247
|
-
"""
|
248
|
-
self._filename = str(f)
|
249
|
-
|
250
|
-
if isinstance(f, basestring):
|
251
|
-
f = open(f)
|
252
|
-
|
253
|
-
self.load_records(self._iter_tuples(f))
|
254
|
-
|
255
|
-
def _iter_tuples(self, f):
|
256
|
-
"""Iterate on a file returning 2-tuples."""
|
257
|
-
for nrow, row in enumerate(f):
|
258
|
-
# skip blank lines
|
259
|
-
row = row.rstrip()
|
260
|
-
if not row: continue
|
261
|
-
|
262
|
-
rec = row.split('\t', 2)
|
263
|
-
if len(rec) == 2:
|
264
|
-
yield rec
|
265
|
-
else:
|
266
|
-
log.warning("invalid row in '%s' row %d: '%s'"
|
267
|
-
% (self._filename, nrow+1, row))
|
268
|
-
|
269
|
-
def load_records(self, records):
|
270
|
-
"""
|
271
|
-
Read a sequence of pairs name -> url and populate the internal maps.
|
272
|
-
|
273
|
-
:Parameters:
|
274
|
-
records : iterable
|
275
|
-
the sequence of pairs (*name*, *url*) to add to the maps.
|
276
|
-
"""
|
277
|
-
for name, url in records:
|
278
|
-
cname = self.get_canonical_name(name)
|
279
|
-
if not cname:
|
280
|
-
log.warning("invalid object name in '%s': '%s'"
|
281
|
-
% (self._filename, name))
|
282
|
-
continue
|
283
|
-
|
284
|
-
# discard duplicates
|
285
|
-
if name in self._exact_matches:
|
286
|
-
continue
|
287
|
-
|
288
|
-
self._exact_matches[name] = url
|
289
|
-
self._exact_matches[cname] = url
|
290
|
-
|
291
|
-
# Link the different ambiguous fragments to the url
|
292
|
-
for i in range(1, len(cname)):
|
293
|
-
self._partial_names.setdefault(cname[i:], []).append(name)
|
294
|
-
|
295
|
-
#{ API register
|
296
|
-
# ------------
|
297
|
-
|
298
|
-
api_register = {}
|
299
|
-
"""
|
300
|
-
Mapping from the API name to the `UrlGenerator` to be used.
|
301
|
-
|
302
|
-
Use `register_api()` to add new generators to the register.
|
303
|
-
"""
|
304
|
-
|
305
|
-
def register_api(name, generator=None):
|
306
|
-
"""Register the API `name` into the `api_register`.
|
307
|
-
|
308
|
-
A registered API will be available to the markup as the interpreted text
|
309
|
-
role ``name``.
|
310
|
-
|
311
|
-
If a `generator` is not provided, register a `VoidUrlGenerator` instance:
|
312
|
-
in this case no warning will be issued for missing names, but no URL will
|
313
|
-
be generated and all the dotted names will simply be rendered as literals.
|
314
|
-
|
315
|
-
:Parameters:
|
316
|
-
`name` : `str`
|
317
|
-
the name of the generator to be registered
|
318
|
-
`generator` : `UrlGenerator`
|
319
|
-
the object to register to translate names into URLs.
|
320
|
-
"""
|
321
|
-
if generator is None:
|
322
|
-
generator = VoidUrlGenerator()
|
323
|
-
|
324
|
-
api_register[name] = generator
|
325
|
-
|
326
|
-
def set_api_file(name, file):
|
327
|
-
"""Set an URL generator populated with data from `file`.
|
328
|
-
|
329
|
-
Use `file` to populate a new `DocUrlGenerator` instance and register it
|
330
|
-
as `name`.
|
331
|
-
|
332
|
-
:Parameters:
|
333
|
-
`name` : `str`
|
334
|
-
the name of the generator to be registered
|
335
|
-
`file` : `str` or file
|
336
|
-
the file to parse populate the URL generator
|
337
|
-
"""
|
338
|
-
generator = DocUrlGenerator()
|
339
|
-
generator.load_index(file)
|
340
|
-
register_api(name, generator)
|
341
|
-
|
342
|
-
def set_api_root(name, prefix):
|
343
|
-
"""Set the root for the URLs returned by a registered URL generator.
|
344
|
-
|
345
|
-
:Parameters:
|
346
|
-
`name` : `str`
|
347
|
-
the name of the generator to be updated
|
348
|
-
`prefix` : `str`
|
349
|
-
the prefix for the generated URL's
|
350
|
-
|
351
|
-
:Exceptions:
|
352
|
-
- `IndexError`: `name` is not a registered generator
|
353
|
-
"""
|
354
|
-
api_register[name].prefix = prefix
|
355
|
-
|
356
|
-
######################################################################
|
357
|
-
# Below this point requires docutils.
|
358
|
-
try:
|
359
|
-
import docutils
|
360
|
-
from docutils.parsers.rst import roles
|
361
|
-
from docutils import nodes, utils
|
362
|
-
from docutils.readers.standalone import Reader
|
363
|
-
except ImportError:
|
364
|
-
docutils = roles = nodes = utils = None
|
365
|
-
class Reader: settings_spec = ()
|
366
|
-
|
367
|
-
def create_api_role(name, problematic):
|
368
|
-
"""
|
369
|
-
Create and register a new role to create links for an API documentation.
|
370
|
-
|
371
|
-
Create a role called `name`, which will use the URL resolver registered as
|
372
|
-
``name`` in `api_register` to create a link for an object.
|
373
|
-
|
374
|
-
:Parameters:
|
375
|
-
`name` : `str`
|
376
|
-
name of the role to create.
|
377
|
-
`problematic` : `bool`
|
378
|
-
if True, the registered role will create problematic nodes in
|
379
|
-
case of failed references. If False, a warning will be raised
|
380
|
-
anyway, but the output will appear as an ordinary literal.
|
381
|
-
"""
|
382
|
-
def resolve_api_name(n, rawtext, text, lineno, inliner,
|
383
|
-
options={}, content=[]):
|
384
|
-
if docutils is None:
|
385
|
-
raise AssertionError('requires docutils')
|
386
|
-
|
387
|
-
# node in monotype font
|
388
|
-
text = utils.unescape(text)
|
389
|
-
node = nodes.literal(rawtext, text, **options)
|
390
|
-
|
391
|
-
# Get the resolver from the register and create an url from it.
|
392
|
-
try:
|
393
|
-
url = api_register[name].get_url(text)
|
394
|
-
except IndexError, exc:
|
395
|
-
msg = inliner.reporter.warning(str(exc), line=lineno)
|
396
|
-
if problematic:
|
397
|
-
prb = inliner.problematic(rawtext, text, msg)
|
398
|
-
return [prb], [msg]
|
399
|
-
else:
|
400
|
-
return [node], []
|
401
|
-
|
402
|
-
if url is not None:
|
403
|
-
node = nodes.reference(rawtext, '', node, refuri=url, **options)
|
404
|
-
return [node], []
|
405
|
-
|
406
|
-
roles.register_local_role(name, resolve_api_name)
|
407
|
-
|
408
|
-
|
409
|
-
#{ Command line parsing
|
410
|
-
# --------------------
|
411
|
-
|
412
|
-
|
413
|
-
def split_name(value):
|
414
|
-
"""
|
415
|
-
Split an option in form ``NAME:VALUE`` and check if ``NAME`` exists.
|
416
|
-
"""
|
417
|
-
parts = value.split(':', 1)
|
418
|
-
if len(parts) != 2:
|
419
|
-
raise OptionValueError(
|
420
|
-
"option value must be specified as NAME:VALUE; got '%s' instead"
|
421
|
-
% value)
|
422
|
-
|
423
|
-
name, val = parts
|
424
|
-
|
425
|
-
if name not in api_register:
|
426
|
-
raise OptionValueError(
|
427
|
-
"the name '%s' has not been registered; use --external-api"
|
428
|
-
% name)
|
429
|
-
|
430
|
-
return (name, val)
|
431
|
-
|
432
|
-
|
433
|
-
class ApiLinkReader(Reader):
|
434
|
-
"""
|
435
|
-
A Docutils standalone reader allowing external documentation links.
|
436
|
-
|
437
|
-
The reader configure the url resolvers at the time `read()` is invoked the
|
438
|
-
first time.
|
439
|
-
"""
|
440
|
-
#: The option parser configuration.
|
441
|
-
settings_spec = (
|
442
|
-
'API Linking Options',
|
443
|
-
None,
|
444
|
-
((
|
445
|
-
'Define a new API document. A new interpreted text role NAME will be '
|
446
|
-
'added.',
|
447
|
-
['--external-api'],
|
448
|
-
{'metavar': 'NAME', 'action': 'append'}
|
449
|
-
), (
|
450
|
-
'Use records in FILENAME to resolve objects in the API named NAME.',
|
451
|
-
['--external-api-file'],
|
452
|
-
{'metavar': 'NAME:FILENAME', 'action': 'append'}
|
453
|
-
), (
|
454
|
-
'Use STRING as prefix for the URL generated from the API NAME.',
|
455
|
-
['--external-api-root'],
|
456
|
-
{'metavar': 'NAME:STRING', 'action': 'append'}
|
457
|
-
),)) + Reader.settings_spec
|
458
|
-
|
459
|
-
def __init__(self, *args, **kwargs):
|
460
|
-
if docutils is None:
|
461
|
-
raise AssertionError('requires docutils')
|
462
|
-
Reader.__init__(self, *args, **kwargs)
|
463
|
-
|
464
|
-
def read(self, source, parser, settings):
|
465
|
-
self.read_configuration(settings, problematic=True)
|
466
|
-
return Reader.read(self, source, parser, settings)
|
467
|
-
|
468
|
-
def read_configuration(self, settings, problematic=True):
|
469
|
-
"""
|
470
|
-
Read the configuration for the configured URL resolver.
|
471
|
-
|
472
|
-
Register a new role for each configured API.
|
473
|
-
|
474
|
-
:Parameters:
|
475
|
-
`settings`
|
476
|
-
the settings structure containing the options to read.
|
477
|
-
`problematic` : `bool`
|
478
|
-
if True, the registered role will create problematic nodes in
|
479
|
-
case of failed references. If False, a warning will be raised
|
480
|
-
anyway, but the output will appear as an ordinary literal.
|
481
|
-
"""
|
482
|
-
# Read config only once
|
483
|
-
if hasattr(self, '_conf'):
|
484
|
-
return
|
485
|
-
ApiLinkReader._conf = True
|
486
|
-
|
487
|
-
try:
|
488
|
-
if settings.external_api is not None:
|
489
|
-
for name in settings.external_api:
|
490
|
-
register_api(name)
|
491
|
-
create_api_role(name, problematic=problematic)
|
492
|
-
|
493
|
-
if settings.external_api_file is not None:
|
494
|
-
for name, file in map(split_name, settings.external_api_file):
|
495
|
-
set_api_file(name, file)
|
496
|
-
|
497
|
-
if settings.external_api_root is not None:
|
498
|
-
for name, root in map(split_name, settings.external_api_root):
|
499
|
-
set_api_root(name, root)
|
500
|
-
|
501
|
-
except OptionValueError, exc:
|
502
|
-
print >>sys.stderr, "%s: %s" % (exc.__class__.__name__, exc)
|
503
|
-
sys.exit(2)
|
504
|
-
|
505
|
-
read_configuration = classmethod(read_configuration)
|
Binary file
|