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.
Files changed (488) hide show
  1. data/{build/README → README} +1 -1
  2. data/egg/egg/build.yml +11 -49
  3. data/egg/egg.yml +19 -27
  4. data/egg/http/build.erb +32 -36
  5. data/egg/http/libhttp.py +102 -0
  6. data/egg/http/pylint.cfg +236 -0
  7. data/egg/http/server.py +7 -0
  8. data/egg/http/test.erb +32 -0
  9. data/egg/http.yml +33 -29
  10. data/egg/mysql/mysql.py +8 -9
  11. data/egg/project/build.erb +21 -53
  12. data/egg/project/pylint.cfg +236 -0
  13. data/egg/project/test.py +2 -2
  14. data/egg/project.yml +23 -31
  15. data/egg/script/build.erb +18 -23
  16. data/egg/script/pylint.cfg +236 -0
  17. data/egg/script.yml +22 -18
  18. data/egg/source/source.py +6 -6
  19. data/egg/test/test.py +1 -1
  20. data/lib/bee_task_python.rb +3 -34
  21. data/python.yml +123 -0
  22. metadata +61 -503
  23. data/test/build.yml +0 -16
  24. data/test/tc_bee_task_python.rb +0 -27
  25. data/test/test_build.rb +0 -26
  26. data/test/test_build_listener.rb +0 -110
  27. data/test/ts_bee_python.rb +0 -26
  28. data/tools/common/__init__.py +0 -5
  29. data/tools/common/common/__init__.py +0 -140
  30. data/tools/common/common/__pkginfo__.py +0 -43
  31. data/tools/common/common/adbh.py +0 -35
  32. data/tools/common/common/cache.py +0 -114
  33. data/tools/common/common/changelog.py +0 -234
  34. data/tools/common/common/clcommands.py +0 -181
  35. data/tools/common/common/cli.py +0 -212
  36. data/tools/common/common/compat.py +0 -328
  37. data/tools/common/common/configuration.py +0 -1087
  38. data/tools/common/common/contexts.py +0 -58
  39. data/tools/common/common/corbautils.py +0 -117
  40. data/tools/common/common/daemon.py +0 -171
  41. data/tools/common/common/date.py +0 -279
  42. data/tools/common/common/db.py +0 -49
  43. data/tools/common/common/dbf.py +0 -229
  44. data/tools/common/common/debugger.py +0 -208
  45. data/tools/common/common/decorators.py +0 -190
  46. data/tools/common/common/deprecation.py +0 -118
  47. data/tools/common/common/fileutils.py +0 -409
  48. data/tools/common/common/graph.py +0 -259
  49. data/tools/common/common/html.py +0 -142
  50. data/tools/common/common/interface.py +0 -76
  51. data/tools/common/common/logging_ext.py +0 -166
  52. data/tools/common/common/modutils.py +0 -670
  53. data/tools/common/common/optik_ext.py +0 -383
  54. data/tools/common/common/optparser.py +0 -92
  55. data/tools/common/common/pdf_ext.py +0 -111
  56. data/tools/common/common/proc.py +0 -276
  57. data/tools/common/common/pyro_ext.py +0 -146
  58. data/tools/common/common/pytest.py +0 -754
  59. data/tools/common/common/shellutils.py +0 -383
  60. data/tools/common/common/sphinx_ext.py +0 -87
  61. data/tools/common/common/sphinxutils.py +0 -122
  62. data/tools/common/common/sqlgen.py +0 -31
  63. data/tools/common/common/table.py +0 -930
  64. data/tools/common/common/tasksqueue.py +0 -97
  65. data/tools/common/common/test/__init__.py +0 -1
  66. data/tools/common/common/test/data/ChangeLog +0 -184
  67. data/tools/common/common/test/data/MyPyPa-0.1.0-py2.5.egg +0 -0
  68. data/tools/common/common/test/data/__init__.py +0 -1
  69. data/tools/common/common/test/data/content_differ_dir/NOTHING +0 -0
  70. data/tools/common/common/test/data/content_differ_dir/README +0 -1
  71. data/tools/common/common/test/data/content_differ_dir/subdir/coin +0 -1
  72. data/tools/common/common/test/data/content_differ_dir/subdir/toto.txt +0 -53
  73. data/tools/common/common/test/data/file_differ_dir/NOTHING +0 -0
  74. data/tools/common/common/test/data/file_differ_dir/README +0 -1
  75. data/tools/common/common/test/data/file_differ_dir/subdir/toto.txt +0 -53
  76. data/tools/common/common/test/data/file_differ_dir/subdirtwo/Hello +0 -0
  77. data/tools/common/common/test/data/find_test/__init__.py +0 -0
  78. data/tools/common/common/test/data/find_test/foo.txt +0 -0
  79. data/tools/common/common/test/data/find_test/module.py +0 -0
  80. data/tools/common/common/test/data/find_test/module2.py +0 -0
  81. data/tools/common/common/test/data/find_test/newlines.txt +0 -0
  82. data/tools/common/common/test/data/find_test/noendingnewline.py +0 -0
  83. data/tools/common/common/test/data/find_test/nonregr.py +0 -0
  84. data/tools/common/common/test/data/find_test/normal_file.txt +0 -0
  85. data/tools/common/common/test/data/find_test/spam.txt +0 -0
  86. data/tools/common/common/test/data/find_test/sub/doc.txt +0 -0
  87. data/tools/common/common/test/data/find_test/sub/momo.py +0 -0
  88. data/tools/common/common/test/data/find_test/test.ini +0 -0
  89. data/tools/common/common/test/data/find_test/test1.msg +0 -0
  90. data/tools/common/common/test/data/find_test/test2.msg +0 -0
  91. data/tools/common/common/test/data/find_test/write_protected_file.txt +0 -0
  92. data/tools/common/common/test/data/foo.txt +0 -9
  93. data/tools/common/common/test/data/module.py +0 -88
  94. data/tools/common/common/test/data/module2.py +0 -77
  95. data/tools/common/common/test/data/newlines.txt +0 -3
  96. data/tools/common/common/test/data/noendingnewline.py +0 -36
  97. data/tools/common/common/test/data/nonregr.py +0 -14
  98. data/tools/common/common/test/data/normal_file.txt +0 -0
  99. data/tools/common/common/test/data/reference_dir/NOTHING +0 -0
  100. data/tools/common/common/test/data/reference_dir/README +0 -1
  101. data/tools/common/common/test/data/reference_dir/subdir/coin +0 -1
  102. data/tools/common/common/test/data/reference_dir/subdir/toto.txt +0 -53
  103. data/tools/common/common/test/data/same_dir/NOTHING +0 -0
  104. data/tools/common/common/test/data/same_dir/README +0 -1
  105. data/tools/common/common/test/data/same_dir/subdir/coin +0 -1
  106. data/tools/common/common/test/data/same_dir/subdir/toto.txt +0 -53
  107. data/tools/common/common/test/data/spam.txt +0 -9
  108. data/tools/common/common/test/data/sub/doc.txt +0 -1
  109. data/tools/common/common/test/data/sub/momo.py +0 -1
  110. data/tools/common/common/test/data/subdir_differ_dir/NOTHING +0 -0
  111. data/tools/common/common/test/data/subdir_differ_dir/README +0 -1
  112. data/tools/common/common/test/data/subdir_differ_dir/subdir/coin +0 -1
  113. data/tools/common/common/test/data/subdir_differ_dir/subdir/toto.txt +0 -53
  114. data/tools/common/common/test/data/test.ini +0 -20
  115. data/tools/common/common/test/data/test1.msg +0 -30
  116. data/tools/common/common/test/data/test2.msg +0 -42
  117. data/tools/common/common/test/data/write_protected_file.txt +0 -0
  118. data/tools/common/common/test/foomod.py +0 -17
  119. data/tools/common/common/test/unittest_cache.py +0 -129
  120. data/tools/common/common/test/unittest_changelog.py +0 -37
  121. data/tools/common/common/test/unittest_compat.py +0 -239
  122. data/tools/common/common/test/unittest_configuration.py +0 -348
  123. data/tools/common/common/test/unittest_date.py +0 -154
  124. data/tools/common/common/test/unittest_decorators.py +0 -62
  125. data/tools/common/common/test/unittest_deprecation.py +0 -76
  126. data/tools/common/common/test/unittest_fileutils.py +0 -133
  127. data/tools/common/common/test/unittest_graph.py +0 -50
  128. data/tools/common/common/test/unittest_html.py +0 -76
  129. data/tools/common/common/test/unittest_interface.py +0 -87
  130. data/tools/common/common/test/unittest_modutils.py +0 -244
  131. data/tools/common/common/test/unittest_pytest.py +0 -50
  132. data/tools/common/common/test/unittest_shellutils.py +0 -248
  133. data/tools/common/common/test/unittest_table.py +0 -448
  134. data/tools/common/common/test/unittest_taskqueue.py +0 -71
  135. data/tools/common/common/test/unittest_testlib.py +0 -956
  136. data/tools/common/common/test/unittest_textutils.py +0 -247
  137. data/tools/common/common/test/unittest_tree.py +0 -248
  138. data/tools/common/common/test/unittest_umessage.py +0 -55
  139. data/tools/common/common/test/unittest_ureports_html.py +0 -64
  140. data/tools/common/common/test/unittest_ureports_text.py +0 -105
  141. data/tools/common/common/test/unittest_xmlutils.py +0 -75
  142. data/tools/common/common/test/utils.py +0 -87
  143. data/tools/common/common/testlib.py +0 -1927
  144. data/tools/common/common/textutils.py +0 -476
  145. data/tools/common/common/tree.py +0 -372
  146. data/tools/common/common/umessage.py +0 -161
  147. data/tools/common/common/ureports/__init__.py +0 -174
  148. data/tools/common/common/ureports/docbook_writer.py +0 -139
  149. data/tools/common/common/ureports/html_writer.py +0 -131
  150. data/tools/common/common/ureports/nodes.py +0 -201
  151. data/tools/common/common/ureports/text_writer.py +0 -140
  152. data/tools/common/common/vcgutils.py +0 -216
  153. data/tools/common/common/visitor.py +0 -107
  154. data/tools/common/common/xmlrpcutils.py +0 -136
  155. data/tools/common/common/xmlutils.py +0 -61
  156. data/tools/coverage/coverage.py +0 -602
  157. data/tools/epydoc/__init__.py +0 -227
  158. data/tools/epydoc/__init__.pyc +0 -0
  159. data/tools/epydoc/apidoc.py +0 -2203
  160. data/tools/epydoc/apidoc.pyc +0 -0
  161. data/tools/epydoc/checker.py +0 -349
  162. data/tools/epydoc/checker.pyc +0 -0
  163. data/tools/epydoc/cli.py +0 -1470
  164. data/tools/epydoc/cli.pyc +0 -0
  165. data/tools/epydoc/compat.py +0 -250
  166. data/tools/epydoc/compat.pyc +0 -0
  167. data/tools/epydoc/docbuilder.py +0 -1358
  168. data/tools/epydoc/docbuilder.pyc +0 -0
  169. data/tools/epydoc/docintrospecter.py +0 -1056
  170. data/tools/epydoc/docintrospecter.pyc +0 -0
  171. data/tools/epydoc/docparser.py +0 -2113
  172. data/tools/epydoc/docparser.pyc +0 -0
  173. data/tools/epydoc/docstringparser.py +0 -1111
  174. data/tools/epydoc/docstringparser.pyc +0 -0
  175. data/tools/epydoc/docwriter/__init__.py +0 -12
  176. data/tools/epydoc/docwriter/__init__.pyc +0 -0
  177. data/tools/epydoc/docwriter/dotgraph.py +0 -1351
  178. data/tools/epydoc/docwriter/dotgraph.pyc +0 -0
  179. data/tools/epydoc/docwriter/html.py +0 -3491
  180. data/tools/epydoc/docwriter/html.pyc +0 -0
  181. data/tools/epydoc/docwriter/html_colorize.py +0 -909
  182. data/tools/epydoc/docwriter/html_colorize.pyc +0 -0
  183. data/tools/epydoc/docwriter/html_css.py +0 -550
  184. data/tools/epydoc/docwriter/html_css.pyc +0 -0
  185. data/tools/epydoc/docwriter/html_help.py +0 -190
  186. data/tools/epydoc/docwriter/html_help.pyc +0 -0
  187. data/tools/epydoc/docwriter/latex.py +0 -1187
  188. data/tools/epydoc/docwriter/latex.pyc +0 -0
  189. data/tools/epydoc/docwriter/plaintext.py +0 -276
  190. data/tools/epydoc/docwriter/plaintext.pyc +0 -0
  191. data/tools/epydoc/docwriter/xlink.py +0 -505
  192. data/tools/epydoc/docwriter/xlink.pyc +0 -0
  193. data/tools/epydoc/gui.py +0 -1148
  194. data/tools/epydoc/gui.pyc +0 -0
  195. data/tools/epydoc/log.py +0 -204
  196. data/tools/epydoc/log.pyc +0 -0
  197. data/tools/epydoc/markup/__init__.py +0 -623
  198. data/tools/epydoc/markup/__init__.pyc +0 -0
  199. data/tools/epydoc/markup/doctest.py +0 -311
  200. data/tools/epydoc/markup/doctest.pyc +0 -0
  201. data/tools/epydoc/markup/epytext.py +0 -2116
  202. data/tools/epydoc/markup/epytext.pyc +0 -0
  203. data/tools/epydoc/markup/javadoc.py +0 -250
  204. data/tools/epydoc/markup/javadoc.pyc +0 -0
  205. data/tools/epydoc/markup/plaintext.py +0 -78
  206. data/tools/epydoc/markup/plaintext.pyc +0 -0
  207. data/tools/epydoc/markup/pyval_repr.py +0 -532
  208. data/tools/epydoc/markup/pyval_repr.pyc +0 -0
  209. data/tools/epydoc/markup/restructuredtext.py +0 -906
  210. data/tools/epydoc/markup/restructuredtext.pyc +0 -0
  211. data/tools/epydoc/test/__init__.py +0 -97
  212. data/tools/epydoc/test/__init__.pyc +0 -0
  213. data/tools/epydoc/test/util.py +0 -226
  214. data/tools/epydoc/test/util.pyc +0 -0
  215. data/tools/epydoc/util.py +0 -289
  216. data/tools/epydoc/util.pyc +0 -0
  217. data/tools/logilab/logilab/__init__.py +0 -5
  218. data/tools/logilab/logilab/astng/__init__.py +0 -82
  219. data/tools/logilab/logilab/astng/__pkginfo__.py +0 -76
  220. data/tools/logilab/logilab/astng/_exceptions.py +0 -64
  221. data/tools/logilab/logilab/astng/_nodes_ast.py +0 -667
  222. data/tools/logilab/logilab/astng/_nodes_compiler.py +0 -758
  223. data/tools/logilab/logilab/astng/bases.py +0 -608
  224. data/tools/logilab/logilab/astng/builder.py +0 -239
  225. data/tools/logilab/logilab/astng/inference.py +0 -426
  226. data/tools/logilab/logilab/astng/inspector.py +0 -289
  227. data/tools/logilab/logilab/astng/manager.py +0 -421
  228. data/tools/logilab/logilab/astng/mixins.py +0 -165
  229. data/tools/logilab/logilab/astng/node_classes.py +0 -848
  230. data/tools/logilab/logilab/astng/nodes.py +0 -85
  231. data/tools/logilab/logilab/astng/nodes_as_string.py +0 -389
  232. data/tools/logilab/logilab/astng/patchcomptransformer.py +0 -159
  233. data/tools/logilab/logilab/astng/protocols.py +0 -333
  234. data/tools/logilab/logilab/astng/raw_building.py +0 -212
  235. data/tools/logilab/logilab/astng/rebuilder.py +0 -307
  236. data/tools/logilab/logilab/astng/scoped_nodes.py +0 -951
  237. data/tools/logilab/logilab/astng/test/__init__.py +0 -19
  238. data/tools/logilab/logilab/astng/test/data/MyPyPa-0.1.0-py2.5.egg +0 -0
  239. data/tools/logilab/logilab/astng/test/data/MyPyPa-0.1.0-py2.5.zip +0 -0
  240. data/tools/logilab/logilab/astng/test/data/SSL1/Connection1.py +0 -33
  241. data/tools/logilab/logilab/astng/test/data/SSL1/__init__.py +0 -20
  242. data/tools/logilab/logilab/astng/test/data/__init__.py +0 -20
  243. data/tools/logilab/logilab/astng/test/data/all.py +0 -29
  244. data/tools/logilab/logilab/astng/test/data/appl/__init__.py +0 -23
  245. data/tools/logilab/logilab/astng/test/data/appl/myConnection.py +0 -30
  246. data/tools/logilab/logilab/astng/test/data/format.py +0 -34
  247. data/tools/logilab/logilab/astng/test/data/module.py +0 -90
  248. data/tools/logilab/logilab/astng/test/data/module2.py +0 -112
  249. data/tools/logilab/logilab/astng/test/data/noendingnewline.py +0 -57
  250. data/tools/logilab/logilab/astng/test/data/nonregr.py +0 -76
  251. data/tools/logilab/logilab/astng/test/data/notall.py +0 -28
  252. data/tools/logilab/logilab/astng/test/data2/__init__.py +0 -20
  253. data/tools/logilab/logilab/astng/test/data2/clientmodule_test.py +0 -51
  254. data/tools/logilab/logilab/astng/test/data2/suppliermodule_test.py +0 -32
  255. data/tools/logilab/logilab/astng/test/regrtest.py +0 -135
  256. data/tools/logilab/logilab/astng/test/regrtest_data/absimport.py +0 -22
  257. data/tools/logilab/logilab/astng/test/regrtest_data/descriptor_crash.py +0 -31
  258. data/tools/logilab/logilab/astng/test/regrtest_data/import_package_subpackage_module.py +0 -68
  259. data/tools/logilab/logilab/astng/test/regrtest_data/package/__init__.py +0 -24
  260. data/tools/logilab/logilab/astng/test/regrtest_data/package/subpackage/__init__.py +0 -20
  261. data/tools/logilab/logilab/astng/test/regrtest_data/package/subpackage/module.py +0 -20
  262. data/tools/logilab/logilab/astng/test/unittest_builder.py +0 -684
  263. data/tools/logilab/logilab/astng/test/unittest_inference.py +0 -1112
  264. data/tools/logilab/logilab/astng/test/unittest_inspector.py +0 -105
  265. data/tools/logilab/logilab/astng/test/unittest_lookup.py +0 -302
  266. data/tools/logilab/logilab/astng/test/unittest_manager.py +0 -98
  267. data/tools/logilab/logilab/astng/test/unittest_nodes.py +0 -302
  268. data/tools/logilab/logilab/astng/test/unittest_scoped_nodes.py +0 -501
  269. data/tools/logilab/logilab/astng/test/unittest_utils.py +0 -104
  270. data/tools/logilab/logilab/astng/utils.py +0 -342
  271. data/tools/logilab/logilab/common/__init__.py +0 -140
  272. data/tools/logilab/logilab/common/__pkginfo__.py +0 -43
  273. data/tools/logilab/logilab/common/adbh.py +0 -35
  274. data/tools/logilab/logilab/common/cache.py +0 -114
  275. data/tools/logilab/logilab/common/changelog.py +0 -234
  276. data/tools/logilab/logilab/common/clcommands.py +0 -181
  277. data/tools/logilab/logilab/common/cli.py +0 -212
  278. data/tools/logilab/logilab/common/compat.py +0 -328
  279. data/tools/logilab/logilab/common/configuration.py +0 -1087
  280. data/tools/logilab/logilab/common/contexts.py +0 -58
  281. data/tools/logilab/logilab/common/corbautils.py +0 -117
  282. data/tools/logilab/logilab/common/daemon.py +0 -171
  283. data/tools/logilab/logilab/common/date.py +0 -279
  284. data/tools/logilab/logilab/common/db.py +0 -49
  285. data/tools/logilab/logilab/common/dbf.py +0 -229
  286. data/tools/logilab/logilab/common/debugger.py +0 -208
  287. data/tools/logilab/logilab/common/decorators.py +0 -190
  288. data/tools/logilab/logilab/common/deprecation.py +0 -118
  289. data/tools/logilab/logilab/common/fileutils.py +0 -409
  290. data/tools/logilab/logilab/common/graph.py +0 -259
  291. data/tools/logilab/logilab/common/html.py +0 -142
  292. data/tools/logilab/logilab/common/interface.py +0 -76
  293. data/tools/logilab/logilab/common/logging_ext.py +0 -166
  294. data/tools/logilab/logilab/common/modutils.py +0 -670
  295. data/tools/logilab/logilab/common/optik_ext.py +0 -383
  296. data/tools/logilab/logilab/common/optparser.py +0 -92
  297. data/tools/logilab/logilab/common/pdf_ext.py +0 -111
  298. data/tools/logilab/logilab/common/proc.py +0 -276
  299. data/tools/logilab/logilab/common/pyro_ext.py +0 -146
  300. data/tools/logilab/logilab/common/pytest.py +0 -754
  301. data/tools/logilab/logilab/common/shellutils.py +0 -383
  302. data/tools/logilab/logilab/common/sphinx_ext.py +0 -87
  303. data/tools/logilab/logilab/common/sphinxutils.py +0 -122
  304. data/tools/logilab/logilab/common/sqlgen.py +0 -31
  305. data/tools/logilab/logilab/common/table.py +0 -930
  306. data/tools/logilab/logilab/common/tasksqueue.py +0 -97
  307. data/tools/logilab/logilab/common/test/__init__.py +0 -1
  308. data/tools/logilab/logilab/common/test/data/ChangeLog +0 -184
  309. data/tools/logilab/logilab/common/test/data/MyPyPa-0.1.0-py2.5.egg +0 -0
  310. data/tools/logilab/logilab/common/test/data/__init__.py +0 -1
  311. data/tools/logilab/logilab/common/test/data/content_differ_dir/NOTHING +0 -0
  312. data/tools/logilab/logilab/common/test/data/content_differ_dir/README +0 -1
  313. data/tools/logilab/logilab/common/test/data/content_differ_dir/subdir/coin +0 -1
  314. data/tools/logilab/logilab/common/test/data/content_differ_dir/subdir/toto.txt +0 -53
  315. data/tools/logilab/logilab/common/test/data/file_differ_dir/NOTHING +0 -0
  316. data/tools/logilab/logilab/common/test/data/file_differ_dir/README +0 -1
  317. data/tools/logilab/logilab/common/test/data/file_differ_dir/subdir/toto.txt +0 -53
  318. data/tools/logilab/logilab/common/test/data/file_differ_dir/subdirtwo/Hello +0 -0
  319. data/tools/logilab/logilab/common/test/data/find_test/__init__.py +0 -0
  320. data/tools/logilab/logilab/common/test/data/find_test/foo.txt +0 -0
  321. data/tools/logilab/logilab/common/test/data/find_test/module.py +0 -0
  322. data/tools/logilab/logilab/common/test/data/find_test/module2.py +0 -0
  323. data/tools/logilab/logilab/common/test/data/find_test/newlines.txt +0 -0
  324. data/tools/logilab/logilab/common/test/data/find_test/noendingnewline.py +0 -0
  325. data/tools/logilab/logilab/common/test/data/find_test/nonregr.py +0 -0
  326. data/tools/logilab/logilab/common/test/data/find_test/normal_file.txt +0 -0
  327. data/tools/logilab/logilab/common/test/data/find_test/spam.txt +0 -0
  328. data/tools/logilab/logilab/common/test/data/find_test/sub/doc.txt +0 -0
  329. data/tools/logilab/logilab/common/test/data/find_test/sub/momo.py +0 -0
  330. data/tools/logilab/logilab/common/test/data/find_test/test.ini +0 -0
  331. data/tools/logilab/logilab/common/test/data/find_test/test1.msg +0 -0
  332. data/tools/logilab/logilab/common/test/data/find_test/test2.msg +0 -0
  333. data/tools/logilab/logilab/common/test/data/find_test/write_protected_file.txt +0 -0
  334. data/tools/logilab/logilab/common/test/data/foo.txt +0 -9
  335. data/tools/logilab/logilab/common/test/data/module.py +0 -88
  336. data/tools/logilab/logilab/common/test/data/module2.py +0 -77
  337. data/tools/logilab/logilab/common/test/data/newlines.txt +0 -3
  338. data/tools/logilab/logilab/common/test/data/noendingnewline.py +0 -36
  339. data/tools/logilab/logilab/common/test/data/nonregr.py +0 -14
  340. data/tools/logilab/logilab/common/test/data/normal_file.txt +0 -0
  341. data/tools/logilab/logilab/common/test/data/reference_dir/NOTHING +0 -0
  342. data/tools/logilab/logilab/common/test/data/reference_dir/README +0 -1
  343. data/tools/logilab/logilab/common/test/data/reference_dir/subdir/coin +0 -1
  344. data/tools/logilab/logilab/common/test/data/reference_dir/subdir/toto.txt +0 -53
  345. data/tools/logilab/logilab/common/test/data/same_dir/NOTHING +0 -0
  346. data/tools/logilab/logilab/common/test/data/same_dir/README +0 -1
  347. data/tools/logilab/logilab/common/test/data/same_dir/subdir/coin +0 -1
  348. data/tools/logilab/logilab/common/test/data/same_dir/subdir/toto.txt +0 -53
  349. data/tools/logilab/logilab/common/test/data/spam.txt +0 -9
  350. data/tools/logilab/logilab/common/test/data/sub/doc.txt +0 -1
  351. data/tools/logilab/logilab/common/test/data/sub/momo.py +0 -1
  352. data/tools/logilab/logilab/common/test/data/subdir_differ_dir/NOTHING +0 -0
  353. data/tools/logilab/logilab/common/test/data/subdir_differ_dir/README +0 -1
  354. data/tools/logilab/logilab/common/test/data/subdir_differ_dir/subdir/coin +0 -1
  355. data/tools/logilab/logilab/common/test/data/subdir_differ_dir/subdir/toto.txt +0 -53
  356. data/tools/logilab/logilab/common/test/data/test.ini +0 -20
  357. data/tools/logilab/logilab/common/test/data/test1.msg +0 -30
  358. data/tools/logilab/logilab/common/test/data/test2.msg +0 -42
  359. data/tools/logilab/logilab/common/test/data/write_protected_file.txt +0 -0
  360. data/tools/logilab/logilab/common/test/foomod.py +0 -17
  361. data/tools/logilab/logilab/common/test/unittest_cache.py +0 -129
  362. data/tools/logilab/logilab/common/test/unittest_changelog.py +0 -37
  363. data/tools/logilab/logilab/common/test/unittest_compat.py +0 -239
  364. data/tools/logilab/logilab/common/test/unittest_configuration.py +0 -348
  365. data/tools/logilab/logilab/common/test/unittest_date.py +0 -154
  366. data/tools/logilab/logilab/common/test/unittest_decorators.py +0 -62
  367. data/tools/logilab/logilab/common/test/unittest_deprecation.py +0 -76
  368. data/tools/logilab/logilab/common/test/unittest_fileutils.py +0 -133
  369. data/tools/logilab/logilab/common/test/unittest_graph.py +0 -50
  370. data/tools/logilab/logilab/common/test/unittest_html.py +0 -76
  371. data/tools/logilab/logilab/common/test/unittest_interface.py +0 -87
  372. data/tools/logilab/logilab/common/test/unittest_modutils.py +0 -244
  373. data/tools/logilab/logilab/common/test/unittest_pytest.py +0 -50
  374. data/tools/logilab/logilab/common/test/unittest_shellutils.py +0 -248
  375. data/tools/logilab/logilab/common/test/unittest_table.py +0 -448
  376. data/tools/logilab/logilab/common/test/unittest_taskqueue.py +0 -71
  377. data/tools/logilab/logilab/common/test/unittest_testlib.py +0 -956
  378. data/tools/logilab/logilab/common/test/unittest_textutils.py +0 -247
  379. data/tools/logilab/logilab/common/test/unittest_tree.py +0 -248
  380. data/tools/logilab/logilab/common/test/unittest_umessage.py +0 -55
  381. data/tools/logilab/logilab/common/test/unittest_ureports_html.py +0 -64
  382. data/tools/logilab/logilab/common/test/unittest_ureports_text.py +0 -105
  383. data/tools/logilab/logilab/common/test/unittest_xmlutils.py +0 -75
  384. data/tools/logilab/logilab/common/test/utils.py +0 -87
  385. data/tools/logilab/logilab/common/testlib.py +0 -1927
  386. data/tools/logilab/logilab/common/textutils.py +0 -476
  387. data/tools/logilab/logilab/common/tree.py +0 -372
  388. data/tools/logilab/logilab/common/umessage.py +0 -161
  389. data/tools/logilab/logilab/common/ureports/__init__.py +0 -174
  390. data/tools/logilab/logilab/common/ureports/docbook_writer.py +0 -139
  391. data/tools/logilab/logilab/common/ureports/html_writer.py +0 -131
  392. data/tools/logilab/logilab/common/ureports/nodes.py +0 -201
  393. data/tools/logilab/logilab/common/ureports/text_writer.py +0 -140
  394. data/tools/logilab/logilab/common/vcgutils.py +0 -216
  395. data/tools/logilab/logilab/common/visitor.py +0 -107
  396. data/tools/logilab/logilab/common/xmlrpcutils.py +0 -136
  397. data/tools/logilab/logilab/common/xmlutils.py +0 -61
  398. data/tools/pychecker/COPYRIGHT +0 -31
  399. data/tools/pychecker/ChangeLog +0 -349
  400. data/tools/pychecker/CodeChecks.py +0 -1969
  401. data/tools/pychecker/CodeChecks.pyc +0 -0
  402. data/tools/pychecker/CodeChecks.pyo +0 -0
  403. data/tools/pychecker/Config.py +0 -475
  404. data/tools/pychecker/Config.pyc +0 -0
  405. data/tools/pychecker/Config.pyo +0 -0
  406. data/tools/pychecker/KNOWN_BUGS +0 -100
  407. data/tools/pychecker/MAINTAINERS +0 -81
  408. data/tools/pychecker/NEWS +0 -406
  409. data/tools/pychecker/OP.py +0 -131
  410. data/tools/pychecker/OP.pyc +0 -0
  411. data/tools/pychecker/OP.pyo +0 -0
  412. data/tools/pychecker/OptionTypes.py +0 -117
  413. data/tools/pychecker/OptionTypes.pyc +0 -0
  414. data/tools/pychecker/OptionTypes.pyo +0 -0
  415. data/tools/pychecker/README +0 -152
  416. data/tools/pychecker/Stack.py +0 -115
  417. data/tools/pychecker/Stack.pyc +0 -0
  418. data/tools/pychecker/Stack.pyo +0 -0
  419. data/tools/pychecker/TODO +0 -101
  420. data/tools/pychecker/VERSION +0 -1
  421. data/tools/pychecker/Warning.py +0 -50
  422. data/tools/pychecker/Warning.pyc +0 -0
  423. data/tools/pychecker/Warning.pyo +0 -0
  424. data/tools/pychecker/__init__.py +0 -17
  425. data/tools/pychecker/__init__.pyc +0 -0
  426. data/tools/pychecker/__init__.pyo +0 -0
  427. data/tools/pychecker/checker.py +0 -961
  428. data/tools/pychecker/checker.pyc +0 -0
  429. data/tools/pychecker/checker.pyo +0 -0
  430. data/tools/pychecker/function.py +0 -159
  431. data/tools/pychecker/function.pyc +0 -0
  432. data/tools/pychecker/function.pyo +0 -0
  433. data/tools/pychecker/msgs.py +0 -175
  434. data/tools/pychecker/msgs.pyc +0 -0
  435. data/tools/pychecker/msgs.pyo +0 -0
  436. data/tools/pychecker/options.py +0 -275
  437. data/tools/pychecker/options.pyc +0 -0
  438. data/tools/pychecker/options.pyo +0 -0
  439. data/tools/pychecker/pcmodules.py +0 -19
  440. data/tools/pychecker/pcmodules.pyc +0 -0
  441. data/tools/pychecker/pcmodules.pyo +0 -0
  442. data/tools/pychecker/printer.py +0 -47
  443. data/tools/pychecker/printer.pyc +0 -0
  444. data/tools/pychecker/printer.pyo +0 -0
  445. data/tools/pychecker/python.py +0 -427
  446. data/tools/pychecker/python.pyc +0 -0
  447. data/tools/pychecker/python.pyo +0 -0
  448. data/tools/pychecker/utils.py +0 -102
  449. data/tools/pychecker/utils.pyc +0 -0
  450. data/tools/pychecker/utils.pyo +0 -0
  451. data/tools/pychecker/warn.py +0 -778
  452. data/tools/pychecker/warn.pyc +0 -0
  453. data/tools/pychecker/warn.pyo +0 -0
  454. data/tools/pylint2/pylint/__init__.py +0 -16
  455. data/tools/pylint2/pylint/__pkginfo__.py +0 -67
  456. data/tools/pylint2/pylint/checkers/__init__.py +0 -155
  457. data/tools/pylint2/pylint/checkers/base.py +0 -749
  458. data/tools/pylint2/pylint/checkers/classes.py +0 -527
  459. data/tools/pylint2/pylint/checkers/design_analysis.py +0 -344
  460. data/tools/pylint2/pylint/checkers/exceptions.py +0 -183
  461. data/tools/pylint2/pylint/checkers/format.py +0 -367
  462. data/tools/pylint2/pylint/checkers/imports.py +0 -379
  463. data/tools/pylint2/pylint/checkers/logging.py +0 -98
  464. data/tools/pylint2/pylint/checkers/misc.py +0 -128
  465. data/tools/pylint2/pylint/checkers/newstyle.py +0 -107
  466. data/tools/pylint2/pylint/checkers/raw_metrics.py +0 -125
  467. data/tools/pylint2/pylint/checkers/similar.py +0 -333
  468. data/tools/pylint2/pylint/checkers/string_format.py +0 -239
  469. data/tools/pylint2/pylint/checkers/typecheck.py +0 -364
  470. data/tools/pylint2/pylint/checkers/utils.py +0 -208
  471. data/tools/pylint2/pylint/checkers/variables.py +0 -498
  472. data/tools/pylint2/pylint/config.py +0 -149
  473. data/tools/pylint2/pylint/epylint.py +0 -149
  474. data/tools/pylint2/pylint/gui.py +0 -433
  475. data/tools/pylint2/pylint/interfaces.py +0 -98
  476. data/tools/pylint2/pylint/lint.py +0 -914
  477. data/tools/pylint2/pylint/pyreverse/__init__.py +0 -5
  478. data/tools/pylint2/pylint/pyreverse/diadefslib.py +0 -229
  479. data/tools/pylint2/pylint/pyreverse/diagrams.py +0 -247
  480. data/tools/pylint2/pylint/pyreverse/main.py +0 -123
  481. data/tools/pylint2/pylint/pyreverse/utils.py +0 -131
  482. data/tools/pylint2/pylint/pyreverse/writer.py +0 -196
  483. data/tools/pylint2/pylint/reporters/__init__.py +0 -67
  484. data/tools/pylint2/pylint/reporters/guireporter.py +0 -36
  485. data/tools/pylint2/pylint/reporters/html.py +0 -69
  486. data/tools/pylint2/pylint/reporters/text.py +0 -156
  487. data/tools/pylint2/pylint/utils.py +0 -518
  488. data/tools/pylint2/pylint.py +0 -16
data/tools/epydoc/gui.py DELETED
@@ -1,1148 +0,0 @@
1
- #!/usr/bin/env python
2
- #
3
- # objdoc: epydoc command-line interface
4
- # Edward Loper
5
- #
6
- # Created [03/15/02 10:31 PM]
7
- # $Id: gui.py,v 1.1 2009/11/26 13:20:41 casa Exp $
8
- #
9
-
10
- """
11
- Graphical interface to epydoc. This interface might be useful for
12
- systems where it's inconvenient to use the command-line interface
13
- (such as Windows). It supports many (but not all) of the features
14
- that are supported by the command-line interface. It also supports
15
- loading and saving of X{project files}, which store a set of related
16
- modules, and the options that should be used to generate the
17
- documentation for those modules.
18
-
19
- Usage::
20
- epydocgui [OPTIONS] [FILE.prj | MODULES...]
21
-
22
- FILE.prj An epydoc GUI project file.
23
- MODULES... A list of Python modules to document.
24
- -V, --version Print the version of epydoc.
25
- -h, -?, --help, --usage Display this usage message
26
- --debug Do not suppress error messages
27
-
28
- @todo: Use ini-style project files, rather than pickles (using the
29
- same format as the CLI).
30
- """
31
- __docformat__ = 'epytext en'
32
-
33
- import sys, os.path, re, glob
34
- from Tkinter import *
35
- from tkFileDialog import askopenfilename, asksaveasfilename
36
- from thread import start_new_thread, exit_thread
37
- from pickle import dump, load
38
-
39
- # askdirectory is only defined in python 2.2+; fall back on
40
- # asksaveasfilename if it's not available.
41
- try: from tkFileDialog import askdirectory
42
- except: askdirectory = None
43
-
44
- # Include support for Zope, if it's available.
45
- try: import ZODB
46
- except: pass
47
-
48
- ##/////////////////////////////////////////////////////////////////////////
49
- ## CONSTANTS
50
- ##/////////////////////////////////////////////////////////////////////////
51
-
52
- DEBUG = 0
53
-
54
- # Colors for tkinter display
55
- BG_COLOR='#e0e0e0'
56
- ACTIVEBG_COLOR='#e0e0e0'
57
- TEXT_COLOR='black'
58
- ENTRYSELECT_COLOR = ACTIVEBG_COLOR
59
- SELECT_COLOR = '#208070'
60
- MESSAGE_COLOR = '#000060'
61
- ERROR_COLOR = '#600000'
62
- GUIERROR_COLOR = '#600000'
63
- WARNING_COLOR = '#604000'
64
- HEADER_COLOR = '#000000'
65
-
66
- # Convenience dictionaries for specifying widget colors
67
- COLOR_CONFIG = {'background':BG_COLOR, 'highlightcolor': BG_COLOR,
68
- 'foreground':TEXT_COLOR, 'highlightbackground': BG_COLOR}
69
- ENTRY_CONFIG = {'background':BG_COLOR, 'highlightcolor': BG_COLOR,
70
- 'foreground':TEXT_COLOR, 'highlightbackground': BG_COLOR,
71
- 'selectbackground': ENTRYSELECT_COLOR,
72
- 'selectforeground': TEXT_COLOR}
73
- SB_CONFIG = {'troughcolor':BG_COLOR, 'activebackground':BG_COLOR,
74
- 'background':BG_COLOR, 'highlightbackground':BG_COLOR}
75
- LISTBOX_CONFIG = {'highlightcolor': BG_COLOR, 'highlightbackground': BG_COLOR,
76
- 'foreground':TEXT_COLOR, 'selectforeground': TEXT_COLOR,
77
- 'selectbackground': ACTIVEBG_COLOR, 'background':BG_COLOR}
78
- BUTTON_CONFIG = {'background':BG_COLOR, 'highlightthickness':0, 'padx':4,
79
- 'highlightbackground': BG_COLOR, 'foreground':TEXT_COLOR,
80
- 'highlightcolor': BG_COLOR, 'activeforeground': TEXT_COLOR,
81
- 'activebackground': ACTIVEBG_COLOR, 'pady':0}
82
- CBUTTON_CONFIG = {'background':BG_COLOR, 'highlightthickness':0, 'padx':4,
83
- 'highlightbackground': BG_COLOR, 'foreground':TEXT_COLOR,
84
- 'highlightcolor': BG_COLOR, 'activeforeground': TEXT_COLOR,
85
- 'activebackground': ACTIVEBG_COLOR, 'pady':0,
86
- 'selectcolor': SELECT_COLOR}
87
- SHOWMSG_CONFIG = CBUTTON_CONFIG.copy()
88
- SHOWMSG_CONFIG['foreground'] = MESSAGE_COLOR
89
- SHOWWRN_CONFIG = CBUTTON_CONFIG.copy()
90
- SHOWWRN_CONFIG['foreground'] = WARNING_COLOR
91
- SHOWERR_CONFIG = CBUTTON_CONFIG.copy()
92
- SHOWERR_CONFIG['foreground'] = ERROR_COLOR
93
-
94
- # Colors for the progress bar
95
- PROGRESS_HEIGHT = 16
96
- PROGRESS_WIDTH = 200
97
- PROGRESS_BG='#305060'
98
- PROGRESS_COLOR1 = '#30c070'
99
- PROGRESS_COLOR2 = '#60ffa0'
100
- PROGRESS_COLOR3 = '#106030'
101
-
102
- # On tkinter canvases, where's the zero coordinate?
103
- if sys.platform.lower().startswith('win'):
104
- DX = 3; DY = 3
105
- DH = 0; DW = 7
106
- else:
107
- DX = 1; DY = 1
108
- DH = 1; DW = 3
109
-
110
- # How much of the progress is in each subtask?
111
- IMPORT_PROGRESS = 0.1
112
- BUILD_PROGRESS = 0.2
113
- WRITE_PROGRESS = 1.0 - BUILD_PROGRESS - IMPORT_PROGRESS
114
-
115
- ##/////////////////////////////////////////////////////////////////////////
116
- ## IMAGE CONSTANTS
117
- ##/////////////////////////////////////////////////////////////////////////
118
-
119
- UP_GIF = '''\
120
- R0lGODlhCwAMALMAANnZ2QDMmQCZZgBmZgAAAAAzM////////wAAAAAAAAAAAAAAAAAAAAAAAAAA
121
- AAAAACH5BAEAAAAALAAAAAALAAwAAAQjEMhJKxCW4gzCIJxXZIEwFGDlDadqsii1sq1U0nA64+ON
122
- 5xEAOw==
123
- '''
124
- DOWN_GIF = '''\
125
- R0lGODlhCwAMALMAANnZ2QDMmQCZZgBmZgAAAAAzM////////wAAAAAAAAAAAAAAAAAAAAAAAAAA
126
- AAAAACH5BAEAAAAALAAAAAALAAwAAAQmEIQxgLVUCsppsVPngVtXEFfIfWk5nBe4xuSL0tKLy/cu
127
- 7JffJQIAOw==
128
- '''
129
- LEFT_GIF='''\
130
- R0lGODlhDAALAKIAANnZ2QDMmQCZZgBmZgAAAAAzM////////yH5BAEAAAAALAAAAAAMAAsAAAM4
131
- CLocgaCrESiDoBshOAoAgBEyMzgAEIGCowsiOLoLgEBVOLoIqlSFo4OgC1RYM4Ogq1RYg6DLVJgA
132
- Ow==
133
- '''
134
- RIGHT_GIF='''\
135
- R0lGODlhDAALAKIAANnZ2QDMmQBmZgCZZgAzMwAAAP///////yH5BAEAAAAALAAAAAAMAAsAAAM5
136
- GIGgyzIYgaCrIigTgaALIigyEQiqKLoTgaAoujuDgKJLVAgqIoJEBQAIIkKEhaArRFgIukqFoMsJ
137
- ADs=
138
- '''
139
-
140
- ##/////////////////////////////////////////////////////////////////////////
141
- ## MessageIO
142
- ##/////////////////////////////////////////////////////////////////////////
143
-
144
- from epydoc import log
145
- from epydoc.util import wordwrap
146
- class GUILogger(log.Logger):
147
- _STAGES = [40, 7, 1, 3, 1, 30, 1, 2, 100]
148
-
149
- def __init__(self, progress, cancel):
150
- self._progress = progress
151
- self._cancel = cancel
152
- self.clear()
153
-
154
- def clear(self):
155
- self._messages = []
156
- self._n = 0
157
- self._stage = 0
158
- self._message_blocks = []
159
-
160
- def log(self, level, message):
161
- message = wordwrap(str(message)).rstrip() + '\n'
162
- if self._message_blocks:
163
- self._message_blocks[-1][-1].append( (level, message) )
164
- else:
165
- self._messages.append( (level, message) )
166
-
167
- def start_block(self, header):
168
- self._message_blocks.append( (header, []) )
169
-
170
- def end_block(self):
171
- header, messages = self._message_blocks.pop()
172
- if messages:
173
- self._messages.append( ('uline', ' '*75+'\n') )
174
- self.log('header', header)
175
- self._messages += messages
176
- self._messages.append( ('uline', ' '*75+'\n') )
177
-
178
- def start_progress(self, header=None):
179
- self.log(log.INFO, header)
180
- self._stage += 1
181
-
182
- def end_progress(self):
183
- pass
184
-
185
- def progress(self, percent, message=''):
186
- if self._cancel[0]: exit_thread()
187
- i = self._stage - 1
188
- p = ((sum(self._STAGES[:i]) + percent*self._STAGES[i]) /
189
- float(sum(self._STAGES)))
190
- self._progress[0] = p
191
-
192
- def read(self):
193
- if self._n >= len(self._messages):
194
- return None, None
195
- else:
196
- self._n += 1
197
- return self._messages[self._n-1]
198
-
199
- ##/////////////////////////////////////////////////////////////////////////
200
- ## THREADED DOCUMENTER
201
- ##/////////////////////////////////////////////////////////////////////////
202
-
203
- def document(options, cancel, done):
204
- """
205
- Create the documentation for C{modules}, using the options
206
- specified by C{options}. C{document} is designed to be started in
207
- its own thread by L{EpydocGUI._go}.
208
-
209
- @param options: The options to use for generating documentation.
210
- This includes keyword options that can be given to
211
- L{docwriter.html.HTMLWriter}, as well as the option C{target}, which
212
- controls where the output is written to.
213
- @type options: C{dictionary}
214
- """
215
- from epydoc.docwriter.html import HTMLWriter
216
- from epydoc.docbuilder import build_doc_index
217
- import epydoc.docstringparser
218
-
219
- # Set the default docformat.
220
- docformat = options.get('docformat', 'epytext')
221
- epydoc.docstringparser.DEFAULT_DOCFORMAT = docformat
222
-
223
- try:
224
- parse = options['introspect_or_parse'] in ('parse', 'both')
225
- introspect = options['introspect_or_parse'] in ('introspect', 'both')
226
- docindex = build_doc_index(options['modules'], parse, introspect)
227
- html_writer = HTMLWriter(docindex, **options)
228
- log.start_progress('Writing HTML docs to %r' % options['target'])
229
- html_writer.write(options['target'])
230
- log.end_progress()
231
-
232
- # We're done.
233
- log.warning('Finished!')
234
- done[0] = 'done'
235
-
236
- except SystemExit:
237
- # Cancel.
238
- log.error('Cancelled!')
239
- done[0] ='cancel'
240
- raise
241
- except Exception, e:
242
- # We failed.
243
- log.error('Internal error: %s' % e)
244
- done[0] ='cancel'
245
- raise
246
- except:
247
- # We failed.
248
- log.error('Internal error!')
249
- done[0] ='cancel'
250
- raise
251
-
252
- ##/////////////////////////////////////////////////////////////////////////
253
- ## GUI
254
- ##/////////////////////////////////////////////////////////////////////////
255
-
256
- class EpydocGUI:
257
- """
258
- A graphical user interace to epydoc.
259
- """
260
- def __init__(self):
261
- self._afterid = 0
262
- self._progress = [None]
263
- self._cancel = [0]
264
- self._filename = None
265
- self._init_dir = None
266
-
267
- # Store a copy of sys.modules, so that we can restore it
268
- # later. This is useful for making sure that we reload
269
- # everything when we re-build its documentation. This will
270
- # *not* reload the modules that are present when the EpydocGUI
271
- # is created, but that should only contain some builtins, some
272
- # epydoc modules, Tkinter, pickle, and thread..
273
- self._old_modules = sys.modules.keys()
274
-
275
- # Create the main window.
276
- self._root = Tk()
277
- self._root['background']=BG_COLOR
278
- self._root.bind('<Control-q>', self.destroy)
279
- self._root.bind('<Alt-q>', self.destroy)
280
- self._root.bind('<Alt-x>', self.destroy)
281
- self._root.bind('<Control-x>', self.destroy)
282
- #self._root.bind('<Control-d>', self.destroy)
283
- self._root.title('Epydoc')
284
- self._rootframe = Frame(self._root, background=BG_COLOR,
285
- border=2, relief='raised')
286
- self._rootframe.pack(expand=1, fill='both', padx=2, pady=2)
287
-
288
- # Set up the basic frames. Do not pack the options frame or
289
- # the messages frame; the GUI has buttons to expand them.
290
- leftframe = Frame(self._rootframe, background=BG_COLOR)
291
- leftframe.pack(expand=1, fill='both', side='left')
292
- optsframe = Frame(self._rootframe, background=BG_COLOR)
293
- mainframe = Frame(leftframe, background=BG_COLOR)
294
- mainframe.pack(expand=1, fill='both', side='top')
295
- ctrlframe = Frame(mainframe, background=BG_COLOR)
296
- ctrlframe.pack(side="bottom", fill='x', expand=0)
297
- msgsframe = Frame(leftframe, background=BG_COLOR)
298
-
299
- self._optsframe = optsframe
300
- self._msgsframe = msgsframe
301
-
302
- # Initialize all the frames, etc.
303
- self._init_menubar()
304
- self._init_progress_bar(mainframe)
305
- self._init_module_list(mainframe)
306
- self._init_options(optsframe, ctrlframe)
307
- self._init_messages(msgsframe, ctrlframe)
308
- self._init_bindings()
309
-
310
- # Set up logging
311
- self._logger = GUILogger(self._progress, self._cancel)
312
- log.register_logger(self._logger)
313
-
314
- # Open the messages pane by default.
315
- self._messages_toggle()
316
-
317
- ## For testing options:
318
- #self._options_toggle()
319
-
320
- def _init_menubar(self):
321
- menubar = Menu(self._root, borderwidth=2,
322
- background=BG_COLOR,
323
- activebackground=BG_COLOR)
324
- filemenu = Menu(menubar, tearoff=0)
325
- filemenu.add_command(label='New Project', underline=0,
326
- command=self._new,
327
- accelerator='Ctrl-n')
328
- filemenu.add_command(label='Open Project', underline=0,
329
- command=self._open,
330
- accelerator='Ctrl-o')
331
- filemenu.add_command(label='Save Project', underline=0,
332
- command=self._save,
333
- accelerator='Ctrl-s')
334
- filemenu.add_command(label='Save As..', underline=5,
335
- command=self._saveas,
336
- accelerator='Ctrl-a')
337
- filemenu.add_separator()
338
- filemenu.add_command(label='Exit', underline=1,
339
- command=self.destroy,
340
- accelerator='Ctrl-x')
341
- menubar.add_cascade(label='File', underline=0, menu=filemenu)
342
- gomenu = Menu(menubar, tearoff=0)
343
- gomenu.add_command(label='Run Epydoc', command=self._open,
344
- underline=0, accelerator='Alt-g')
345
- menubar.add_cascade(label='Run', menu=gomenu, underline=0)
346
- self._root.config(menu=menubar)
347
-
348
- def _init_module_list(self, mainframe):
349
- mframe1 = Frame(mainframe, relief='groove', border=2,
350
- background=BG_COLOR)
351
- mframe1.pack(side="top", fill='both', expand=1, padx=4, pady=3)
352
- l = Label(mframe1, text="Modules to document:",
353
- justify='left', **COLOR_CONFIG)
354
- l.pack(side='top', fill='none', anchor='nw', expand=0)
355
- mframe2 = Frame(mframe1, background=BG_COLOR)
356
- mframe2.pack(side="top", fill='both', expand=1)
357
- mframe3 = Frame(mframe1, background=BG_COLOR)
358
- mframe3.pack(side="bottom", fill='x', expand=0)
359
- self._module_list = Listbox(mframe2, width=80, height=10,
360
- selectmode='multiple',
361
- **LISTBOX_CONFIG)
362
- self._module_list.pack(side="left", fill='both', expand=1)
363
- sb = Scrollbar(mframe2, orient='vertical',**SB_CONFIG)
364
- sb['command']=self._module_list.yview
365
- sb.pack(side='right', fill='y')
366
- self._module_list.config(yscrollcommand=sb.set)
367
- Label(mframe3, text="Add:", **COLOR_CONFIG).pack(side='left')
368
- self._module_entry = Entry(mframe3, **ENTRY_CONFIG)
369
- self._module_entry.pack(side='left', fill='x', expand=1)
370
- self._module_entry.bind('<Return>', self._entry_module)
371
- self._module_delete = Button(mframe3, text="Remove",
372
- command=self._delete_module,
373
- **BUTTON_CONFIG)
374
- self._module_delete.pack(side='right', expand=0, padx=2)
375
- self._module_browse = Button(mframe3, text="Browse",
376
- command=self._browse_module,
377
- **BUTTON_CONFIG)
378
- self._module_browse.pack(side='right', expand=0, padx=2)
379
-
380
- def _init_progress_bar(self, mainframe):
381
- pframe1 = Frame(mainframe, background=BG_COLOR)
382
- pframe1.pack(side="bottom", fill='x', expand=0)
383
- self._go_button = Button(pframe1, width=4, text='Start',
384
- underline=0, command=self._go,
385
- **BUTTON_CONFIG)
386
- self._go_button.pack(side='left', padx=4)
387
- pframe2 = Frame(pframe1, relief='groove', border=2,
388
- background=BG_COLOR)
389
- pframe2.pack(side="top", fill='x', expand=1, padx=4, pady=3)
390
- Label(pframe2, text='Progress:', **COLOR_CONFIG).pack(side='left')
391
- H = self._H = PROGRESS_HEIGHT
392
- W = self._W = PROGRESS_WIDTH
393
- c = self._canvas = Canvas(pframe2, height=H+DH, width=W+DW,
394
- background=PROGRESS_BG, border=0,
395
- selectborderwidth=0, relief='sunken',
396
- insertwidth=0, insertborderwidth=0,
397
- highlightbackground=BG_COLOR)
398
- self._canvas.pack(side='left', fill='x', expand=1, padx=4)
399
- self._r2 = c.create_rectangle(0,0,0,0, outline=PROGRESS_COLOR2)
400
- self._r3 = c.create_rectangle(0,0,0,0, outline=PROGRESS_COLOR3)
401
- self._r1 = c.create_rectangle(0,0,0,0, fill=PROGRESS_COLOR1,
402
- outline='')
403
- self._canvas.bind('<Configure>', self._configure)
404
-
405
- def _init_messages(self, msgsframe, ctrlframe):
406
- self._downImage = PhotoImage(master=self._root, data=DOWN_GIF)
407
- self._upImage = PhotoImage(master=self._root, data=UP_GIF)
408
-
409
- # Set up the messages control frame
410
- b1 = Button(ctrlframe, text="Messages", justify='center',
411
- command=self._messages_toggle, underline=0,
412
- highlightthickness=0, activebackground=BG_COLOR,
413
- border=0, relief='flat', padx=2, pady=0, **COLOR_CONFIG)
414
- b2 = Button(ctrlframe, image=self._downImage, relief='flat',
415
- border=0, command=self._messages_toggle,
416
- activebackground=BG_COLOR, **COLOR_CONFIG)
417
- self._message_button = b2
418
- self._messages_visible = 0
419
- b2.pack(side="left")
420
- b1.pack(side="left")
421
-
422
- f = Frame(msgsframe, background=BG_COLOR)
423
- f.pack(side='top', expand=1, fill='both')
424
- messages = Text(f, width=80, height=10, **ENTRY_CONFIG)
425
- messages['state'] = 'disabled'
426
- messages.pack(fill='both', expand=1, side='left')
427
- self._messages = messages
428
-
429
- # Add a scrollbar
430
- sb = Scrollbar(f, orient='vertical', **SB_CONFIG)
431
- sb.pack(fill='y', side='right')
432
- sb['command'] = messages.yview
433
- messages['yscrollcommand'] = sb.set
434
-
435
- # Set up some colorization tags
436
- messages.tag_config('error', foreground=ERROR_COLOR)
437
- messages.tag_config('warning', foreground=WARNING_COLOR)
438
- messages.tag_config('guierror', foreground=GUIERROR_COLOR)
439
- messages.tag_config('message', foreground=MESSAGE_COLOR)
440
- messages.tag_config('header', foreground=HEADER_COLOR)
441
- messages.tag_config('uline', underline=1)
442
-
443
- # Keep track of tag state..
444
- self._in_header = 0
445
- self._last_tag = 'error'
446
-
447
- # Add some buttons
448
- buttons = Frame(msgsframe, background=BG_COLOR)
449
- buttons.pack(side='bottom', fill='x')
450
- self._show_errors = IntVar(self._root)
451
- self._show_errors.set(1)
452
- self._show_warnings = IntVar(self._root)
453
- self._show_warnings.set(1)
454
- self._show_messages = IntVar(self._root)
455
- self._show_messages.set(0)
456
- Checkbutton(buttons, text='Show Messages', var=self._show_messages,
457
- command=self._update_msg_tags,
458
- **SHOWMSG_CONFIG).pack(side='left')
459
- Checkbutton(buttons, text='Show Warnings', var=self._show_warnings,
460
- command=self._update_msg_tags,
461
- **SHOWWRN_CONFIG).pack(side='left')
462
- Checkbutton(buttons, text='Show Errors', var=self._show_errors,
463
- command=self._update_msg_tags,
464
- **SHOWERR_CONFIG).pack(side='left')
465
- self._update_msg_tags()
466
-
467
- def _update_msg_tags(self, *e):
468
- elide_errors = not self._show_errors.get()
469
- elide_warnings = not self._show_warnings.get()
470
- elide_messages = not self._show_messages.get()
471
- elide_headers = elide_errors and elide_warnings
472
- self._messages.tag_config('error', elide=elide_errors)
473
- self._messages.tag_config('guierror', elide=elide_errors)
474
- self._messages.tag_config('warning', elide=elide_warnings)
475
- self._messages.tag_config('message', elide=elide_messages)
476
- self._messages.tag_config('header', elide=elide_headers)
477
-
478
- def _init_options(self, optsframe, ctrlframe):
479
- self._leftImage=PhotoImage(master=self._root, data=LEFT_GIF)
480
- self._rightImage=PhotoImage(master=self._root, data=RIGHT_GIF)
481
-
482
- # Set up the options control frame
483
- b1 = Button(ctrlframe, text="Options", justify='center',
484
- border=0, relief='flat',
485
- command=self._options_toggle, padx=2,
486
- underline=0, pady=0, highlightthickness=0,
487
- activebackground=BG_COLOR, **COLOR_CONFIG)
488
- b2 = Button(ctrlframe, image=self._rightImage, relief='flat',
489
- border=0, command=self._options_toggle,
490
- activebackground=BG_COLOR, **COLOR_CONFIG)
491
- self._option_button = b2
492
- self._options_visible = 0
493
- b2.pack(side="right")
494
- b1.pack(side="right")
495
-
496
- oframe2 = Frame(optsframe, relief='groove', border=2,
497
- background=BG_COLOR)
498
- oframe2.pack(side="right", fill='both',
499
- expand=0, padx=4, pady=3, ipadx=4)
500
-
501
- Label(oframe2, text="Project Options", font='helvetica -16',
502
- **COLOR_CONFIG).pack(anchor='w')
503
- oframe3 = Frame(oframe2, background=BG_COLOR)
504
- oframe3.pack(fill='x')
505
- oframe4 = Frame(oframe2, background=BG_COLOR)
506
- oframe4.pack(fill='x')
507
- oframe7 = Frame(oframe2, background=BG_COLOR)
508
- oframe7.pack(fill='x')
509
- div = Frame(oframe2, background=BG_COLOR, border=1, relief='sunk')
510
- div.pack(ipady=1, fill='x', padx=4, pady=2)
511
-
512
- Label(oframe2, text="Help File", font='helvetica -16',
513
- **COLOR_CONFIG).pack(anchor='w')
514
- oframe5 = Frame(oframe2, background=BG_COLOR)
515
- oframe5.pack(fill='x')
516
- div = Frame(oframe2, background=BG_COLOR, border=1, relief='sunk')
517
- div.pack(ipady=1, fill='x', padx=4, pady=2)
518
-
519
- Label(oframe2, text="CSS Stylesheet", font='helvetica -16',
520
- **COLOR_CONFIG).pack(anchor='w')
521
- oframe6 = Frame(oframe2, background=BG_COLOR)
522
- oframe6.pack(fill='x')
523
-
524
- #==================== oframe3 ====================
525
- # -n NAME, --name NAME
526
- row = 0
527
- l = Label(oframe3, text="Project Name:", **COLOR_CONFIG)
528
- l.grid(row=row, column=0, sticky='e')
529
- self._name_entry = Entry(oframe3, **ENTRY_CONFIG)
530
- self._name_entry.grid(row=row, column=1, sticky='ew', columnspan=3)
531
-
532
- # -u URL, --url URL
533
- row += 1
534
- l = Label(oframe3, text="Project URL:", **COLOR_CONFIG)
535
- l.grid(row=row, column=0, sticky='e')
536
- self._url_entry = Entry(oframe3, **ENTRY_CONFIG)
537
- self._url_entry.grid(row=row, column=1, sticky='ew', columnspan=3)
538
-
539
- # -o DIR, --output DIR
540
- row += 1
541
- l = Label(oframe3, text="Output Directory:", **COLOR_CONFIG)
542
- l.grid(row=row, column=0, sticky='e')
543
- self._out_entry = Entry(oframe3, **ENTRY_CONFIG)
544
- self._out_entry.grid(row=row, column=1, sticky='ew', columnspan=2)
545
- self._out_browse = Button(oframe3, text="Browse",
546
- command=self._browse_out,
547
- **BUTTON_CONFIG)
548
- self._out_browse.grid(row=row, column=3, sticky='ew', padx=2)
549
-
550
- #==================== oframe4 ====================
551
- # --no-frames
552
- row = 0
553
- self._frames_var = IntVar(self._root)
554
- self._frames_var.set(1)
555
- l = Label(oframe4, text="Generate a frame-based table of contents",
556
- **COLOR_CONFIG)
557
- l.grid(row=row, column=1, sticky='w')
558
- cb = Checkbutton(oframe4, var=self._frames_var, **CBUTTON_CONFIG)
559
- cb.grid(row=row, column=0, sticky='e')
560
-
561
- # --no-private
562
- row += 1
563
- self._private_var = IntVar(self._root)
564
- self._private_var.set(1)
565
- l = Label(oframe4, text="Generate documentation for private objects",
566
- **COLOR_CONFIG)
567
- l.grid(row=row, column=1, sticky='w')
568
- cb = Checkbutton(oframe4, var=self._private_var, **CBUTTON_CONFIG)
569
- cb.grid(row=row, column=0, sticky='e')
570
-
571
- # --show-imports
572
- row += 1
573
- self._imports_var = IntVar(self._root)
574
- self._imports_var.set(0)
575
- l = Label(oframe4, text="List imported classes and functions",
576
- **COLOR_CONFIG)
577
- l.grid(row=row, column=1, sticky='w')
578
- cb = Checkbutton(oframe4, var=self._imports_var, **CBUTTON_CONFIG)
579
- cb.grid(row=row, column=0, sticky='e')
580
-
581
- #==================== oframe7 ====================
582
- # --docformat
583
- row += 1
584
- l = Label(oframe7, text="Default Docformat:", **COLOR_CONFIG)
585
- l.grid(row=row, column=0, sticky='e')
586
- df_var = self._docformat_var = StringVar(self._root)
587
- self._docformat_var.set('epytext')
588
- b = Radiobutton(oframe7, var=df_var, text='Epytext',
589
- value='epytext', **CBUTTON_CONFIG)
590
- b.grid(row=row, column=1, sticky='w')
591
- b = Radiobutton(oframe7, var=df_var, text='ReStructuredText',
592
- value='restructuredtext', **CBUTTON_CONFIG)
593
- b.grid(row=row, column=2, columnspan=2, sticky='w')
594
- row += 1
595
- b = Radiobutton(oframe7, var=df_var, text='Plaintext',
596
- value='plaintext', **CBUTTON_CONFIG)
597
- b.grid(row=row, column=1, sticky='w')
598
- b = Radiobutton(oframe7, var=df_var, text='Javadoc',
599
- value='javadoc', **CBUTTON_CONFIG)
600
- b.grid(row=row, column=2, columnspan=2, sticky='w')
601
- row += 1
602
-
603
- # Separater
604
- Frame(oframe7, background=BG_COLOR).grid(row=row, column=1, pady=3)
605
- row += 1
606
-
607
- # --inheritance
608
- l = Label(oframe7, text="Inheritance Style:", **COLOR_CONFIG)
609
- l.grid(row=row, column=0, sticky='e')
610
- inh_var = self._inheritance_var = StringVar(self._root)
611
- self._inheritance_var.set('grouped')
612
- b = Radiobutton(oframe7, var=inh_var, text='Grouped',
613
- value='grouped', **CBUTTON_CONFIG)
614
- b.grid(row=row, column=1, sticky='w')
615
- b = Radiobutton(oframe7, var=inh_var, text='Listed',
616
- value='listed', **CBUTTON_CONFIG)
617
- b.grid(row=row, column=2, sticky='w')
618
- b = Radiobutton(oframe7, var=inh_var, text='Included',
619
- value='included', **CBUTTON_CONFIG)
620
- b.grid(row=row, column=3, sticky='w')
621
- row += 1
622
-
623
- # Separater
624
- Frame(oframe7, background=BG_COLOR).grid(row=row, column=1, pady=3)
625
- row += 1
626
-
627
- # --parse-only, --introspect-only
628
- l = Label(oframe7, text="Get docs from:", **COLOR_CONFIG)
629
- l.grid(row=row, column=0, sticky='e')
630
- iop_var = self._introspect_or_parse_var = StringVar(self._root)
631
- self._introspect_or_parse_var.set('both')
632
- b = Radiobutton(oframe7, var=iop_var, text='Parsing',
633
- value='parse', **CBUTTON_CONFIG)
634
- b.grid(row=row, column=1, sticky='w')
635
- b = Radiobutton(oframe7, var=iop_var, text='Introspecting',
636
- value='introspect', **CBUTTON_CONFIG)
637
- b.grid(row=row, column=2, sticky='w')
638
- b = Radiobutton(oframe7, var=iop_var, text='Both',
639
- value='both', **CBUTTON_CONFIG)
640
- b.grid(row=row, column=3, sticky='w')
641
- row += 1
642
-
643
- #==================== oframe5 ====================
644
- # --help-file FILE
645
- row = 0
646
- self._help_var = StringVar(self._root)
647
- self._help_var.set('default')
648
- b = Radiobutton(oframe5, var=self._help_var,
649
- text='Default',
650
- value='default', **CBUTTON_CONFIG)
651
- b.grid(row=row, column=1, sticky='w')
652
- row += 1
653
- b = Radiobutton(oframe5, var=self._help_var,
654
- text='Select File',
655
- value='-other-', **CBUTTON_CONFIG)
656
- b.grid(row=row, column=1, sticky='w')
657
- self._help_entry = Entry(oframe5, **ENTRY_CONFIG)
658
- self._help_entry.grid(row=row, column=2, sticky='ew')
659
- self._help_browse = Button(oframe5, text='Browse',
660
- command=self._browse_help,
661
- **BUTTON_CONFIG)
662
- self._help_browse.grid(row=row, column=3, sticky='ew', padx=2)
663
-
664
- from epydoc.docwriter.html_css import STYLESHEETS
665
- items = STYLESHEETS.items()
666
- def _css_sort(css1, css2):
667
- if css1[0] == 'default': return -1
668
- elif css2[0] == 'default': return 1
669
- else: return cmp(css1[0], css2[0])
670
- items.sort(_css_sort)
671
-
672
- #==================== oframe6 ====================
673
- # -c CSS, --css CSS
674
- # --private-css CSS
675
- row = 0
676
- #l = Label(oframe6, text="Public", **COLOR_CONFIG)
677
- #l.grid(row=row, column=0, sticky='e')
678
- #l = Label(oframe6, text="Private", **COLOR_CONFIG)
679
- #l.grid(row=row, column=1, sticky='w')
680
- row += 1
681
- css_var = self._css_var = StringVar(self._root)
682
- css_var.set('default')
683
- #private_css_var = self._private_css_var = StringVar(self._root)
684
- #private_css_var.set('default')
685
- for (name, (sheet, descr)) in items:
686
- b = Radiobutton(oframe6, var=css_var, value=name, **CBUTTON_CONFIG)
687
- b.grid(row=row, column=0, sticky='e')
688
- #b = Radiobutton(oframe6, var=private_css_var, value=name,
689
- # text=name, **CBUTTON_CONFIG)
690
- #b.grid(row=row, column=1, sticky='w')
691
- l = Label(oframe6, text=descr, **COLOR_CONFIG)
692
- l.grid(row=row, column=1, sticky='w')
693
- row += 1
694
- b = Radiobutton(oframe6, var=css_var, value='-other-',
695
- **CBUTTON_CONFIG)
696
- b.grid(row=row, column=0, sticky='e')
697
- #b = Radiobutton(oframe6, text='Select File', var=private_css_var,
698
- # value='-other-', **CBUTTON_CONFIG)
699
- #b.grid(row=row, column=1, sticky='w')
700
- #l = Label(oframe6, text='Select File', **COLOR_CONFIG)
701
- #l.grid(row=row, column=1, sticky='w')
702
- self._css_entry = Entry(oframe6, **ENTRY_CONFIG)
703
- self._css_entry.grid(row=row, column=1, sticky='ew')
704
- self._css_browse = Button(oframe6, text="Browse",
705
- command=self._browse_css,
706
- **BUTTON_CONFIG)
707
- self._css_browse.grid(row=row, column=2, sticky='ew', padx=2)
708
-
709
- def _init_bindings(self):
710
- self._root.bind('<Delete>', self._delete_module)
711
- self._root.bind('<Alt-o>', self._options_toggle)
712
- self._root.bind('<Alt-m>', self._messages_toggle)
713
- self._root.bind('<F5>', self._go)
714
- self._root.bind('<Alt-s>', self._go)
715
-
716
- self._root.bind('<Control-n>', self._new)
717
- self._root.bind('<Control-o>', self._open)
718
- self._root.bind('<Control-s>', self._save)
719
- self._root.bind('<Control-a>', self._saveas)
720
-
721
- def _options_toggle(self, *e):
722
- if self._options_visible:
723
- self._optsframe.forget()
724
- self._option_button['image'] = self._rightImage
725
- self._options_visible = 0
726
- else:
727
- self._optsframe.pack(fill='both', side='right')
728
- self._option_button['image'] = self._leftImage
729
- self._options_visible = 1
730
-
731
- def _messages_toggle(self, *e):
732
- if self._messages_visible:
733
- self._msgsframe.forget()
734
- self._message_button['image'] = self._rightImage
735
- self._messages_visible = 0
736
- else:
737
- self._msgsframe.pack(fill='both', side='bottom', expand=1)
738
- self._message_button['image'] = self._leftImage
739
- self._messages_visible = 1
740
-
741
- def _configure(self, event):
742
- self._W = event.width-DW
743
-
744
- def _delete_module(self, *e):
745
- selection = self._module_list.curselection()
746
- if len(selection) != 1: return
747
- self._module_list.delete(selection[0])
748
-
749
- def _entry_module(self, *e):
750
- modules = [self._module_entry.get()]
751
- if glob.has_magic(modules[0]):
752
- modules = glob.glob(modules[0])
753
- for name in modules:
754
- self.add_module(name, check=1)
755
- self._module_entry.delete(0, 'end')
756
-
757
- def _browse_module(self, *e):
758
- title = 'Select a module for documentation'
759
- ftypes = [('Python module', '.py'),
760
- ('Python extension', '.so'),
761
- ('All files', '*')]
762
- filename = askopenfilename(filetypes=ftypes, title=title,
763
- defaultextension='.py',
764
- initialdir=self._init_dir)
765
- if not filename: return
766
- self._init_dir = os.path.dirname(filename)
767
- self.add_module(filename, check=1)
768
-
769
- def _browse_css(self, *e):
770
- title = 'Select a CSS stylesheet'
771
- ftypes = [('CSS Stylesheet', '.css'), ('All files', '*')]
772
- filename = askopenfilename(filetypes=ftypes, title=title,
773
- defaultextension='.css')
774
- if not filename: return
775
- self._css_entry.delete(0, 'end')
776
- self._css_entry.insert(0, filename)
777
-
778
- def _browse_help(self, *e):
779
- title = 'Select a help file'
780
- self._help_var.set('-other-')
781
- ftypes = [('HTML file', '.html'), ('All files', '*')]
782
- filename = askopenfilename(filetypes=ftypes, title=title,
783
- defaultextension='.html')
784
- if not filename: return
785
- self._help_entry.delete(0, 'end')
786
- self._help_entry.insert(0, filename)
787
-
788
- def _browse_out(self, *e):
789
- ftypes = [('All files', '*')]
790
- title = 'Choose the output directory'
791
- if askdirectory is not None:
792
- filename = askdirectory(mustexist=0, title=title)
793
- if not filename: return
794
- else:
795
- # Hack for Python 2.1 or earlier:
796
- filename = asksaveasfilename(filetypes=ftypes, title=title,
797
- initialfile='--this directory--')
798
- if not filename: return
799
- (f1, f2) = os.path.split(filename)
800
- if f2 == '--this directory--': filename = f1
801
- self._out_entry.delete(0, 'end')
802
- self._out_entry.insert(0, filename)
803
-
804
- def destroy(self, *e):
805
- if self._root is None: return
806
-
807
- # Unload any modules that we've imported
808
- for m in sys.modules.keys():
809
- if m not in self._old_modules: del sys.modules[m]
810
- self._root.destroy()
811
- self._root = None
812
-
813
- def add_module(self, name, check=0):
814
- from epydoc.util import is_package_dir, is_pyname, is_module_file
815
- from epydoc.docintrospecter import get_value_from_name
816
- from epydoc.docintrospecter import get_value_from_filename
817
-
818
- if (os.path.isfile(name) or is_package_dir(name) or is_pyname(name)):
819
- # Check that it's a good module, if requested.
820
- if check:
821
- try:
822
- if is_module_file(name) or is_package_dir(name):
823
- get_value_from_filename(name)
824
- elif os.path.isfile(name):
825
- get_value_from_scriptname(name)
826
- else:
827
- get_value_from_name(name)
828
- except ImportError, e:
829
- log.error(e)
830
- self._update_messages()
831
- self._root.bell()
832
- return
833
-
834
- # Add the module to the list of modules.
835
- self._module_list.insert('end', name)
836
- self._module_list.yview('end')
837
- else:
838
- log.error("Couldn't find %r" % name)
839
- self._update_messages()
840
- self._root.bell()
841
-
842
- def mainloop(self, *args, **kwargs):
843
- self._root.mainloop(*args, **kwargs)
844
-
845
- def _getopts(self):
846
- options = {}
847
- options['modules'] = self._module_list.get(0, 'end')
848
- options['prj_name'] = self._name_entry.get() or ''
849
- options['prj_url'] = self._url_entry.get() or None
850
- options['docformat'] = self._docformat_var.get()
851
- options['inheritance'] = self._inheritance_var.get()
852
- options['introspect_or_parse'] = self._introspect_or_parse_var.get()
853
- options['target'] = self._out_entry.get() or 'html'
854
- options['frames'] = self._frames_var.get()
855
- options['private'] = self._private_var.get()
856
- options['show_imports'] = self._imports_var.get()
857
- if self._help_var.get() == '-other-':
858
- options['help'] = self._help_entry.get() or None
859
- else:
860
- options['help'] = None
861
- if self._css_var.get() == '-other-':
862
- options['css'] = self._css_entry.get() or 'default'
863
- else:
864
- options['css'] = self._css_var.get() or 'default'
865
- #if self._private_css_var.get() == '-other-':
866
- # options['private_css'] = self._css_entry.get() or 'default'
867
- #else:
868
- # options['private_css'] = self._private_css_var.get() or 'default'
869
- return options
870
-
871
- def _go(self, *e):
872
- if len(self._module_list.get(0,'end')) == 0:
873
- self._root.bell()
874
- return
875
-
876
- if self._progress[0] != None:
877
- self._cancel[0] = 1
878
- return
879
-
880
- # Construct the argument list for document().
881
- opts = self._getopts()
882
- self._progress[0] = 0.0
883
- self._cancel[0] = 0
884
- args = (opts, self._cancel, self._progress)
885
-
886
- # Clear the messages window.
887
- self._messages['state'] = 'normal'
888
- self._messages.delete('0.0', 'end')
889
- self._messages['state'] = 'disabled'
890
- self._logger.clear()
891
-
892
- # Restore the module list. This will force re-loading of
893
- # anything that we're documenting.
894
- for m in sys.modules.keys():
895
- if m not in self._old_modules:
896
- del sys.modules[m]
897
-
898
- # [xx] Reset caches??
899
-
900
- # Start documenting
901
- start_new_thread(document, args)
902
-
903
- # Start the progress bar.
904
- self._go_button['text'] = 'Stop'
905
- self._afterid += 1
906
- dt = 300 # How often to update, in milliseconds
907
- self._update(dt, self._afterid)
908
-
909
- def _update_messages(self):
910
- while 1:
911
- level, data = self._logger.read()
912
- if data is None: break
913
- self._messages['state'] = 'normal'
914
- if level == 'header':
915
- self._messages.insert('end', data, 'header')
916
- elif level == 'uline':
917
- self._messages.insert('end', data, 'uline header')
918
- elif level >= log.ERROR:
919
- data= data.rstrip()+'\n\n'
920
- self._messages.insert('end', data, 'guierror')
921
- elif level >= log.DOCSTRING_WARNING:
922
- data= data.rstrip()+'\n\n'
923
- self._messages.insert('end', data, 'warning')
924
- elif log >= log.INFO:
925
- data= data.rstrip()+'\n\n'
926
- self._messages.insert('end', data, 'message')
927
- # if data == '\n':
928
- # if self._last_tag != 'header2':
929
- # self._messages.insert('end', '\n', self._last_tag)
930
- # elif data == '='*75:
931
- # if self._messages.get('end-3c', 'end') == '\n\n\n':
932
- # self._messages.delete('end-1c')
933
- # self._in_header = 1
934
- # self._messages.insert('end', ' '*75, 'uline header')
935
- # self._last_tag = 'header'
936
- # elif data == '-'*75:
937
- # self._in_header = 0
938
- # self._last_tag = 'header2'
939
- # elif self._in_header:
940
- # self._messages.insert('end', data, 'header')
941
- # self._last_tag = 'header'
942
- # elif re.match(r'\s*(L\d+:|-)?\s*Warning: ', data):
943
- # self._messages.insert('end', data, 'warning')
944
- # self._last_tag = 'warning'
945
- # else:
946
- # self._messages.insert('end', data, 'error')
947
- # self._last_tag = 'error'
948
-
949
- self._messages['state'] = 'disabled'
950
- self._messages.yview('end')
951
-
952
- def _update(self, dt, id):
953
- if self._root is None: return
954
- if self._progress[0] is None: return
955
- if id != self._afterid: return
956
-
957
- # Update the messages box
958
- self._update_messages()
959
-
960
- # Update the progress bar.
961
- if self._progress[0] == 'done': p = self._W + DX
962
- elif self._progress[0] == 'cancel': p = -5
963
- else: p = DX + self._W * self._progress[0]
964
- self._canvas.coords(self._r1, DX+1, DY+1, p, self._H+1)
965
- self._canvas.coords(self._r2, DX, DY, p-1, self._H)
966
- self._canvas.coords(self._r3, DX+1, DY+1, p, self._H+1)
967
-
968
- # Are we done?
969
- if self._progress[0] in ('done', 'cancel'):
970
- if self._progress[0] == 'cancel': self._root.bell()
971
- self._go_button['text'] = 'Start'
972
- self._progress[0] = None
973
- return
974
-
975
- self._root.after(dt, self._update, dt, id)
976
-
977
- def _new(self, *e):
978
- self._module_list.delete(0, 'end')
979
- self._name_entry.delete(0, 'end')
980
- self._url_entry.delete(0, 'end')
981
- self._docformat_var.set('epytext')
982
- self._inheritance_var.set('grouped')
983
- self._introspect_or_parse_var.set('both')
984
- self._out_entry.delete(0, 'end')
985
- self._module_entry.delete(0, 'end')
986
- self._css_entry.delete(0, 'end')
987
- self._help_entry.delete(0, 'end')
988
- self._frames_var.set(1)
989
- self._private_var.set(1)
990
- self._imports_var.set(0)
991
- self._css_var.set('default')
992
- #self._private_css_var.set('default')
993
- self._help_var.set('default')
994
- self._filename = None
995
- self._init_dir = None
996
-
997
- def _open(self, *e):
998
- title = 'Open project'
999
- ftypes = [('Project file', '.prj'),
1000
- ('All files', '*')]
1001
- filename = askopenfilename(filetypes=ftypes, title=title,
1002
- defaultextension='.css')
1003
- if not filename: return
1004
- self.open(filename)
1005
-
1006
- def open(self, prjfile):
1007
- from epydoc.docwriter.html_css import STYLESHEETS
1008
- self._filename = prjfile
1009
- try:
1010
- opts = load(open(prjfile, 'r'))
1011
-
1012
- modnames = list(opts.get('modules', []))
1013
- modnames.sort()
1014
- self._module_list.delete(0, 'end')
1015
- for name in modnames:
1016
- self.add_module(name)
1017
- self._module_entry.delete(0, 'end')
1018
-
1019
- self._name_entry.delete(0, 'end')
1020
- if opts.get('prj_name'):
1021
- self._name_entry.insert(0, opts['prj_name'])
1022
-
1023
- self._url_entry.delete(0, 'end')
1024
- if opts.get('prj_url'):
1025
- self._url_entry.insert(0, opts['prj_url'])
1026
-
1027
- self._docformat_var.set(opts.get('docformat', 'epytext'))
1028
- self._inheritance_var.set(opts.get('inheritance', 'grouped'))
1029
- self._introspect_or_parse_var.set(
1030
- opts.get('introspect_or_parse', 'both'))
1031
-
1032
- self._help_entry.delete(0, 'end')
1033
- if opts.get('help') is None:
1034
- self._help_var.set('default')
1035
- else:
1036
- self._help_var.set('-other-')
1037
- self._help_entry.insert(0, opts.get('help'))
1038
-
1039
- self._out_entry.delete(0, 'end')
1040
- self._out_entry.insert(0, opts.get('target', 'html'))
1041
-
1042
- self._frames_var.set(opts.get('frames', 1))
1043
- self._private_var.set(opts.get('private', 1))
1044
- self._imports_var.set(opts.get('show_imports', 0))
1045
-
1046
- self._css_entry.delete(0, 'end')
1047
- if opts.get('css', 'default') in STYLESHEETS.keys():
1048
- self._css_var.set(opts.get('css', 'default'))
1049
- else:
1050
- self._css_var.set('-other-')
1051
- self._css_entry.insert(0, opts.get('css', 'default'))
1052
-
1053
- #if opts.get('private_css', 'default') in STYLESHEETS.keys():
1054
- # self._private_css_var.set(opts.get('private_css', 'default'))
1055
- #else:
1056
- # self._private_css_var.set('-other-')
1057
- # self._css_entry.insert(0, opts.get('private_css', 'default'))
1058
-
1059
- except Exception, e:
1060
- log.error('Error opening %s: %s' % (prjfile, e))
1061
- self._root.bell()
1062
-
1063
- def _save(self, *e):
1064
- if self._filename is None: return self._saveas()
1065
- try:
1066
- opts = self._getopts()
1067
- dump(opts, open(self._filename, 'w'))
1068
- except Exception, e:
1069
- if self._filename is None:
1070
- log.error('Error saving: %s' % e)
1071
- else:
1072
- log.error('Error saving %s: %s' % (self._filename, e))
1073
- self._root.bell()
1074
-
1075
- def _saveas(self, *e):
1076
- title = 'Save project as'
1077
- ftypes = [('Project file', '.prj'), ('All files', '*')]
1078
- filename = asksaveasfilename(filetypes=ftypes, title=title,
1079
- defaultextension='.prj')
1080
- if not filename: return
1081
- self._filename = filename
1082
- self._save()
1083
-
1084
- def _version():
1085
- """
1086
- Display the version information, and exit.
1087
- @rtype: C{None}
1088
- """
1089
- import epydoc
1090
- print "Epydoc version %s" % epydoc.__version__
1091
- sys.exit(0)
1092
-
1093
- # At some point I could add:
1094
- # --show-messages, --hide-messages
1095
- # --show-options, --hide-options
1096
- def _usage():
1097
- print
1098
- print 'Usage: epydocgui [OPTIONS] [FILE.prj | MODULES...]'
1099
- print
1100
- print ' FILE.prj An epydoc GUI project file.'
1101
- print ' MODULES... A list of Python modules to document.'
1102
- print ' -V, --version Print the version of epydoc.'
1103
- print ' -h, -?, --help, --usage Display this usage message'
1104
- print ' --debug Do not suppress error messages'
1105
- print
1106
- sys.exit(0)
1107
-
1108
- def _error(s):
1109
- s = '%s; run "%s -h" for usage' % (s, os.path.basename(sys.argv[0]))
1110
- if len(s) > 80:
1111
- i = s.rfind(' ', 0, 80)
1112
- if i>0: s = s[:i]+'\n'+s[i+1:]
1113
- print >>sys.stderr, s
1114
- sys.exit(1)
1115
-
1116
- def gui():
1117
- global DEBUG
1118
- sys.stderr = sys.__stderr__
1119
- projects = []
1120
- modules = []
1121
- for arg in sys.argv[1:]:
1122
- if arg[0] == '-':
1123
- if arg != '-V': arg = arg.lower()
1124
- if arg in ('-h', '--help', '-?', '--usage'): _usage()
1125
- elif arg in ('-V', '--version'): _version()
1126
- elif arg in ('--debug',): DEBUG = 1
1127
- else:
1128
- _error('Unknown parameter %r' % arg)
1129
- elif arg[-4:] == '.prj': projects.append(arg)
1130
- else: modules.append(arg)
1131
-
1132
- if len(projects) > 1:
1133
- _error('Too many projects')
1134
- if len(projects) == 1:
1135
- if len(modules) > 0:
1136
- _error('You must specify either a project or a list of modules')
1137
- if not os.path.exists(projects[0]):
1138
- _error('Cannot open project file %s' % projects[0])
1139
- gui = EpydocGUI()
1140
- gui.open(projects[0])
1141
- gui.mainloop()
1142
- else:
1143
- gui = EpydocGUI()
1144
- for module in modules: gui.add_module(module, check=1)
1145
- gui.mainloop()
1146
-
1147
- if __name__ == '__main__': gui()
1148
-