@tedbrain/vlink 0.0.0-dpv2.pdkadapt.bootstrap-linux-x64.0.1.1.r1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (663) hide show
  1. package/code/entry.py +16 -0
  2. package/code/tedbrain_plugin_runtime/__init__.py +2 -0
  3. package/code/tedbrain_plugin_runtime/installer.py +400 -0
  4. package/code/tedbrain_plugin_runtime/launcher.py +120 -0
  5. package/package.json +1 -0
  6. package/python/bin/python3 +0 -0
  7. package/python/lib/libX11.so.6 +0 -0
  8. package/python/lib/libXau.so.6 +0 -0
  9. package/python/lib/libXdmcp.so.6 +0 -0
  10. package/python/lib/libcrypt.so.1 +0 -0
  11. package/python/lib/libcrypto.so.1.1 +0 -0
  12. package/python/lib/libffi.so.7 +0 -0
  13. package/python/lib/libfreebl3.so +0 -0
  14. package/python/lib/liblzma.so.5 +0 -0
  15. package/python/lib/libncursesw.so.6 +0 -0
  16. package/python/lib/libnsl.so.1 +0 -0
  17. package/python/lib/libpanelw.so.6 +0 -0
  18. package/python/lib/libpython3.9.so.1.0 +0 -0
  19. package/python/lib/libreadline.so.8 +0 -0
  20. package/python/lib/libsqlite3.so.0 +0 -0
  21. package/python/lib/libssl.so.1.1 +0 -0
  22. package/python/lib/libtcl8.6.so +0 -0
  23. package/python/lib/libtinfow.so.6 +0 -0
  24. package/python/lib/libtk8.6.so +0 -0
  25. package/python/lib/libxcb.so.1 +0 -0
  26. package/python/lib/libz.so.1 +0 -0
  27. package/python/lib/python3.9/LICENSE.txt +279 -0
  28. package/python/lib/python3.9/__future__.py +147 -0
  29. package/python/lib/python3.9/__phello__.foo.py +1 -0
  30. package/python/lib/python3.9/_aix_support.py +89 -0
  31. package/python/lib/python3.9/_bootlocale.py +46 -0
  32. package/python/lib/python3.9/_bootsubprocess.py +97 -0
  33. package/python/lib/python3.9/_collections_abc.py +1031 -0
  34. package/python/lib/python3.9/_compat_pickle.py +251 -0
  35. package/python/lib/python3.9/_compression.py +152 -0
  36. package/python/lib/python3.9/_markupbase.py +395 -0
  37. package/python/lib/python3.9/_osx_support.py +515 -0
  38. package/python/lib/python3.9/_py_abc.py +147 -0
  39. package/python/lib/python3.9/_pydecimal.py +6410 -0
  40. package/python/lib/python3.9/_pyio.py +2692 -0
  41. package/python/lib/python3.9/_sitebuiltins.py +103 -0
  42. package/python/lib/python3.9/_strptime.py +579 -0
  43. package/python/lib/python3.9/_sysconfigdata__linux_x86_64-linux-gnu.py +969 -0
  44. package/python/lib/python3.9/_sysconfigdata__linux_x86_64-linux-gnu.py.orig +969 -0
  45. package/python/lib/python3.9/_sysconfigdata_x86_64_conda_cos6_linux_gnu.py +969 -0
  46. package/python/lib/python3.9/_threading_local.py +242 -0
  47. package/python/lib/python3.9/_weakrefset.py +202 -0
  48. package/python/lib/python3.9/abc.py +129 -0
  49. package/python/lib/python3.9/aifc.py +947 -0
  50. package/python/lib/python3.9/antigravity.py +17 -0
  51. package/python/lib/python3.9/argparse.py +2575 -0
  52. package/python/lib/python3.9/ast.py +1530 -0
  53. package/python/lib/python3.9/asynchat.py +307 -0
  54. package/python/lib/python3.9/asyncio/__init__.py +47 -0
  55. package/python/lib/python3.9/asyncio/__main__.py +125 -0
  56. package/python/lib/python3.9/asyncio/base_events.py +1915 -0
  57. package/python/lib/python3.9/asyncio/base_futures.py +61 -0
  58. package/python/lib/python3.9/asyncio/base_subprocess.py +285 -0
  59. package/python/lib/python3.9/asyncio/base_tasks.py +85 -0
  60. package/python/lib/python3.9/asyncio/constants.py +27 -0
  61. package/python/lib/python3.9/asyncio/coroutines.py +269 -0
  62. package/python/lib/python3.9/asyncio/events.py +795 -0
  63. package/python/lib/python3.9/asyncio/exceptions.py +57 -0
  64. package/python/lib/python3.9/asyncio/format_helpers.py +76 -0
  65. package/python/lib/python3.9/asyncio/futures.py +423 -0
  66. package/python/lib/python3.9/asyncio/locks.py +451 -0
  67. package/python/lib/python3.9/asyncio/log.py +7 -0
  68. package/python/lib/python3.9/asyncio/proactor_events.py +868 -0
  69. package/python/lib/python3.9/asyncio/protocols.py +220 -0
  70. package/python/lib/python3.9/asyncio/queues.py +252 -0
  71. package/python/lib/python3.9/asyncio/runners.py +74 -0
  72. package/python/lib/python3.9/asyncio/selector_events.py +1099 -0
  73. package/python/lib/python3.9/asyncio/sslproto.py +733 -0
  74. package/python/lib/python3.9/asyncio/staggered.py +149 -0
  75. package/python/lib/python3.9/asyncio/streams.py +741 -0
  76. package/python/lib/python3.9/asyncio/subprocess.py +241 -0
  77. package/python/lib/python3.9/asyncio/tasks.py +980 -0
  78. package/python/lib/python3.9/asyncio/threads.py +25 -0
  79. package/python/lib/python3.9/asyncio/transports.py +329 -0
  80. package/python/lib/python3.9/asyncio/trsock.py +206 -0
  81. package/python/lib/python3.9/asyncio/unix_events.py +1466 -0
  82. package/python/lib/python3.9/asyncio/windows_events.py +908 -0
  83. package/python/lib/python3.9/asyncio/windows_utils.py +173 -0
  84. package/python/lib/python3.9/asyncore.py +642 -0
  85. package/python/lib/python3.9/base64.py +579 -0
  86. package/python/lib/python3.9/bdb.py +864 -0
  87. package/python/lib/python3.9/binhex.py +502 -0
  88. package/python/lib/python3.9/bisect.py +80 -0
  89. package/python/lib/python3.9/bz2.py +350 -0
  90. package/python/lib/python3.9/cProfile.py +180 -0
  91. package/python/lib/python3.9/calendar.py +770 -0
  92. package/python/lib/python3.9/cgi.py +996 -0
  93. package/python/lib/python3.9/cgitb.py +321 -0
  94. package/python/lib/python3.9/chunk.py +169 -0
  95. package/python/lib/python3.9/cmd.py +401 -0
  96. package/python/lib/python3.9/code.py +315 -0
  97. package/python/lib/python3.9/codecs.py +1126 -0
  98. package/python/lib/python3.9/codeop.py +178 -0
  99. package/python/lib/python3.9/collections/__init__.py +1508 -0
  100. package/python/lib/python3.9/collections/abc.py +2 -0
  101. package/python/lib/python3.9/colorsys.py +164 -0
  102. package/python/lib/python3.9/compileall.py +461 -0
  103. package/python/lib/python3.9/concurrent/__init__.py +1 -0
  104. package/python/lib/python3.9/concurrent/futures/__init__.py +53 -0
  105. package/python/lib/python3.9/concurrent/futures/_base.py +635 -0
  106. package/python/lib/python3.9/concurrent/futures/process.py +751 -0
  107. package/python/lib/python3.9/concurrent/futures/thread.py +230 -0
  108. package/python/lib/python3.9/config-3.9-x86_64-linux-gnu/Makefile +2015 -0
  109. package/python/lib/python3.9/config-3.9-x86_64-linux-gnu/Setup +372 -0
  110. package/python/lib/python3.9/config-3.9-x86_64-linux-gnu/Setup.local +1 -0
  111. package/python/lib/python3.9/config-3.9-x86_64-linux-gnu/config.c +116 -0
  112. package/python/lib/python3.9/config-3.9-x86_64-linux-gnu/config.c.in +67 -0
  113. package/python/lib/python3.9/config-3.9-x86_64-linux-gnu/install-sh +518 -0
  114. package/python/lib/python3.9/config-3.9-x86_64-linux-gnu/makesetup +309 -0
  115. package/python/lib/python3.9/config-3.9-x86_64-linux-gnu/python-config.py +74 -0
  116. package/python/lib/python3.9/config-3.9-x86_64-linux-gnu/python.o +0 -0
  117. package/python/lib/python3.9/configparser.py +1363 -0
  118. package/python/lib/python3.9/contextlib.py +676 -0
  119. package/python/lib/python3.9/contextvars.py +4 -0
  120. package/python/lib/python3.9/copy.py +303 -0
  121. package/python/lib/python3.9/copyreg.py +209 -0
  122. package/python/lib/python3.9/crypt.py +120 -0
  123. package/python/lib/python3.9/csv.py +448 -0
  124. package/python/lib/python3.9/ctypes/__init__.py +571 -0
  125. package/python/lib/python3.9/ctypes/_aix.py +331 -0
  126. package/python/lib/python3.9/ctypes/_endian.py +61 -0
  127. package/python/lib/python3.9/ctypes/macholib/README.ctypes +7 -0
  128. package/python/lib/python3.9/ctypes/macholib/__init__.py +9 -0
  129. package/python/lib/python3.9/ctypes/macholib/dyld.py +182 -0
  130. package/python/lib/python3.9/ctypes/macholib/dylib.py +63 -0
  131. package/python/lib/python3.9/ctypes/macholib/fetch_macholib +2 -0
  132. package/python/lib/python3.9/ctypes/macholib/fetch_macholib.bat +1 -0
  133. package/python/lib/python3.9/ctypes/macholib/framework.py +65 -0
  134. package/python/lib/python3.9/ctypes/util.py +379 -0
  135. package/python/lib/python3.9/ctypes/wintypes.py +202 -0
  136. package/python/lib/python3.9/curses/__init__.py +101 -0
  137. package/python/lib/python3.9/curses/ascii.py +99 -0
  138. package/python/lib/python3.9/curses/has_key.py +192 -0
  139. package/python/lib/python3.9/curses/panel.py +6 -0
  140. package/python/lib/python3.9/curses/textpad.py +201 -0
  141. package/python/lib/python3.9/dataclasses.py +1284 -0
  142. package/python/lib/python3.9/datetime.py +2555 -0
  143. package/python/lib/python3.9/dbm/__init__.py +189 -0
  144. package/python/lib/python3.9/dbm/dumb.py +316 -0
  145. package/python/lib/python3.9/dbm/gnu.py +3 -0
  146. package/python/lib/python3.9/dbm/ndbm.py +3 -0
  147. package/python/lib/python3.9/decimal.py +11 -0
  148. package/python/lib/python3.9/difflib.py +2096 -0
  149. package/python/lib/python3.9/dis.py +553 -0
  150. package/python/lib/python3.9/distutils/README +11 -0
  151. package/python/lib/python3.9/distutils/__init__.py +13 -0
  152. package/python/lib/python3.9/distutils/_msvccompiler.py +546 -0
  153. package/python/lib/python3.9/distutils/archive_util.py +256 -0
  154. package/python/lib/python3.9/distutils/bcppcompiler.py +393 -0
  155. package/python/lib/python3.9/distutils/ccompiler.py +1116 -0
  156. package/python/lib/python3.9/distutils/cmd.py +403 -0
  157. package/python/lib/python3.9/distutils/command/__init__.py +31 -0
  158. package/python/lib/python3.9/distutils/command/bdist.py +143 -0
  159. package/python/lib/python3.9/distutils/command/bdist_dumb.py +123 -0
  160. package/python/lib/python3.9/distutils/command/bdist_msi.py +749 -0
  161. package/python/lib/python3.9/distutils/command/bdist_rpm.py +579 -0
  162. package/python/lib/python3.9/distutils/command/bdist_wininst.py +377 -0
  163. package/python/lib/python3.9/distutils/command/build.py +157 -0
  164. package/python/lib/python3.9/distutils/command/build_clib.py +209 -0
  165. package/python/lib/python3.9/distutils/command/build_ext.py +754 -0
  166. package/python/lib/python3.9/distutils/command/build_py.py +416 -0
  167. package/python/lib/python3.9/distutils/command/build_scripts.py +160 -0
  168. package/python/lib/python3.9/distutils/command/check.py +148 -0
  169. package/python/lib/python3.9/distutils/command/clean.py +76 -0
  170. package/python/lib/python3.9/distutils/command/command_template +33 -0
  171. package/python/lib/python3.9/distutils/command/config.py +344 -0
  172. package/python/lib/python3.9/distutils/command/install.py +657 -0
  173. package/python/lib/python3.9/distutils/command/install_data.py +79 -0
  174. package/python/lib/python3.9/distutils/command/install_egg_info.py +77 -0
  175. package/python/lib/python3.9/distutils/command/install_headers.py +47 -0
  176. package/python/lib/python3.9/distutils/command/install_lib.py +217 -0
  177. package/python/lib/python3.9/distutils/command/install_scripts.py +60 -0
  178. package/python/lib/python3.9/distutils/command/register.py +304 -0
  179. package/python/lib/python3.9/distutils/command/sdist.py +494 -0
  180. package/python/lib/python3.9/distutils/command/upload.py +214 -0
  181. package/python/lib/python3.9/distutils/config.py +130 -0
  182. package/python/lib/python3.9/distutils/core.py +234 -0
  183. package/python/lib/python3.9/distutils/cygwinccompiler.py +410 -0
  184. package/python/lib/python3.9/distutils/debug.py +5 -0
  185. package/python/lib/python3.9/distutils/dep_util.py +92 -0
  186. package/python/lib/python3.9/distutils/dir_util.py +210 -0
  187. package/python/lib/python3.9/distutils/dist.py +1256 -0
  188. package/python/lib/python3.9/distutils/errors.py +97 -0
  189. package/python/lib/python3.9/distutils/extension.py +240 -0
  190. package/python/lib/python3.9/distutils/fancy_getopt.py +457 -0
  191. package/python/lib/python3.9/distutils/file_util.py +238 -0
  192. package/python/lib/python3.9/distutils/filelist.py +327 -0
  193. package/python/lib/python3.9/distutils/log.py +77 -0
  194. package/python/lib/python3.9/distutils/msvc9compiler.py +788 -0
  195. package/python/lib/python3.9/distutils/msvccompiler.py +643 -0
  196. package/python/lib/python3.9/distutils/spawn.py +125 -0
  197. package/python/lib/python3.9/distutils/sysconfig.py +560 -0
  198. package/python/lib/python3.9/distutils/text_file.py +286 -0
  199. package/python/lib/python3.9/distutils/unixccompiler.py +330 -0
  200. package/python/lib/python3.9/distutils/util.py +559 -0
  201. package/python/lib/python3.9/distutils/version.py +347 -0
  202. package/python/lib/python3.9/distutils/versionpredicate.py +166 -0
  203. package/python/lib/python3.9/doctest.py +2793 -0
  204. package/python/lib/python3.9/email/__init__.py +62 -0
  205. package/python/lib/python3.9/email/_encoded_words.py +233 -0
  206. package/python/lib/python3.9/email/_header_value_parser.py +3003 -0
  207. package/python/lib/python3.9/email/_parseaddr.py +549 -0
  208. package/python/lib/python3.9/email/_policybase.py +374 -0
  209. package/python/lib/python3.9/email/architecture.rst +216 -0
  210. package/python/lib/python3.9/email/base64mime.py +119 -0
  211. package/python/lib/python3.9/email/charset.py +404 -0
  212. package/python/lib/python3.9/email/contentmanager.py +250 -0
  213. package/python/lib/python3.9/email/encoders.py +69 -0
  214. package/python/lib/python3.9/email/errors.py +110 -0
  215. package/python/lib/python3.9/email/feedparser.py +536 -0
  216. package/python/lib/python3.9/email/generator.py +508 -0
  217. package/python/lib/python3.9/email/header.py +578 -0
  218. package/python/lib/python3.9/email/headerregistry.py +601 -0
  219. package/python/lib/python3.9/email/iterators.py +71 -0
  220. package/python/lib/python3.9/email/message.py +1173 -0
  221. package/python/lib/python3.9/email/mime/__init__.py +0 -0
  222. package/python/lib/python3.9/email/mime/application.py +37 -0
  223. package/python/lib/python3.9/email/mime/audio.py +74 -0
  224. package/python/lib/python3.9/email/mime/base.py +30 -0
  225. package/python/lib/python3.9/email/mime/image.py +47 -0
  226. package/python/lib/python3.9/email/mime/message.py +34 -0
  227. package/python/lib/python3.9/email/mime/multipart.py +48 -0
  228. package/python/lib/python3.9/email/mime/nonmultipart.py +22 -0
  229. package/python/lib/python3.9/email/mime/text.py +42 -0
  230. package/python/lib/python3.9/email/parser.py +131 -0
  231. package/python/lib/python3.9/email/policy.py +224 -0
  232. package/python/lib/python3.9/email/quoprimime.py +299 -0
  233. package/python/lib/python3.9/email/utils.py +368 -0
  234. package/python/lib/python3.9/encodings/__init__.py +169 -0
  235. package/python/lib/python3.9/encodings/aliases.py +551 -0
  236. package/python/lib/python3.9/encodings/ascii.py +50 -0
  237. package/python/lib/python3.9/encodings/base64_codec.py +55 -0
  238. package/python/lib/python3.9/encodings/big5.py +39 -0
  239. package/python/lib/python3.9/encodings/big5hkscs.py +39 -0
  240. package/python/lib/python3.9/encodings/bz2_codec.py +78 -0
  241. package/python/lib/python3.9/encodings/charmap.py +69 -0
  242. package/python/lib/python3.9/encodings/cp037.py +307 -0
  243. package/python/lib/python3.9/encodings/cp1006.py +307 -0
  244. package/python/lib/python3.9/encodings/cp1026.py +307 -0
  245. package/python/lib/python3.9/encodings/cp1125.py +698 -0
  246. package/python/lib/python3.9/encodings/cp1140.py +307 -0
  247. package/python/lib/python3.9/encodings/cp1250.py +307 -0
  248. package/python/lib/python3.9/encodings/cp1251.py +307 -0
  249. package/python/lib/python3.9/encodings/cp1252.py +307 -0
  250. package/python/lib/python3.9/encodings/cp1253.py +307 -0
  251. package/python/lib/python3.9/encodings/cp1254.py +307 -0
  252. package/python/lib/python3.9/encodings/cp1255.py +307 -0
  253. package/python/lib/python3.9/encodings/cp1256.py +307 -0
  254. package/python/lib/python3.9/encodings/cp1257.py +307 -0
  255. package/python/lib/python3.9/encodings/cp1258.py +307 -0
  256. package/python/lib/python3.9/encodings/cp273.py +307 -0
  257. package/python/lib/python3.9/encodings/cp424.py +307 -0
  258. package/python/lib/python3.9/encodings/cp437.py +698 -0
  259. package/python/lib/python3.9/encodings/cp500.py +307 -0
  260. package/python/lib/python3.9/encodings/cp720.py +309 -0
  261. package/python/lib/python3.9/encodings/cp737.py +698 -0
  262. package/python/lib/python3.9/encodings/cp775.py +697 -0
  263. package/python/lib/python3.9/encodings/cp850.py +698 -0
  264. package/python/lib/python3.9/encodings/cp852.py +698 -0
  265. package/python/lib/python3.9/encodings/cp855.py +698 -0
  266. package/python/lib/python3.9/encodings/cp856.py +307 -0
  267. package/python/lib/python3.9/encodings/cp857.py +694 -0
  268. package/python/lib/python3.9/encodings/cp858.py +698 -0
  269. package/python/lib/python3.9/encodings/cp860.py +698 -0
  270. package/python/lib/python3.9/encodings/cp861.py +698 -0
  271. package/python/lib/python3.9/encodings/cp862.py +698 -0
  272. package/python/lib/python3.9/encodings/cp863.py +698 -0
  273. package/python/lib/python3.9/encodings/cp864.py +690 -0
  274. package/python/lib/python3.9/encodings/cp865.py +698 -0
  275. package/python/lib/python3.9/encodings/cp866.py +698 -0
  276. package/python/lib/python3.9/encodings/cp869.py +689 -0
  277. package/python/lib/python3.9/encodings/cp874.py +307 -0
  278. package/python/lib/python3.9/encodings/cp875.py +307 -0
  279. package/python/lib/python3.9/encodings/cp932.py +39 -0
  280. package/python/lib/python3.9/encodings/cp949.py +39 -0
  281. package/python/lib/python3.9/encodings/cp950.py +39 -0
  282. package/python/lib/python3.9/encodings/euc_jis_2004.py +39 -0
  283. package/python/lib/python3.9/encodings/euc_jisx0213.py +39 -0
  284. package/python/lib/python3.9/encodings/euc_jp.py +39 -0
  285. package/python/lib/python3.9/encodings/euc_kr.py +39 -0
  286. package/python/lib/python3.9/encodings/gb18030.py +39 -0
  287. package/python/lib/python3.9/encodings/gb2312.py +39 -0
  288. package/python/lib/python3.9/encodings/gbk.py +39 -0
  289. package/python/lib/python3.9/encodings/hex_codec.py +55 -0
  290. package/python/lib/python3.9/encodings/hp_roman8.py +314 -0
  291. package/python/lib/python3.9/encodings/hz.py +39 -0
  292. package/python/lib/python3.9/encodings/idna.py +309 -0
  293. package/python/lib/python3.9/encodings/iso2022_jp.py +39 -0
  294. package/python/lib/python3.9/encodings/iso2022_jp_1.py +39 -0
  295. package/python/lib/python3.9/encodings/iso2022_jp_2.py +39 -0
  296. package/python/lib/python3.9/encodings/iso2022_jp_2004.py +39 -0
  297. package/python/lib/python3.9/encodings/iso2022_jp_3.py +39 -0
  298. package/python/lib/python3.9/encodings/iso2022_jp_ext.py +39 -0
  299. package/python/lib/python3.9/encodings/iso2022_kr.py +39 -0
  300. package/python/lib/python3.9/encodings/iso8859_1.py +307 -0
  301. package/python/lib/python3.9/encodings/iso8859_10.py +307 -0
  302. package/python/lib/python3.9/encodings/iso8859_11.py +307 -0
  303. package/python/lib/python3.9/encodings/iso8859_13.py +307 -0
  304. package/python/lib/python3.9/encodings/iso8859_14.py +307 -0
  305. package/python/lib/python3.9/encodings/iso8859_15.py +307 -0
  306. package/python/lib/python3.9/encodings/iso8859_16.py +307 -0
  307. package/python/lib/python3.9/encodings/iso8859_2.py +307 -0
  308. package/python/lib/python3.9/encodings/iso8859_3.py +307 -0
  309. package/python/lib/python3.9/encodings/iso8859_4.py +307 -0
  310. package/python/lib/python3.9/encodings/iso8859_5.py +307 -0
  311. package/python/lib/python3.9/encodings/iso8859_6.py +307 -0
  312. package/python/lib/python3.9/encodings/iso8859_7.py +307 -0
  313. package/python/lib/python3.9/encodings/iso8859_8.py +307 -0
  314. package/python/lib/python3.9/encodings/iso8859_9.py +307 -0
  315. package/python/lib/python3.9/encodings/johab.py +39 -0
  316. package/python/lib/python3.9/encodings/koi8_r.py +307 -0
  317. package/python/lib/python3.9/encodings/koi8_t.py +308 -0
  318. package/python/lib/python3.9/encodings/koi8_u.py +307 -0
  319. package/python/lib/python3.9/encodings/kz1048.py +307 -0
  320. package/python/lib/python3.9/encodings/latin_1.py +50 -0
  321. package/python/lib/python3.9/encodings/mac_arabic.py +698 -0
  322. package/python/lib/python3.9/encodings/mac_croatian.py +307 -0
  323. package/python/lib/python3.9/encodings/mac_cyrillic.py +307 -0
  324. package/python/lib/python3.9/encodings/mac_farsi.py +307 -0
  325. package/python/lib/python3.9/encodings/mac_greek.py +307 -0
  326. package/python/lib/python3.9/encodings/mac_iceland.py +307 -0
  327. package/python/lib/python3.9/encodings/mac_latin2.py +312 -0
  328. package/python/lib/python3.9/encodings/mac_roman.py +307 -0
  329. package/python/lib/python3.9/encodings/mac_romanian.py +307 -0
  330. package/python/lib/python3.9/encodings/mac_turkish.py +307 -0
  331. package/python/lib/python3.9/encodings/mbcs.py +47 -0
  332. package/python/lib/python3.9/encodings/oem.py +41 -0
  333. package/python/lib/python3.9/encodings/palmos.py +308 -0
  334. package/python/lib/python3.9/encodings/ptcp154.py +312 -0
  335. package/python/lib/python3.9/encodings/punycode.py +237 -0
  336. package/python/lib/python3.9/encodings/quopri_codec.py +56 -0
  337. package/python/lib/python3.9/encodings/raw_unicode_escape.py +45 -0
  338. package/python/lib/python3.9/encodings/rot_13.py +113 -0
  339. package/python/lib/python3.9/encodings/shift_jis.py +39 -0
  340. package/python/lib/python3.9/encodings/shift_jis_2004.py +39 -0
  341. package/python/lib/python3.9/encodings/shift_jisx0213.py +39 -0
  342. package/python/lib/python3.9/encodings/tis_620.py +307 -0
  343. package/python/lib/python3.9/encodings/undefined.py +49 -0
  344. package/python/lib/python3.9/encodings/unicode_escape.py +45 -0
  345. package/python/lib/python3.9/encodings/utf_16.py +155 -0
  346. package/python/lib/python3.9/encodings/utf_16_be.py +42 -0
  347. package/python/lib/python3.9/encodings/utf_16_le.py +42 -0
  348. package/python/lib/python3.9/encodings/utf_32.py +150 -0
  349. package/python/lib/python3.9/encodings/utf_32_be.py +37 -0
  350. package/python/lib/python3.9/encodings/utf_32_le.py +37 -0
  351. package/python/lib/python3.9/encodings/utf_7.py +38 -0
  352. package/python/lib/python3.9/encodings/utf_8.py +42 -0
  353. package/python/lib/python3.9/encodings/utf_8_sig.py +130 -0
  354. package/python/lib/python3.9/encodings/uu_codec.py +103 -0
  355. package/python/lib/python3.9/encodings/zlib_codec.py +77 -0
  356. package/python/lib/python3.9/enum.py +913 -0
  357. package/python/lib/python3.9/filecmp.py +309 -0
  358. package/python/lib/python3.9/fileinput.py +432 -0
  359. package/python/lib/python3.9/fnmatch.py +183 -0
  360. package/python/lib/python3.9/formatter.py +452 -0
  361. package/python/lib/python3.9/fractions.py +641 -0
  362. package/python/lib/python3.9/ftplib.py +974 -0
  363. package/python/lib/python3.9/functools.py +980 -0
  364. package/python/lib/python3.9/genericpath.py +155 -0
  365. package/python/lib/python3.9/getopt.py +215 -0
  366. package/python/lib/python3.9/getpass.py +185 -0
  367. package/python/lib/python3.9/gettext.py +788 -0
  368. package/python/lib/python3.9/glob.py +173 -0
  369. package/python/lib/python3.9/graphlib.py +245 -0
  370. package/python/lib/python3.9/gzip.py +609 -0
  371. package/python/lib/python3.9/hashlib.py +262 -0
  372. package/python/lib/python3.9/heapq.py +601 -0
  373. package/python/lib/python3.9/hmac.py +203 -0
  374. package/python/lib/python3.9/html/__init__.py +132 -0
  375. package/python/lib/python3.9/html/entities.py +2509 -0
  376. package/python/lib/python3.9/html/parser.py +462 -0
  377. package/python/lib/python3.9/http/__init__.py +149 -0
  378. package/python/lib/python3.9/http/client.py +1495 -0
  379. package/python/lib/python3.9/http/cookiejar.py +2113 -0
  380. package/python/lib/python3.9/http/cookies.py +612 -0
  381. package/python/lib/python3.9/http/server.py +1299 -0
  382. package/python/lib/python3.9/imaplib.py +1650 -0
  383. package/python/lib/python3.9/imghdr.py +168 -0
  384. package/python/lib/python3.9/imp.py +345 -0
  385. package/python/lib/python3.9/importlib/__init__.py +176 -0
  386. package/python/lib/python3.9/importlib/_bootstrap.py +1189 -0
  387. package/python/lib/python3.9/importlib/_bootstrap_external.py +1637 -0
  388. package/python/lib/python3.9/importlib/_common.py +62 -0
  389. package/python/lib/python3.9/importlib/abc.py +474 -0
  390. package/python/lib/python3.9/importlib/machinery.py +21 -0
  391. package/python/lib/python3.9/importlib/metadata.py +586 -0
  392. package/python/lib/python3.9/importlib/resources.py +215 -0
  393. package/python/lib/python3.9/importlib/util.py +300 -0
  394. package/python/lib/python3.9/inspect.py +3180 -0
  395. package/python/lib/python3.9/io.py +99 -0
  396. package/python/lib/python3.9/ipaddress.py +2280 -0
  397. package/python/lib/python3.9/json/__init__.py +359 -0
  398. package/python/lib/python3.9/json/decoder.py +356 -0
  399. package/python/lib/python3.9/json/encoder.py +442 -0
  400. package/python/lib/python3.9/json/scanner.py +73 -0
  401. package/python/lib/python3.9/json/tool.py +78 -0
  402. package/python/lib/python3.9/keyword.py +62 -0
  403. package/python/lib/python3.9/lib-dynload/_asyncio.cpython-39-x86_64-linux-gnu.so +0 -0
  404. package/python/lib/python3.9/lib-dynload/_bisect.cpython-39-x86_64-linux-gnu.so +0 -0
  405. package/python/lib/python3.9/lib-dynload/_blake2.cpython-39-x86_64-linux-gnu.so +0 -0
  406. package/python/lib/python3.9/lib-dynload/_bz2.cpython-39-x86_64-linux-gnu.so +0 -0
  407. package/python/lib/python3.9/lib-dynload/_codecs_cn.cpython-39-x86_64-linux-gnu.so +0 -0
  408. package/python/lib/python3.9/lib-dynload/_codecs_hk.cpython-39-x86_64-linux-gnu.so +0 -0
  409. package/python/lib/python3.9/lib-dynload/_codecs_iso2022.cpython-39-x86_64-linux-gnu.so +0 -0
  410. package/python/lib/python3.9/lib-dynload/_codecs_jp.cpython-39-x86_64-linux-gnu.so +0 -0
  411. package/python/lib/python3.9/lib-dynload/_codecs_kr.cpython-39-x86_64-linux-gnu.so +0 -0
  412. package/python/lib/python3.9/lib-dynload/_codecs_tw.cpython-39-x86_64-linux-gnu.so +0 -0
  413. package/python/lib/python3.9/lib-dynload/_contextvars.cpython-39-x86_64-linux-gnu.so +0 -0
  414. package/python/lib/python3.9/lib-dynload/_crypt.cpython-39-x86_64-linux-gnu.so +0 -0
  415. package/python/lib/python3.9/lib-dynload/_csv.cpython-39-x86_64-linux-gnu.so +0 -0
  416. package/python/lib/python3.9/lib-dynload/_ctypes.cpython-39-x86_64-linux-gnu.so +0 -0
  417. package/python/lib/python3.9/lib-dynload/_ctypes_test.cpython-39-x86_64-linux-gnu.so +0 -0
  418. package/python/lib/python3.9/lib-dynload/_curses.cpython-39-x86_64-linux-gnu.so +0 -0
  419. package/python/lib/python3.9/lib-dynload/_curses_panel.cpython-39-x86_64-linux-gnu.so +0 -0
  420. package/python/lib/python3.9/lib-dynload/_datetime.cpython-39-x86_64-linux-gnu.so +0 -0
  421. package/python/lib/python3.9/lib-dynload/_decimal.cpython-39-x86_64-linux-gnu.so +0 -0
  422. package/python/lib/python3.9/lib-dynload/_elementtree.cpython-39-x86_64-linux-gnu.so +0 -0
  423. package/python/lib/python3.9/lib-dynload/_hashlib.cpython-39-x86_64-linux-gnu.so +0 -0
  424. package/python/lib/python3.9/lib-dynload/_heapq.cpython-39-x86_64-linux-gnu.so +0 -0
  425. package/python/lib/python3.9/lib-dynload/_json.cpython-39-x86_64-linux-gnu.so +0 -0
  426. package/python/lib/python3.9/lib-dynload/_lsprof.cpython-39-x86_64-linux-gnu.so +0 -0
  427. package/python/lib/python3.9/lib-dynload/_lzma.cpython-39-x86_64-linux-gnu.so +0 -0
  428. package/python/lib/python3.9/lib-dynload/_md5.cpython-39-x86_64-linux-gnu.so +0 -0
  429. package/python/lib/python3.9/lib-dynload/_multibytecodec.cpython-39-x86_64-linux-gnu.so +0 -0
  430. package/python/lib/python3.9/lib-dynload/_multiprocessing.cpython-39-x86_64-linux-gnu.so +0 -0
  431. package/python/lib/python3.9/lib-dynload/_opcode.cpython-39-x86_64-linux-gnu.so +0 -0
  432. package/python/lib/python3.9/lib-dynload/_pickle.cpython-39-x86_64-linux-gnu.so +0 -0
  433. package/python/lib/python3.9/lib-dynload/_posixshmem.cpython-39-x86_64-linux-gnu.so +0 -0
  434. package/python/lib/python3.9/lib-dynload/_posixsubprocess.cpython-39-x86_64-linux-gnu.so +0 -0
  435. package/python/lib/python3.9/lib-dynload/_queue.cpython-39-x86_64-linux-gnu.so +0 -0
  436. package/python/lib/python3.9/lib-dynload/_random.cpython-39-x86_64-linux-gnu.so +0 -0
  437. package/python/lib/python3.9/lib-dynload/_sha1.cpython-39-x86_64-linux-gnu.so +0 -0
  438. package/python/lib/python3.9/lib-dynload/_sha256.cpython-39-x86_64-linux-gnu.so +0 -0
  439. package/python/lib/python3.9/lib-dynload/_sha3.cpython-39-x86_64-linux-gnu.so +0 -0
  440. package/python/lib/python3.9/lib-dynload/_sha512.cpython-39-x86_64-linux-gnu.so +0 -0
  441. package/python/lib/python3.9/lib-dynload/_socket.cpython-39-x86_64-linux-gnu.so +0 -0
  442. package/python/lib/python3.9/lib-dynload/_sqlite3.cpython-39-x86_64-linux-gnu.so +0 -0
  443. package/python/lib/python3.9/lib-dynload/_ssl.cpython-39-x86_64-linux-gnu.so +0 -0
  444. package/python/lib/python3.9/lib-dynload/_statistics.cpython-39-x86_64-linux-gnu.so +0 -0
  445. package/python/lib/python3.9/lib-dynload/_struct.cpython-39-x86_64-linux-gnu.so +0 -0
  446. package/python/lib/python3.9/lib-dynload/_testbuffer.cpython-39-x86_64-linux-gnu.so +0 -0
  447. package/python/lib/python3.9/lib-dynload/_testcapi.cpython-39-x86_64-linux-gnu.so +0 -0
  448. package/python/lib/python3.9/lib-dynload/_testimportmultiple.cpython-39-x86_64-linux-gnu.so +0 -0
  449. package/python/lib/python3.9/lib-dynload/_testinternalcapi.cpython-39-x86_64-linux-gnu.so +0 -0
  450. package/python/lib/python3.9/lib-dynload/_testmultiphase.cpython-39-x86_64-linux-gnu.so +0 -0
  451. package/python/lib/python3.9/lib-dynload/_tkinter.cpython-39-x86_64-linux-gnu.so +0 -0
  452. package/python/lib/python3.9/lib-dynload/_xxsubinterpreters.cpython-39-x86_64-linux-gnu.so +0 -0
  453. package/python/lib/python3.9/lib-dynload/_xxtestfuzz.cpython-39-x86_64-linux-gnu.so +0 -0
  454. package/python/lib/python3.9/lib-dynload/_zoneinfo.cpython-39-x86_64-linux-gnu.so +0 -0
  455. package/python/lib/python3.9/lib-dynload/array.cpython-39-x86_64-linux-gnu.so +0 -0
  456. package/python/lib/python3.9/lib-dynload/audioop.cpython-39-x86_64-linux-gnu.so +0 -0
  457. package/python/lib/python3.9/lib-dynload/binascii.cpython-39-x86_64-linux-gnu.so +0 -0
  458. package/python/lib/python3.9/lib-dynload/cmath.cpython-39-x86_64-linux-gnu.so +0 -0
  459. package/python/lib/python3.9/lib-dynload/fcntl.cpython-39-x86_64-linux-gnu.so +0 -0
  460. package/python/lib/python3.9/lib-dynload/grp.cpython-39-x86_64-linux-gnu.so +0 -0
  461. package/python/lib/python3.9/lib-dynload/math.cpython-39-x86_64-linux-gnu.so +0 -0
  462. package/python/lib/python3.9/lib-dynload/mmap.cpython-39-x86_64-linux-gnu.so +0 -0
  463. package/python/lib/python3.9/lib-dynload/nis.cpython-39-x86_64-linux-gnu.so +0 -0
  464. package/python/lib/python3.9/lib-dynload/ossaudiodev.cpython-39-x86_64-linux-gnu.so +0 -0
  465. package/python/lib/python3.9/lib-dynload/parser.cpython-39-x86_64-linux-gnu.so +0 -0
  466. package/python/lib/python3.9/lib-dynload/pyexpat.cpython-39-x86_64-linux-gnu.so +0 -0
  467. package/python/lib/python3.9/lib-dynload/readline.cpython-39-x86_64-linux-gnu.so +0 -0
  468. package/python/lib/python3.9/lib-dynload/resource.cpython-39-x86_64-linux-gnu.so +0 -0
  469. package/python/lib/python3.9/lib-dynload/select.cpython-39-x86_64-linux-gnu.so +0 -0
  470. package/python/lib/python3.9/lib-dynload/spwd.cpython-39-x86_64-linux-gnu.so +0 -0
  471. package/python/lib/python3.9/lib-dynload/syslog.cpython-39-x86_64-linux-gnu.so +0 -0
  472. package/python/lib/python3.9/lib-dynload/termios.cpython-39-x86_64-linux-gnu.so +0 -0
  473. package/python/lib/python3.9/lib-dynload/unicodedata.cpython-39-x86_64-linux-gnu.so +0 -0
  474. package/python/lib/python3.9/lib-dynload/xxlimited.cpython-39-x86_64-linux-gnu.so +0 -0
  475. package/python/lib/python3.9/lib-dynload/zlib.cpython-39-x86_64-linux-gnu.so +0 -0
  476. package/python/lib/python3.9/linecache.py +177 -0
  477. package/python/lib/python3.9/locale.py +1755 -0
  478. package/python/lib/python3.9/logging/__init__.py +2208 -0
  479. package/python/lib/python3.9/logging/config.py +945 -0
  480. package/python/lib/python3.9/logging/handlers.py +1543 -0
  481. package/python/lib/python3.9/lzma.py +347 -0
  482. package/python/lib/python3.9/mailbox.py +2151 -0
  483. package/python/lib/python3.9/mailcap.py +276 -0
  484. package/python/lib/python3.9/mimetypes.py +614 -0
  485. package/python/lib/python3.9/modulefinder.py +685 -0
  486. package/python/lib/python3.9/multiprocessing/__init__.py +37 -0
  487. package/python/lib/python3.9/multiprocessing/connection.py +978 -0
  488. package/python/lib/python3.9/multiprocessing/context.py +362 -0
  489. package/python/lib/python3.9/multiprocessing/dummy/__init__.py +126 -0
  490. package/python/lib/python3.9/multiprocessing/dummy/connection.py +75 -0
  491. package/python/lib/python3.9/multiprocessing/forkserver.py +348 -0
  492. package/python/lib/python3.9/multiprocessing/heap.py +337 -0
  493. package/python/lib/python3.9/multiprocessing/managers.py +1369 -0
  494. package/python/lib/python3.9/multiprocessing/pool.py +954 -0
  495. package/python/lib/python3.9/multiprocessing/popen_fork.py +83 -0
  496. package/python/lib/python3.9/multiprocessing/popen_forkserver.py +74 -0
  497. package/python/lib/python3.9/multiprocessing/popen_spawn_posix.py +72 -0
  498. package/python/lib/python3.9/multiprocessing/popen_spawn_win32.py +131 -0
  499. package/python/lib/python3.9/multiprocessing/process.py +432 -0
  500. package/python/lib/python3.9/multiprocessing/queues.py +380 -0
  501. package/python/lib/python3.9/multiprocessing/reduction.py +281 -0
  502. package/python/lib/python3.9/multiprocessing/resource_sharer.py +154 -0
  503. package/python/lib/python3.9/multiprocessing/resource_tracker.py +231 -0
  504. package/python/lib/python3.9/multiprocessing/shared_memory.py +532 -0
  505. package/python/lib/python3.9/multiprocessing/sharedctypes.py +240 -0
  506. package/python/lib/python3.9/multiprocessing/spawn.py +297 -0
  507. package/python/lib/python3.9/multiprocessing/synchronize.py +394 -0
  508. package/python/lib/python3.9/multiprocessing/util.py +489 -0
  509. package/python/lib/python3.9/netrc.py +139 -0
  510. package/python/lib/python3.9/nntplib.py +1090 -0
  511. package/python/lib/python3.9/ntpath.py +794 -0
  512. package/python/lib/python3.9/nturl2path.py +73 -0
  513. package/python/lib/python3.9/numbers.py +389 -0
  514. package/python/lib/python3.9/opcode.py +217 -0
  515. package/python/lib/python3.9/operator.py +460 -0
  516. package/python/lib/python3.9/optparse.py +1681 -0
  517. package/python/lib/python3.9/os.py +1116 -0
  518. package/python/lib/python3.9/pathlib.py +1576 -0
  519. package/python/lib/python3.9/pdb.py +1731 -0
  520. package/python/lib/python3.9/pickle.py +1817 -0
  521. package/python/lib/python3.9/pickletools.py +2890 -0
  522. package/python/lib/python3.9/pipes.py +247 -0
  523. package/python/lib/python3.9/pkgutil.py +707 -0
  524. package/python/lib/python3.9/platform.py +1259 -0
  525. package/python/lib/python3.9/plistlib.py +881 -0
  526. package/python/lib/python3.9/poplib.py +483 -0
  527. package/python/lib/python3.9/posixpath.py +525 -0
  528. package/python/lib/python3.9/pprint.py +638 -0
  529. package/python/lib/python3.9/profile.py +600 -0
  530. package/python/lib/python3.9/pstats.py +779 -0
  531. package/python/lib/python3.9/pty.py +172 -0
  532. package/python/lib/python3.9/py_compile.py +215 -0
  533. package/python/lib/python3.9/pyclbr.py +404 -0
  534. package/python/lib/python3.9/pydoc.py +2855 -0
  535. package/python/lib/python3.9/pydoc_data/__init__.py +0 -0
  536. package/python/lib/python3.9/pydoc_data/_pydoc.css +6 -0
  537. package/python/lib/python3.9/pydoc_data/topics.py +13968 -0
  538. package/python/lib/python3.9/queue.py +326 -0
  539. package/python/lib/python3.9/quopri.py +242 -0
  540. package/python/lib/python3.9/random.py +887 -0
  541. package/python/lib/python3.9/re.py +384 -0
  542. package/python/lib/python3.9/reprlib.py +161 -0
  543. package/python/lib/python3.9/rlcompleter.py +205 -0
  544. package/python/lib/python3.9/runpy.py +300 -0
  545. package/python/lib/python3.9/sched.py +167 -0
  546. package/python/lib/python3.9/secrets.py +72 -0
  547. package/python/lib/python3.9/selectors.py +619 -0
  548. package/python/lib/python3.9/shelve.py +243 -0
  549. package/python/lib/python3.9/shlex.py +350 -0
  550. package/python/lib/python3.9/shutil.py +1443 -0
  551. package/python/lib/python3.9/signal.py +85 -0
  552. package/python/lib/python3.9/site.py +643 -0
  553. package/python/lib/python3.9/smtpd.py +967 -0
  554. package/python/lib/python3.9/smtplib.py +1123 -0
  555. package/python/lib/python3.9/sndhdr.py +257 -0
  556. package/python/lib/python3.9/socket.py +958 -0
  557. package/python/lib/python3.9/socketserver.py +817 -0
  558. package/python/lib/python3.9/sqlite3/__init__.py +23 -0
  559. package/python/lib/python3.9/sqlite3/dbapi2.py +89 -0
  560. package/python/lib/python3.9/sqlite3/dump.py +70 -0
  561. package/python/lib/python3.9/sre_compile.py +784 -0
  562. package/python/lib/python3.9/sre_constants.py +259 -0
  563. package/python/lib/python3.9/sre_parse.py +1064 -0
  564. package/python/lib/python3.9/ssl.py +1489 -0
  565. package/python/lib/python3.9/stat.py +195 -0
  566. package/python/lib/python3.9/statistics.py +1120 -0
  567. package/python/lib/python3.9/string.py +280 -0
  568. package/python/lib/python3.9/stringprep.py +272 -0
  569. package/python/lib/python3.9/struct.py +15 -0
  570. package/python/lib/python3.9/subprocess.py +2074 -0
  571. package/python/lib/python3.9/sunau.py +526 -0
  572. package/python/lib/python3.9/symbol.py +122 -0
  573. package/python/lib/python3.9/symtable.py +243 -0
  574. package/python/lib/python3.9/sysconfig.py +720 -0
  575. package/python/lib/python3.9/tabnanny.py +333 -0
  576. package/python/lib/python3.9/tarfile.py +2576 -0
  577. package/python/lib/python3.9/telnetlib.py +677 -0
  578. package/python/lib/python3.9/tempfile.py +832 -0
  579. package/python/lib/python3.9/textwrap.py +486 -0
  580. package/python/lib/python3.9/this.py +28 -0
  581. package/python/lib/python3.9/threading.py +1502 -0
  582. package/python/lib/python3.9/timeit.py +375 -0
  583. package/python/lib/python3.9/token.py +136 -0
  584. package/python/lib/python3.9/tokenize.py +682 -0
  585. package/python/lib/python3.9/trace.py +740 -0
  586. package/python/lib/python3.9/traceback.py +623 -0
  587. package/python/lib/python3.9/tracemalloc.py +560 -0
  588. package/python/lib/python3.9/tty.py +36 -0
  589. package/python/lib/python3.9/turtle.py +4140 -0
  590. package/python/lib/python3.9/types.py +299 -0
  591. package/python/lib/python3.9/typing.py +2147 -0
  592. package/python/lib/python3.9/unittest/__init__.py +95 -0
  593. package/python/lib/python3.9/unittest/__main__.py +18 -0
  594. package/python/lib/python3.9/unittest/_log.py +69 -0
  595. package/python/lib/python3.9/unittest/async_case.py +160 -0
  596. package/python/lib/python3.9/unittest/case.py +1437 -0
  597. package/python/lib/python3.9/unittest/loader.py +517 -0
  598. package/python/lib/python3.9/unittest/main.py +275 -0
  599. package/python/lib/python3.9/unittest/mock.py +2891 -0
  600. package/python/lib/python3.9/unittest/result.py +216 -0
  601. package/python/lib/python3.9/unittest/runner.py +221 -0
  602. package/python/lib/python3.9/unittest/signals.py +71 -0
  603. package/python/lib/python3.9/unittest/suite.py +361 -0
  604. package/python/lib/python3.9/unittest/util.py +170 -0
  605. package/python/lib/python3.9/urllib/__init__.py +0 -0
  606. package/python/lib/python3.9/urllib/error.py +77 -0
  607. package/python/lib/python3.9/urllib/parse.py +1179 -0
  608. package/python/lib/python3.9/urllib/request.py +2765 -0
  609. package/python/lib/python3.9/urllib/response.py +84 -0
  610. package/python/lib/python3.9/urllib/robotparser.py +273 -0
  611. package/python/lib/python3.9/uu.py +206 -0
  612. package/python/lib/python3.9/uuid.py +728 -0
  613. package/python/lib/python3.9/venv/__init__.py +504 -0
  614. package/python/lib/python3.9/venv/__main__.py +10 -0
  615. package/python/lib/python3.9/venv/scripts/common/Activate.ps1 +241 -0
  616. package/python/lib/python3.9/venv/scripts/common/activate +66 -0
  617. package/python/lib/python3.9/venv/scripts/posix/activate.csh +25 -0
  618. package/python/lib/python3.9/venv/scripts/posix/activate.fish +64 -0
  619. package/python/lib/python3.9/warnings.py +549 -0
  620. package/python/lib/python3.9/wave.py +513 -0
  621. package/python/lib/python3.9/weakref.py +664 -0
  622. package/python/lib/python3.9/webbrowser.py +713 -0
  623. package/python/lib/python3.9/wsgiref/__init__.py +23 -0
  624. package/python/lib/python3.9/wsgiref/handlers.py +571 -0
  625. package/python/lib/python3.9/wsgiref/headers.py +184 -0
  626. package/python/lib/python3.9/wsgiref/simple_server.py +165 -0
  627. package/python/lib/python3.9/wsgiref/util.py +172 -0
  628. package/python/lib/python3.9/wsgiref/validate.py +441 -0
  629. package/python/lib/python3.9/xdrlib.py +241 -0
  630. package/python/lib/python3.9/xml/__init__.py +20 -0
  631. package/python/lib/python3.9/xml/dom/NodeFilter.py +27 -0
  632. package/python/lib/python3.9/xml/dom/__init__.py +140 -0
  633. package/python/lib/python3.9/xml/dom/domreg.py +99 -0
  634. package/python/lib/python3.9/xml/dom/expatbuilder.py +965 -0
  635. package/python/lib/python3.9/xml/dom/minicompat.py +109 -0
  636. package/python/lib/python3.9/xml/dom/minidom.py +2011 -0
  637. package/python/lib/python3.9/xml/dom/pulldom.py +349 -0
  638. package/python/lib/python3.9/xml/dom/xmlbuilder.py +387 -0
  639. package/python/lib/python3.9/xml/etree/ElementInclude.py +185 -0
  640. package/python/lib/python3.9/xml/etree/ElementPath.py +405 -0
  641. package/python/lib/python3.9/xml/etree/ElementTree.py +2085 -0
  642. package/python/lib/python3.9/xml/etree/__init__.py +33 -0
  643. package/python/lib/python3.9/xml/etree/cElementTree.py +3 -0
  644. package/python/lib/python3.9/xml/parsers/__init__.py +8 -0
  645. package/python/lib/python3.9/xml/parsers/expat.py +8 -0
  646. package/python/lib/python3.9/xml/sax/__init__.py +107 -0
  647. package/python/lib/python3.9/xml/sax/_exceptions.py +131 -0
  648. package/python/lib/python3.9/xml/sax/expatreader.py +446 -0
  649. package/python/lib/python3.9/xml/sax/handler.py +342 -0
  650. package/python/lib/python3.9/xml/sax/saxutils.py +369 -0
  651. package/python/lib/python3.9/xml/sax/xmlreader.py +380 -0
  652. package/python/lib/python3.9/xmlrpc/__init__.py +1 -0
  653. package/python/lib/python3.9/xmlrpc/client.py +1524 -0
  654. package/python/lib/python3.9/xmlrpc/server.py +993 -0
  655. package/python/lib/python3.9/zipapp.py +206 -0
  656. package/python/lib/python3.9/zipfile.py +2426 -0
  657. package/python/lib/python3.9/zipimport.py +792 -0
  658. package/python/lib/python3.9/zoneinfo/__init__.py +31 -0
  659. package/python/lib/python3.9/zoneinfo/_common.py +165 -0
  660. package/python/lib/python3.9/zoneinfo/_tzpath.py +175 -0
  661. package/python/lib/python3.9/zoneinfo/_zoneinfo.py +752 -0
  662. package/python/runtime.json +1 -0
  663. package/python/ssl/cacert.pem +3959 -0
@@ -0,0 +1,1731 @@
1
+ #! /usr/bin/env python3
2
+
3
+ """
4
+ The Python Debugger Pdb
5
+ =======================
6
+
7
+ To use the debugger in its simplest form:
8
+
9
+ >>> import pdb
10
+ >>> pdb.run('<a statement>')
11
+
12
+ The debugger's prompt is '(Pdb) '. This will stop in the first
13
+ function call in <a statement>.
14
+
15
+ Alternatively, if a statement terminated with an unhandled exception,
16
+ you can use pdb's post-mortem facility to inspect the contents of the
17
+ traceback:
18
+
19
+ >>> <a statement>
20
+ <exception traceback>
21
+ >>> import pdb
22
+ >>> pdb.pm()
23
+
24
+ The commands recognized by the debugger are listed in the next
25
+ section. Most can be abbreviated as indicated; e.g., h(elp) means
26
+ that 'help' can be typed as 'h' or 'help' (but not as 'he' or 'hel',
27
+ nor as 'H' or 'Help' or 'HELP'). Optional arguments are enclosed in
28
+ square brackets. Alternatives in the command syntax are separated
29
+ by a vertical bar (|).
30
+
31
+ A blank line repeats the previous command literally, except for
32
+ 'list', where it lists the next 11 lines.
33
+
34
+ Commands that the debugger doesn't recognize are assumed to be Python
35
+ statements and are executed in the context of the program being
36
+ debugged. Python statements can also be prefixed with an exclamation
37
+ point ('!'). This is a powerful way to inspect the program being
38
+ debugged; it is even possible to change variables or call functions.
39
+ When an exception occurs in such a statement, the exception name is
40
+ printed but the debugger's state is not changed.
41
+
42
+ The debugger supports aliases, which can save typing. And aliases can
43
+ have parameters (see the alias help entry) which allows one a certain
44
+ level of adaptability to the context under examination.
45
+
46
+ Multiple commands may be entered on a single line, separated by the
47
+ pair ';;'. No intelligence is applied to separating the commands; the
48
+ input is split at the first ';;', even if it is in the middle of a
49
+ quoted string.
50
+
51
+ If a file ".pdbrc" exists in your home directory or in the current
52
+ directory, it is read in and executed as if it had been typed at the
53
+ debugger prompt. This is particularly useful for aliases. If both
54
+ files exist, the one in the home directory is read first and aliases
55
+ defined there can be overridden by the local file. This behavior can be
56
+ disabled by passing the "readrc=False" argument to the Pdb constructor.
57
+
58
+ Aside from aliases, the debugger is not directly programmable; but it
59
+ is implemented as a class from which you can derive your own debugger
60
+ class, which you can make as fancy as you like.
61
+
62
+
63
+ Debugger commands
64
+ =================
65
+
66
+ """
67
+ # NOTE: the actual command documentation is collected from docstrings of the
68
+ # commands and is appended to __doc__ after the class has been defined.
69
+
70
+ import os
71
+ import io
72
+ import re
73
+ import sys
74
+ import cmd
75
+ import bdb
76
+ import dis
77
+ import code
78
+ import glob
79
+ import pprint
80
+ import signal
81
+ import inspect
82
+ import tokenize
83
+ import traceback
84
+ import linecache
85
+
86
+
87
+ class Restart(Exception):
88
+ """Causes a debugger to be restarted for the debugged python program."""
89
+ pass
90
+
91
+ __all__ = ["run", "pm", "Pdb", "runeval", "runctx", "runcall", "set_trace",
92
+ "post_mortem", "help"]
93
+
94
+ def find_function(funcname, filename):
95
+ cre = re.compile(r'def\s+%s\s*[(]' % re.escape(funcname))
96
+ try:
97
+ fp = tokenize.open(filename)
98
+ except OSError:
99
+ return None
100
+ # consumer of this info expects the first line to be 1
101
+ with fp:
102
+ for lineno, line in enumerate(fp, start=1):
103
+ if cre.match(line):
104
+ return funcname, filename, lineno
105
+ return None
106
+
107
+ def getsourcelines(obj):
108
+ lines, lineno = inspect.findsource(obj)
109
+ if inspect.isframe(obj) and obj.f_globals is obj.f_locals:
110
+ # must be a module frame: do not try to cut a block out of it
111
+ return lines, 1
112
+ elif inspect.ismodule(obj):
113
+ return lines, 1
114
+ return inspect.getblock(lines[lineno:]), lineno+1
115
+
116
+ def lasti2lineno(code, lasti):
117
+ linestarts = list(dis.findlinestarts(code))
118
+ linestarts.reverse()
119
+ for i, lineno in linestarts:
120
+ if lasti >= i:
121
+ return lineno
122
+ return 0
123
+
124
+
125
+ class _rstr(str):
126
+ """String that doesn't quote its repr."""
127
+ def __repr__(self):
128
+ return self
129
+
130
+
131
+ # Interaction prompt line will separate file and call info from code
132
+ # text using value of line_prefix string. A newline and arrow may
133
+ # be to your liking. You can set it once pdb is imported using the
134
+ # command "pdb.line_prefix = '\n% '".
135
+ # line_prefix = ': ' # Use this to get the old situation back
136
+ line_prefix = '\n-> ' # Probably a better default
137
+
138
+ class Pdb(bdb.Bdb, cmd.Cmd):
139
+
140
+ _previous_sigint_handler = None
141
+
142
+ def __init__(self, completekey='tab', stdin=None, stdout=None, skip=None,
143
+ nosigint=False, readrc=True):
144
+ bdb.Bdb.__init__(self, skip=skip)
145
+ cmd.Cmd.__init__(self, completekey, stdin, stdout)
146
+ sys.audit("pdb.Pdb")
147
+ if stdout:
148
+ self.use_rawinput = 0
149
+ self.prompt = '(Pdb) '
150
+ self.aliases = {}
151
+ self.displaying = {}
152
+ self.mainpyfile = ''
153
+ self._wait_for_mainpyfile = False
154
+ self.tb_lineno = {}
155
+ # Try to load readline if it exists
156
+ try:
157
+ import readline
158
+ # remove some common file name delimiters
159
+ readline.set_completer_delims(' \t\n`@#$%^&*()=+[{]}\\|;:\'",<>?')
160
+ except ImportError:
161
+ pass
162
+ self.allow_kbdint = False
163
+ self.nosigint = nosigint
164
+
165
+ # Read ~/.pdbrc and ./.pdbrc
166
+ self.rcLines = []
167
+ if readrc:
168
+ try:
169
+ with open(os.path.expanduser('~/.pdbrc')) as rcFile:
170
+ self.rcLines.extend(rcFile)
171
+ except OSError:
172
+ pass
173
+ try:
174
+ with open(".pdbrc") as rcFile:
175
+ self.rcLines.extend(rcFile)
176
+ except OSError:
177
+ pass
178
+
179
+ self.commands = {} # associates a command list to breakpoint numbers
180
+ self.commands_doprompt = {} # for each bp num, tells if the prompt
181
+ # must be disp. after execing the cmd list
182
+ self.commands_silent = {} # for each bp num, tells if the stack trace
183
+ # must be disp. after execing the cmd list
184
+ self.commands_defining = False # True while in the process of defining
185
+ # a command list
186
+ self.commands_bnum = None # The breakpoint number for which we are
187
+ # defining a list
188
+
189
+ def sigint_handler(self, signum, frame):
190
+ if self.allow_kbdint:
191
+ raise KeyboardInterrupt
192
+ self.message("\nProgram interrupted. (Use 'cont' to resume).")
193
+ self.set_step()
194
+ self.set_trace(frame)
195
+
196
+ def reset(self):
197
+ bdb.Bdb.reset(self)
198
+ self.forget()
199
+
200
+ def forget(self):
201
+ self.lineno = None
202
+ self.stack = []
203
+ self.curindex = 0
204
+ self.curframe = None
205
+ self.tb_lineno.clear()
206
+
207
+ def setup(self, f, tb):
208
+ self.forget()
209
+ self.stack, self.curindex = self.get_stack(f, tb)
210
+ while tb:
211
+ # when setting up post-mortem debugging with a traceback, save all
212
+ # the original line numbers to be displayed along the current line
213
+ # numbers (which can be different, e.g. due to finally clauses)
214
+ lineno = lasti2lineno(tb.tb_frame.f_code, tb.tb_lasti)
215
+ self.tb_lineno[tb.tb_frame] = lineno
216
+ tb = tb.tb_next
217
+ self.curframe = self.stack[self.curindex][0]
218
+ # The f_locals dictionary is updated from the actual frame
219
+ # locals whenever the .f_locals accessor is called, so we
220
+ # cache it here to ensure that modifications are not overwritten.
221
+ self.curframe_locals = self.curframe.f_locals
222
+ return self.execRcLines()
223
+
224
+ # Can be executed earlier than 'setup' if desired
225
+ def execRcLines(self):
226
+ if not self.rcLines:
227
+ return
228
+ # local copy because of recursion
229
+ rcLines = self.rcLines
230
+ rcLines.reverse()
231
+ # execute every line only once
232
+ self.rcLines = []
233
+ while rcLines:
234
+ line = rcLines.pop().strip()
235
+ if line and line[0] != '#':
236
+ if self.onecmd(line):
237
+ # if onecmd returns True, the command wants to exit
238
+ # from the interaction, save leftover rc lines
239
+ # to execute before next interaction
240
+ self.rcLines += reversed(rcLines)
241
+ return True
242
+
243
+ # Override Bdb methods
244
+
245
+ def user_call(self, frame, argument_list):
246
+ """This method is called when there is the remote possibility
247
+ that we ever need to stop in this function."""
248
+ if self._wait_for_mainpyfile:
249
+ return
250
+ if self.stop_here(frame):
251
+ self.message('--Call--')
252
+ self.interaction(frame, None)
253
+
254
+ def user_line(self, frame):
255
+ """This function is called when we stop or break at this line."""
256
+ if self._wait_for_mainpyfile:
257
+ if (self.mainpyfile != self.canonic(frame.f_code.co_filename)
258
+ or frame.f_lineno <= 0):
259
+ return
260
+ self._wait_for_mainpyfile = False
261
+ if self.bp_commands(frame):
262
+ self.interaction(frame, None)
263
+
264
+ def bp_commands(self, frame):
265
+ """Call every command that was set for the current active breakpoint
266
+ (if there is one).
267
+
268
+ Returns True if the normal interaction function must be called,
269
+ False otherwise."""
270
+ # self.currentbp is set in bdb in Bdb.break_here if a breakpoint was hit
271
+ if getattr(self, "currentbp", False) and \
272
+ self.currentbp in self.commands:
273
+ currentbp = self.currentbp
274
+ self.currentbp = 0
275
+ lastcmd_back = self.lastcmd
276
+ self.setup(frame, None)
277
+ for line in self.commands[currentbp]:
278
+ self.onecmd(line)
279
+ self.lastcmd = lastcmd_back
280
+ if not self.commands_silent[currentbp]:
281
+ self.print_stack_entry(self.stack[self.curindex])
282
+ if self.commands_doprompt[currentbp]:
283
+ self._cmdloop()
284
+ self.forget()
285
+ return
286
+ return 1
287
+
288
+ def user_return(self, frame, return_value):
289
+ """This function is called when a return trap is set here."""
290
+ if self._wait_for_mainpyfile:
291
+ return
292
+ frame.f_locals['__return__'] = return_value
293
+ self.message('--Return--')
294
+ self.interaction(frame, None)
295
+
296
+ def user_exception(self, frame, exc_info):
297
+ """This function is called if an exception occurs,
298
+ but only if we are to stop at or just below this level."""
299
+ if self._wait_for_mainpyfile:
300
+ return
301
+ exc_type, exc_value, exc_traceback = exc_info
302
+ frame.f_locals['__exception__'] = exc_type, exc_value
303
+
304
+ # An 'Internal StopIteration' exception is an exception debug event
305
+ # issued by the interpreter when handling a subgenerator run with
306
+ # 'yield from' or a generator controlled by a for loop. No exception has
307
+ # actually occurred in this case. The debugger uses this debug event to
308
+ # stop when the debuggee is returning from such generators.
309
+ prefix = 'Internal ' if (not exc_traceback
310
+ and exc_type is StopIteration) else ''
311
+ self.message('%s%s' % (prefix,
312
+ traceback.format_exception_only(exc_type, exc_value)[-1].strip()))
313
+ self.interaction(frame, exc_traceback)
314
+
315
+ # General interaction function
316
+ def _cmdloop(self):
317
+ while True:
318
+ try:
319
+ # keyboard interrupts allow for an easy way to cancel
320
+ # the current command, so allow them during interactive input
321
+ self.allow_kbdint = True
322
+ self.cmdloop()
323
+ self.allow_kbdint = False
324
+ break
325
+ except KeyboardInterrupt:
326
+ self.message('--KeyboardInterrupt--')
327
+
328
+ # Called before loop, handles display expressions
329
+ def preloop(self):
330
+ displaying = self.displaying.get(self.curframe)
331
+ if displaying:
332
+ for expr, oldvalue in displaying.items():
333
+ newvalue = self._getval_except(expr)
334
+ # check for identity first; this prevents custom __eq__ to
335
+ # be called at every loop, and also prevents instances whose
336
+ # fields are changed to be displayed
337
+ if newvalue is not oldvalue and newvalue != oldvalue:
338
+ displaying[expr] = newvalue
339
+ self.message('display %s: %r [old: %r]' %
340
+ (expr, newvalue, oldvalue))
341
+
342
+ def interaction(self, frame, traceback):
343
+ # Restore the previous signal handler at the Pdb prompt.
344
+ if Pdb._previous_sigint_handler:
345
+ try:
346
+ signal.signal(signal.SIGINT, Pdb._previous_sigint_handler)
347
+ except ValueError: # ValueError: signal only works in main thread
348
+ pass
349
+ else:
350
+ Pdb._previous_sigint_handler = None
351
+ if self.setup(frame, traceback):
352
+ # no interaction desired at this time (happens if .pdbrc contains
353
+ # a command like "continue")
354
+ self.forget()
355
+ return
356
+ self.print_stack_entry(self.stack[self.curindex])
357
+ self._cmdloop()
358
+ self.forget()
359
+
360
+ def displayhook(self, obj):
361
+ """Custom displayhook for the exec in default(), which prevents
362
+ assignment of the _ variable in the builtins.
363
+ """
364
+ # reproduce the behavior of the standard displayhook, not printing None
365
+ if obj is not None:
366
+ self.message(repr(obj))
367
+
368
+ def default(self, line):
369
+ if line[:1] == '!': line = line[1:]
370
+ locals = self.curframe_locals
371
+ globals = self.curframe.f_globals
372
+ try:
373
+ code = compile(line + '\n', '<stdin>', 'single')
374
+ save_stdout = sys.stdout
375
+ save_stdin = sys.stdin
376
+ save_displayhook = sys.displayhook
377
+ try:
378
+ sys.stdin = self.stdin
379
+ sys.stdout = self.stdout
380
+ sys.displayhook = self.displayhook
381
+ exec(code, globals, locals)
382
+ finally:
383
+ sys.stdout = save_stdout
384
+ sys.stdin = save_stdin
385
+ sys.displayhook = save_displayhook
386
+ except:
387
+ exc_info = sys.exc_info()[:2]
388
+ self.error(traceback.format_exception_only(*exc_info)[-1].strip())
389
+
390
+ def precmd(self, line):
391
+ """Handle alias expansion and ';;' separator."""
392
+ if not line.strip():
393
+ return line
394
+ args = line.split()
395
+ while args[0] in self.aliases:
396
+ line = self.aliases[args[0]]
397
+ ii = 1
398
+ for tmpArg in args[1:]:
399
+ line = line.replace("%" + str(ii),
400
+ tmpArg)
401
+ ii += 1
402
+ line = line.replace("%*", ' '.join(args[1:]))
403
+ args = line.split()
404
+ # split into ';;' separated commands
405
+ # unless it's an alias command
406
+ if args[0] != 'alias':
407
+ marker = line.find(';;')
408
+ if marker >= 0:
409
+ # queue up everything after marker
410
+ next = line[marker+2:].lstrip()
411
+ self.cmdqueue.append(next)
412
+ line = line[:marker].rstrip()
413
+ return line
414
+
415
+ def onecmd(self, line):
416
+ """Interpret the argument as though it had been typed in response
417
+ to the prompt.
418
+
419
+ Checks whether this line is typed at the normal prompt or in
420
+ a breakpoint command list definition.
421
+ """
422
+ if not self.commands_defining:
423
+ return cmd.Cmd.onecmd(self, line)
424
+ else:
425
+ return self.handle_command_def(line)
426
+
427
+ def handle_command_def(self, line):
428
+ """Handles one command line during command list definition."""
429
+ cmd, arg, line = self.parseline(line)
430
+ if not cmd:
431
+ return
432
+ if cmd == 'silent':
433
+ self.commands_silent[self.commands_bnum] = True
434
+ return # continue to handle other cmd def in the cmd list
435
+ elif cmd == 'end':
436
+ self.cmdqueue = []
437
+ return 1 # end of cmd list
438
+ cmdlist = self.commands[self.commands_bnum]
439
+ if arg:
440
+ cmdlist.append(cmd+' '+arg)
441
+ else:
442
+ cmdlist.append(cmd)
443
+ # Determine if we must stop
444
+ try:
445
+ func = getattr(self, 'do_' + cmd)
446
+ except AttributeError:
447
+ func = self.default
448
+ # one of the resuming commands
449
+ if func.__name__ in self.commands_resuming:
450
+ self.commands_doprompt[self.commands_bnum] = False
451
+ self.cmdqueue = []
452
+ return 1
453
+ return
454
+
455
+ # interface abstraction functions
456
+
457
+ def message(self, msg):
458
+ print(msg, file=self.stdout)
459
+
460
+ def error(self, msg):
461
+ print('***', msg, file=self.stdout)
462
+
463
+ # Generic completion functions. Individual complete_foo methods can be
464
+ # assigned below to one of these functions.
465
+
466
+ def _complete_location(self, text, line, begidx, endidx):
467
+ # Complete a file/module/function location for break/tbreak/clear.
468
+ if line.strip().endswith((':', ',')):
469
+ # Here comes a line number or a condition which we can't complete.
470
+ return []
471
+ # First, try to find matching functions (i.e. expressions).
472
+ try:
473
+ ret = self._complete_expression(text, line, begidx, endidx)
474
+ except Exception:
475
+ ret = []
476
+ # Then, try to complete file names as well.
477
+ globs = glob.glob(glob.escape(text) + '*')
478
+ for fn in globs:
479
+ if os.path.isdir(fn):
480
+ ret.append(fn + '/')
481
+ elif os.path.isfile(fn) and fn.lower().endswith(('.py', '.pyw')):
482
+ ret.append(fn + ':')
483
+ return ret
484
+
485
+ def _complete_bpnumber(self, text, line, begidx, endidx):
486
+ # Complete a breakpoint number. (This would be more helpful if we could
487
+ # display additional info along with the completions, such as file/line
488
+ # of the breakpoint.)
489
+ return [str(i) for i, bp in enumerate(bdb.Breakpoint.bpbynumber)
490
+ if bp is not None and str(i).startswith(text)]
491
+
492
+ def _complete_expression(self, text, line, begidx, endidx):
493
+ # Complete an arbitrary expression.
494
+ if not self.curframe:
495
+ return []
496
+ # Collect globals and locals. It is usually not really sensible to also
497
+ # complete builtins, and they clutter the namespace quite heavily, so we
498
+ # leave them out.
499
+ ns = {**self.curframe.f_globals, **self.curframe_locals}
500
+ if '.' in text:
501
+ # Walk an attribute chain up to the last part, similar to what
502
+ # rlcompleter does. This will bail if any of the parts are not
503
+ # simple attribute access, which is what we want.
504
+ dotted = text.split('.')
505
+ try:
506
+ obj = ns[dotted[0]]
507
+ for part in dotted[1:-1]:
508
+ obj = getattr(obj, part)
509
+ except (KeyError, AttributeError):
510
+ return []
511
+ prefix = '.'.join(dotted[:-1]) + '.'
512
+ return [prefix + n for n in dir(obj) if n.startswith(dotted[-1])]
513
+ else:
514
+ # Complete a simple name.
515
+ return [n for n in ns.keys() if n.startswith(text)]
516
+
517
+ # Command definitions, called by cmdloop()
518
+ # The argument is the remaining string on the command line
519
+ # Return true to exit from the command loop
520
+
521
+ def do_commands(self, arg):
522
+ """commands [bpnumber]
523
+ (com) ...
524
+ (com) end
525
+ (Pdb)
526
+
527
+ Specify a list of commands for breakpoint number bpnumber.
528
+ The commands themselves are entered on the following lines.
529
+ Type a line containing just 'end' to terminate the commands.
530
+ The commands are executed when the breakpoint is hit.
531
+
532
+ To remove all commands from a breakpoint, type commands and
533
+ follow it immediately with end; that is, give no commands.
534
+
535
+ With no bpnumber argument, commands refers to the last
536
+ breakpoint set.
537
+
538
+ You can use breakpoint commands to start your program up
539
+ again. Simply use the continue command, or step, or any other
540
+ command that resumes execution.
541
+
542
+ Specifying any command resuming execution (currently continue,
543
+ step, next, return, jump, quit and their abbreviations)
544
+ terminates the command list (as if that command was
545
+ immediately followed by end). This is because any time you
546
+ resume execution (even with a simple next or step), you may
547
+ encounter another breakpoint -- which could have its own
548
+ command list, leading to ambiguities about which list to
549
+ execute.
550
+
551
+ If you use the 'silent' command in the command list, the usual
552
+ message about stopping at a breakpoint is not printed. This
553
+ may be desirable for breakpoints that are to print a specific
554
+ message and then continue. If none of the other commands
555
+ print anything, you will see no sign that the breakpoint was
556
+ reached.
557
+ """
558
+ if not arg:
559
+ bnum = len(bdb.Breakpoint.bpbynumber) - 1
560
+ else:
561
+ try:
562
+ bnum = int(arg)
563
+ except:
564
+ self.error("Usage: commands [bnum]\n ...\n end")
565
+ return
566
+ self.commands_bnum = bnum
567
+ # Save old definitions for the case of a keyboard interrupt.
568
+ if bnum in self.commands:
569
+ old_command_defs = (self.commands[bnum],
570
+ self.commands_doprompt[bnum],
571
+ self.commands_silent[bnum])
572
+ else:
573
+ old_command_defs = None
574
+ self.commands[bnum] = []
575
+ self.commands_doprompt[bnum] = True
576
+ self.commands_silent[bnum] = False
577
+
578
+ prompt_back = self.prompt
579
+ self.prompt = '(com) '
580
+ self.commands_defining = True
581
+ try:
582
+ self.cmdloop()
583
+ except KeyboardInterrupt:
584
+ # Restore old definitions.
585
+ if old_command_defs:
586
+ self.commands[bnum] = old_command_defs[0]
587
+ self.commands_doprompt[bnum] = old_command_defs[1]
588
+ self.commands_silent[bnum] = old_command_defs[2]
589
+ else:
590
+ del self.commands[bnum]
591
+ del self.commands_doprompt[bnum]
592
+ del self.commands_silent[bnum]
593
+ self.error('command definition aborted, old commands restored')
594
+ finally:
595
+ self.commands_defining = False
596
+ self.prompt = prompt_back
597
+
598
+ complete_commands = _complete_bpnumber
599
+
600
+ def do_break(self, arg, temporary = 0):
601
+ """b(reak) [ ([filename:]lineno | function) [, condition] ]
602
+ Without argument, list all breaks.
603
+
604
+ With a line number argument, set a break at this line in the
605
+ current file. With a function name, set a break at the first
606
+ executable line of that function. If a second argument is
607
+ present, it is a string specifying an expression which must
608
+ evaluate to true before the breakpoint is honored.
609
+
610
+ The line number may be prefixed with a filename and a colon,
611
+ to specify a breakpoint in another file (probably one that
612
+ hasn't been loaded yet). The file is searched for on
613
+ sys.path; the .py suffix may be omitted.
614
+ """
615
+ if not arg:
616
+ if self.breaks: # There's at least one
617
+ self.message("Num Type Disp Enb Where")
618
+ for bp in bdb.Breakpoint.bpbynumber:
619
+ if bp:
620
+ self.message(bp.bpformat())
621
+ return
622
+ # parse arguments; comma has lowest precedence
623
+ # and cannot occur in filename
624
+ filename = None
625
+ lineno = None
626
+ cond = None
627
+ comma = arg.find(',')
628
+ if comma > 0:
629
+ # parse stuff after comma: "condition"
630
+ cond = arg[comma+1:].lstrip()
631
+ arg = arg[:comma].rstrip()
632
+ # parse stuff before comma: [filename:]lineno | function
633
+ colon = arg.rfind(':')
634
+ funcname = None
635
+ if colon >= 0:
636
+ filename = arg[:colon].rstrip()
637
+ f = self.lookupmodule(filename)
638
+ if not f:
639
+ self.error('%r not found from sys.path' % filename)
640
+ return
641
+ else:
642
+ filename = f
643
+ arg = arg[colon+1:].lstrip()
644
+ try:
645
+ lineno = int(arg)
646
+ except ValueError:
647
+ self.error('Bad lineno: %s' % arg)
648
+ return
649
+ else:
650
+ # no colon; can be lineno or function
651
+ try:
652
+ lineno = int(arg)
653
+ except ValueError:
654
+ try:
655
+ func = eval(arg,
656
+ self.curframe.f_globals,
657
+ self.curframe_locals)
658
+ except:
659
+ func = arg
660
+ try:
661
+ if hasattr(func, '__func__'):
662
+ func = func.__func__
663
+ code = func.__code__
664
+ #use co_name to identify the bkpt (function names
665
+ #could be aliased, but co_name is invariant)
666
+ funcname = code.co_name
667
+ lineno = code.co_firstlineno
668
+ filename = code.co_filename
669
+ except:
670
+ # last thing to try
671
+ (ok, filename, ln) = self.lineinfo(arg)
672
+ if not ok:
673
+ self.error('The specified object %r is not a function '
674
+ 'or was not found along sys.path.' % arg)
675
+ return
676
+ funcname = ok # ok contains a function name
677
+ lineno = int(ln)
678
+ if not filename:
679
+ filename = self.defaultFile()
680
+ # Check for reasonable breakpoint
681
+ line = self.checkline(filename, lineno)
682
+ if line:
683
+ # now set the break point
684
+ err = self.set_break(filename, line, temporary, cond, funcname)
685
+ if err:
686
+ self.error(err)
687
+ else:
688
+ bp = self.get_breaks(filename, line)[-1]
689
+ self.message("Breakpoint %d at %s:%d" %
690
+ (bp.number, bp.file, bp.line))
691
+
692
+ # To be overridden in derived debuggers
693
+ def defaultFile(self):
694
+ """Produce a reasonable default."""
695
+ filename = self.curframe.f_code.co_filename
696
+ if filename == '<string>' and self.mainpyfile:
697
+ filename = self.mainpyfile
698
+ return filename
699
+
700
+ do_b = do_break
701
+
702
+ complete_break = _complete_location
703
+ complete_b = _complete_location
704
+
705
+ def do_tbreak(self, arg):
706
+ """tbreak [ ([filename:]lineno | function) [, condition] ]
707
+ Same arguments as break, but sets a temporary breakpoint: it
708
+ is automatically deleted when first hit.
709
+ """
710
+ self.do_break(arg, 1)
711
+
712
+ complete_tbreak = _complete_location
713
+
714
+ def lineinfo(self, identifier):
715
+ failed = (None, None, None)
716
+ # Input is identifier, may be in single quotes
717
+ idstring = identifier.split("'")
718
+ if len(idstring) == 1:
719
+ # not in single quotes
720
+ id = idstring[0].strip()
721
+ elif len(idstring) == 3:
722
+ # quoted
723
+ id = idstring[1].strip()
724
+ else:
725
+ return failed
726
+ if id == '': return failed
727
+ parts = id.split('.')
728
+ # Protection for derived debuggers
729
+ if parts[0] == 'self':
730
+ del parts[0]
731
+ if len(parts) == 0:
732
+ return failed
733
+ # Best first guess at file to look at
734
+ fname = self.defaultFile()
735
+ if len(parts) == 1:
736
+ item = parts[0]
737
+ else:
738
+ # More than one part.
739
+ # First is module, second is method/class
740
+ f = self.lookupmodule(parts[0])
741
+ if f:
742
+ fname = f
743
+ item = parts[1]
744
+ answer = find_function(item, fname)
745
+ return answer or failed
746
+
747
+ def checkline(self, filename, lineno):
748
+ """Check whether specified line seems to be executable.
749
+
750
+ Return `lineno` if it is, 0 if not (e.g. a docstring, comment, blank
751
+ line or EOF). Warning: testing is not comprehensive.
752
+ """
753
+ # this method should be callable before starting debugging, so default
754
+ # to "no globals" if there is no current frame
755
+ globs = self.curframe.f_globals if hasattr(self, 'curframe') else None
756
+ line = linecache.getline(filename, lineno, globs)
757
+ if not line:
758
+ self.message('End of file')
759
+ return 0
760
+ line = line.strip()
761
+ # Don't allow setting breakpoint at a blank line
762
+ if (not line or (line[0] == '#') or
763
+ (line[:3] == '"""') or line[:3] == "'''"):
764
+ self.error('Blank or comment')
765
+ return 0
766
+ return lineno
767
+
768
+ def do_enable(self, arg):
769
+ """enable bpnumber [bpnumber ...]
770
+ Enables the breakpoints given as a space separated list of
771
+ breakpoint numbers.
772
+ """
773
+ args = arg.split()
774
+ for i in args:
775
+ try:
776
+ bp = self.get_bpbynumber(i)
777
+ except ValueError as err:
778
+ self.error(err)
779
+ else:
780
+ bp.enable()
781
+ self.message('Enabled %s' % bp)
782
+
783
+ complete_enable = _complete_bpnumber
784
+
785
+ def do_disable(self, arg):
786
+ """disable bpnumber [bpnumber ...]
787
+ Disables the breakpoints given as a space separated list of
788
+ breakpoint numbers. Disabling a breakpoint means it cannot
789
+ cause the program to stop execution, but unlike clearing a
790
+ breakpoint, it remains in the list of breakpoints and can be
791
+ (re-)enabled.
792
+ """
793
+ args = arg.split()
794
+ for i in args:
795
+ try:
796
+ bp = self.get_bpbynumber(i)
797
+ except ValueError as err:
798
+ self.error(err)
799
+ else:
800
+ bp.disable()
801
+ self.message('Disabled %s' % bp)
802
+
803
+ complete_disable = _complete_bpnumber
804
+
805
+ def do_condition(self, arg):
806
+ """condition bpnumber [condition]
807
+ Set a new condition for the breakpoint, an expression which
808
+ must evaluate to true before the breakpoint is honored. If
809
+ condition is absent, any existing condition is removed; i.e.,
810
+ the breakpoint is made unconditional.
811
+ """
812
+ args = arg.split(' ', 1)
813
+ try:
814
+ cond = args[1]
815
+ except IndexError:
816
+ cond = None
817
+ try:
818
+ bp = self.get_bpbynumber(args[0].strip())
819
+ except IndexError:
820
+ self.error('Breakpoint number expected')
821
+ except ValueError as err:
822
+ self.error(err)
823
+ else:
824
+ bp.cond = cond
825
+ if not cond:
826
+ self.message('Breakpoint %d is now unconditional.' % bp.number)
827
+ else:
828
+ self.message('New condition set for breakpoint %d.' % bp.number)
829
+
830
+ complete_condition = _complete_bpnumber
831
+
832
+ def do_ignore(self, arg):
833
+ """ignore bpnumber [count]
834
+ Set the ignore count for the given breakpoint number. If
835
+ count is omitted, the ignore count is set to 0. A breakpoint
836
+ becomes active when the ignore count is zero. When non-zero,
837
+ the count is decremented each time the breakpoint is reached
838
+ and the breakpoint is not disabled and any associated
839
+ condition evaluates to true.
840
+ """
841
+ args = arg.split()
842
+ try:
843
+ count = int(args[1].strip())
844
+ except:
845
+ count = 0
846
+ try:
847
+ bp = self.get_bpbynumber(args[0].strip())
848
+ except IndexError:
849
+ self.error('Breakpoint number expected')
850
+ except ValueError as err:
851
+ self.error(err)
852
+ else:
853
+ bp.ignore = count
854
+ if count > 0:
855
+ if count > 1:
856
+ countstr = '%d crossings' % count
857
+ else:
858
+ countstr = '1 crossing'
859
+ self.message('Will ignore next %s of breakpoint %d.' %
860
+ (countstr, bp.number))
861
+ else:
862
+ self.message('Will stop next time breakpoint %d is reached.'
863
+ % bp.number)
864
+
865
+ complete_ignore = _complete_bpnumber
866
+
867
+ def do_clear(self, arg):
868
+ """cl(ear) filename:lineno\ncl(ear) [bpnumber [bpnumber...]]
869
+ With a space separated list of breakpoint numbers, clear
870
+ those breakpoints. Without argument, clear all breaks (but
871
+ first ask confirmation). With a filename:lineno argument,
872
+ clear all breaks at that line in that file.
873
+ """
874
+ if not arg:
875
+ try:
876
+ reply = input('Clear all breaks? ')
877
+ except EOFError:
878
+ reply = 'no'
879
+ reply = reply.strip().lower()
880
+ if reply in ('y', 'yes'):
881
+ bplist = [bp for bp in bdb.Breakpoint.bpbynumber if bp]
882
+ self.clear_all_breaks()
883
+ for bp in bplist:
884
+ self.message('Deleted %s' % bp)
885
+ return
886
+ if ':' in arg:
887
+ # Make sure it works for "clear C:\foo\bar.py:12"
888
+ i = arg.rfind(':')
889
+ filename = arg[:i]
890
+ arg = arg[i+1:]
891
+ try:
892
+ lineno = int(arg)
893
+ except ValueError:
894
+ err = "Invalid line number (%s)" % arg
895
+ else:
896
+ bplist = self.get_breaks(filename, lineno)
897
+ err = self.clear_break(filename, lineno)
898
+ if err:
899
+ self.error(err)
900
+ else:
901
+ for bp in bplist:
902
+ self.message('Deleted %s' % bp)
903
+ return
904
+ numberlist = arg.split()
905
+ for i in numberlist:
906
+ try:
907
+ bp = self.get_bpbynumber(i)
908
+ except ValueError as err:
909
+ self.error(err)
910
+ else:
911
+ self.clear_bpbynumber(i)
912
+ self.message('Deleted %s' % bp)
913
+ do_cl = do_clear # 'c' is already an abbreviation for 'continue'
914
+
915
+ complete_clear = _complete_location
916
+ complete_cl = _complete_location
917
+
918
+ def do_where(self, arg):
919
+ """w(here)
920
+ Print a stack trace, with the most recent frame at the bottom.
921
+ An arrow indicates the "current frame", which determines the
922
+ context of most commands. 'bt' is an alias for this command.
923
+ """
924
+ self.print_stack_trace()
925
+ do_w = do_where
926
+ do_bt = do_where
927
+
928
+ def _select_frame(self, number):
929
+ assert 0 <= number < len(self.stack)
930
+ self.curindex = number
931
+ self.curframe = self.stack[self.curindex][0]
932
+ self.curframe_locals = self.curframe.f_locals
933
+ self.print_stack_entry(self.stack[self.curindex])
934
+ self.lineno = None
935
+
936
+ def do_up(self, arg):
937
+ """u(p) [count]
938
+ Move the current frame count (default one) levels up in the
939
+ stack trace (to an older frame).
940
+ """
941
+ if self.curindex == 0:
942
+ self.error('Oldest frame')
943
+ return
944
+ try:
945
+ count = int(arg or 1)
946
+ except ValueError:
947
+ self.error('Invalid frame count (%s)' % arg)
948
+ return
949
+ if count < 0:
950
+ newframe = 0
951
+ else:
952
+ newframe = max(0, self.curindex - count)
953
+ self._select_frame(newframe)
954
+ do_u = do_up
955
+
956
+ def do_down(self, arg):
957
+ """d(own) [count]
958
+ Move the current frame count (default one) levels down in the
959
+ stack trace (to a newer frame).
960
+ """
961
+ if self.curindex + 1 == len(self.stack):
962
+ self.error('Newest frame')
963
+ return
964
+ try:
965
+ count = int(arg or 1)
966
+ except ValueError:
967
+ self.error('Invalid frame count (%s)' % arg)
968
+ return
969
+ if count < 0:
970
+ newframe = len(self.stack) - 1
971
+ else:
972
+ newframe = min(len(self.stack) - 1, self.curindex + count)
973
+ self._select_frame(newframe)
974
+ do_d = do_down
975
+
976
+ def do_until(self, arg):
977
+ """unt(il) [lineno]
978
+ Without argument, continue execution until the line with a
979
+ number greater than the current one is reached. With a line
980
+ number, continue execution until a line with a number greater
981
+ or equal to that is reached. In both cases, also stop when
982
+ the current frame returns.
983
+ """
984
+ if arg:
985
+ try:
986
+ lineno = int(arg)
987
+ except ValueError:
988
+ self.error('Error in argument: %r' % arg)
989
+ return
990
+ if lineno <= self.curframe.f_lineno:
991
+ self.error('"until" line number is smaller than current '
992
+ 'line number')
993
+ return
994
+ else:
995
+ lineno = None
996
+ self.set_until(self.curframe, lineno)
997
+ return 1
998
+ do_unt = do_until
999
+
1000
+ def do_step(self, arg):
1001
+ """s(tep)
1002
+ Execute the current line, stop at the first possible occasion
1003
+ (either in a function that is called or in the current
1004
+ function).
1005
+ """
1006
+ self.set_step()
1007
+ return 1
1008
+ do_s = do_step
1009
+
1010
+ def do_next(self, arg):
1011
+ """n(ext)
1012
+ Continue execution until the next line in the current function
1013
+ is reached or it returns.
1014
+ """
1015
+ self.set_next(self.curframe)
1016
+ return 1
1017
+ do_n = do_next
1018
+
1019
+ def do_run(self, arg):
1020
+ """run [args...]
1021
+ Restart the debugged python program. If a string is supplied
1022
+ it is split with "shlex", and the result is used as the new
1023
+ sys.argv. History, breakpoints, actions and debugger options
1024
+ are preserved. "restart" is an alias for "run".
1025
+ """
1026
+ if arg:
1027
+ import shlex
1028
+ argv0 = sys.argv[0:1]
1029
+ sys.argv = shlex.split(arg)
1030
+ sys.argv[:0] = argv0
1031
+ # this is caught in the main debugger loop
1032
+ raise Restart
1033
+
1034
+ do_restart = do_run
1035
+
1036
+ def do_return(self, arg):
1037
+ """r(eturn)
1038
+ Continue execution until the current function returns.
1039
+ """
1040
+ self.set_return(self.curframe)
1041
+ return 1
1042
+ do_r = do_return
1043
+
1044
+ def do_continue(self, arg):
1045
+ """c(ont(inue))
1046
+ Continue execution, only stop when a breakpoint is encountered.
1047
+ """
1048
+ if not self.nosigint:
1049
+ try:
1050
+ Pdb._previous_sigint_handler = \
1051
+ signal.signal(signal.SIGINT, self.sigint_handler)
1052
+ except ValueError:
1053
+ # ValueError happens when do_continue() is invoked from
1054
+ # a non-main thread in which case we just continue without
1055
+ # SIGINT set. Would printing a message here (once) make
1056
+ # sense?
1057
+ pass
1058
+ self.set_continue()
1059
+ return 1
1060
+ do_c = do_cont = do_continue
1061
+
1062
+ def do_jump(self, arg):
1063
+ """j(ump) lineno
1064
+ Set the next line that will be executed. Only available in
1065
+ the bottom-most frame. This lets you jump back and execute
1066
+ code again, or jump forward to skip code that you don't want
1067
+ to run.
1068
+
1069
+ It should be noted that not all jumps are allowed -- for
1070
+ instance it is not possible to jump into the middle of a
1071
+ for loop or out of a finally clause.
1072
+ """
1073
+ if self.curindex + 1 != len(self.stack):
1074
+ self.error('You can only jump within the bottom frame')
1075
+ return
1076
+ try:
1077
+ arg = int(arg)
1078
+ except ValueError:
1079
+ self.error("The 'jump' command requires a line number")
1080
+ else:
1081
+ try:
1082
+ # Do the jump, fix up our copy of the stack, and display the
1083
+ # new position
1084
+ self.curframe.f_lineno = arg
1085
+ self.stack[self.curindex] = self.stack[self.curindex][0], arg
1086
+ self.print_stack_entry(self.stack[self.curindex])
1087
+ except ValueError as e:
1088
+ self.error('Jump failed: %s' % e)
1089
+ do_j = do_jump
1090
+
1091
+ def do_debug(self, arg):
1092
+ """debug code
1093
+ Enter a recursive debugger that steps through the code
1094
+ argument (which is an arbitrary expression or statement to be
1095
+ executed in the current environment).
1096
+ """
1097
+ sys.settrace(None)
1098
+ globals = self.curframe.f_globals
1099
+ locals = self.curframe_locals
1100
+ p = Pdb(self.completekey, self.stdin, self.stdout)
1101
+ p.prompt = "(%s) " % self.prompt.strip()
1102
+ self.message("ENTERING RECURSIVE DEBUGGER")
1103
+ try:
1104
+ sys.call_tracing(p.run, (arg, globals, locals))
1105
+ except Exception:
1106
+ exc_info = sys.exc_info()[:2]
1107
+ self.error(traceback.format_exception_only(*exc_info)[-1].strip())
1108
+ self.message("LEAVING RECURSIVE DEBUGGER")
1109
+ sys.settrace(self.trace_dispatch)
1110
+ self.lastcmd = p.lastcmd
1111
+
1112
+ complete_debug = _complete_expression
1113
+
1114
+ def do_quit(self, arg):
1115
+ """q(uit)\nexit
1116
+ Quit from the debugger. The program being executed is aborted.
1117
+ """
1118
+ self._user_requested_quit = True
1119
+ self.set_quit()
1120
+ return 1
1121
+
1122
+ do_q = do_quit
1123
+ do_exit = do_quit
1124
+
1125
+ def do_EOF(self, arg):
1126
+ """EOF
1127
+ Handles the receipt of EOF as a command.
1128
+ """
1129
+ self.message('')
1130
+ self._user_requested_quit = True
1131
+ self.set_quit()
1132
+ return 1
1133
+
1134
+ def do_args(self, arg):
1135
+ """a(rgs)
1136
+ Print the argument list of the current function.
1137
+ """
1138
+ co = self.curframe.f_code
1139
+ dict = self.curframe_locals
1140
+ n = co.co_argcount + co.co_kwonlyargcount
1141
+ if co.co_flags & inspect.CO_VARARGS: n = n+1
1142
+ if co.co_flags & inspect.CO_VARKEYWORDS: n = n+1
1143
+ for i in range(n):
1144
+ name = co.co_varnames[i]
1145
+ if name in dict:
1146
+ self.message('%s = %r' % (name, dict[name]))
1147
+ else:
1148
+ self.message('%s = *** undefined ***' % (name,))
1149
+ do_a = do_args
1150
+
1151
+ def do_retval(self, arg):
1152
+ """retval
1153
+ Print the return value for the last return of a function.
1154
+ """
1155
+ if '__return__' in self.curframe_locals:
1156
+ self.message(repr(self.curframe_locals['__return__']))
1157
+ else:
1158
+ self.error('Not yet returned!')
1159
+ do_rv = do_retval
1160
+
1161
+ def _getval(self, arg):
1162
+ try:
1163
+ return eval(arg, self.curframe.f_globals, self.curframe_locals)
1164
+ except:
1165
+ exc_info = sys.exc_info()[:2]
1166
+ self.error(traceback.format_exception_only(*exc_info)[-1].strip())
1167
+ raise
1168
+
1169
+ def _getval_except(self, arg, frame=None):
1170
+ try:
1171
+ if frame is None:
1172
+ return eval(arg, self.curframe.f_globals, self.curframe_locals)
1173
+ else:
1174
+ return eval(arg, frame.f_globals, frame.f_locals)
1175
+ except:
1176
+ exc_info = sys.exc_info()[:2]
1177
+ err = traceback.format_exception_only(*exc_info)[-1].strip()
1178
+ return _rstr('** raised %s **' % err)
1179
+
1180
+ def do_p(self, arg):
1181
+ """p expression
1182
+ Print the value of the expression.
1183
+ """
1184
+ try:
1185
+ self.message(repr(self._getval(arg)))
1186
+ except:
1187
+ pass
1188
+
1189
+ def do_pp(self, arg):
1190
+ """pp expression
1191
+ Pretty-print the value of the expression.
1192
+ """
1193
+ try:
1194
+ self.message(pprint.pformat(self._getval(arg)))
1195
+ except:
1196
+ pass
1197
+
1198
+ complete_print = _complete_expression
1199
+ complete_p = _complete_expression
1200
+ complete_pp = _complete_expression
1201
+
1202
+ def do_list(self, arg):
1203
+ """l(ist) [first [,last] | .]
1204
+
1205
+ List source code for the current file. Without arguments,
1206
+ list 11 lines around the current line or continue the previous
1207
+ listing. With . as argument, list 11 lines around the current
1208
+ line. With one argument, list 11 lines starting at that line.
1209
+ With two arguments, list the given range; if the second
1210
+ argument is less than the first, it is a count.
1211
+
1212
+ The current line in the current frame is indicated by "->".
1213
+ If an exception is being debugged, the line where the
1214
+ exception was originally raised or propagated is indicated by
1215
+ ">>", if it differs from the current line.
1216
+ """
1217
+ self.lastcmd = 'list'
1218
+ last = None
1219
+ if arg and arg != '.':
1220
+ try:
1221
+ if ',' in arg:
1222
+ first, last = arg.split(',')
1223
+ first = int(first.strip())
1224
+ last = int(last.strip())
1225
+ if last < first:
1226
+ # assume it's a count
1227
+ last = first + last
1228
+ else:
1229
+ first = int(arg.strip())
1230
+ first = max(1, first - 5)
1231
+ except ValueError:
1232
+ self.error('Error in argument: %r' % arg)
1233
+ return
1234
+ elif self.lineno is None or arg == '.':
1235
+ first = max(1, self.curframe.f_lineno - 5)
1236
+ else:
1237
+ first = self.lineno + 1
1238
+ if last is None:
1239
+ last = first + 10
1240
+ filename = self.curframe.f_code.co_filename
1241
+ breaklist = self.get_file_breaks(filename)
1242
+ try:
1243
+ lines = linecache.getlines(filename, self.curframe.f_globals)
1244
+ self._print_lines(lines[first-1:last], first, breaklist,
1245
+ self.curframe)
1246
+ self.lineno = min(last, len(lines))
1247
+ if len(lines) < last:
1248
+ self.message('[EOF]')
1249
+ except KeyboardInterrupt:
1250
+ pass
1251
+ do_l = do_list
1252
+
1253
+ def do_longlist(self, arg):
1254
+ """longlist | ll
1255
+ List the whole source code for the current function or frame.
1256
+ """
1257
+ filename = self.curframe.f_code.co_filename
1258
+ breaklist = self.get_file_breaks(filename)
1259
+ try:
1260
+ lines, lineno = getsourcelines(self.curframe)
1261
+ except OSError as err:
1262
+ self.error(err)
1263
+ return
1264
+ self._print_lines(lines, lineno, breaklist, self.curframe)
1265
+ do_ll = do_longlist
1266
+
1267
+ def do_source(self, arg):
1268
+ """source expression
1269
+ Try to get source code for the given object and display it.
1270
+ """
1271
+ try:
1272
+ obj = self._getval(arg)
1273
+ except:
1274
+ return
1275
+ try:
1276
+ lines, lineno = getsourcelines(obj)
1277
+ except (OSError, TypeError) as err:
1278
+ self.error(err)
1279
+ return
1280
+ self._print_lines(lines, lineno)
1281
+
1282
+ complete_source = _complete_expression
1283
+
1284
+ def _print_lines(self, lines, start, breaks=(), frame=None):
1285
+ """Print a range of lines."""
1286
+ if frame:
1287
+ current_lineno = frame.f_lineno
1288
+ exc_lineno = self.tb_lineno.get(frame, -1)
1289
+ else:
1290
+ current_lineno = exc_lineno = -1
1291
+ for lineno, line in enumerate(lines, start):
1292
+ s = str(lineno).rjust(3)
1293
+ if len(s) < 4:
1294
+ s += ' '
1295
+ if lineno in breaks:
1296
+ s += 'B'
1297
+ else:
1298
+ s += ' '
1299
+ if lineno == current_lineno:
1300
+ s += '->'
1301
+ elif lineno == exc_lineno:
1302
+ s += '>>'
1303
+ self.message(s + '\t' + line.rstrip())
1304
+
1305
+ def do_whatis(self, arg):
1306
+ """whatis arg
1307
+ Print the type of the argument.
1308
+ """
1309
+ try:
1310
+ value = self._getval(arg)
1311
+ except:
1312
+ # _getval() already printed the error
1313
+ return
1314
+ code = None
1315
+ # Is it an instance method?
1316
+ try:
1317
+ code = value.__func__.__code__
1318
+ except Exception:
1319
+ pass
1320
+ if code:
1321
+ self.message('Method %s' % code.co_name)
1322
+ return
1323
+ # Is it a function?
1324
+ try:
1325
+ code = value.__code__
1326
+ except Exception:
1327
+ pass
1328
+ if code:
1329
+ self.message('Function %s' % code.co_name)
1330
+ return
1331
+ # Is it a class?
1332
+ if value.__class__ is type:
1333
+ self.message('Class %s.%s' % (value.__module__, value.__qualname__))
1334
+ return
1335
+ # None of the above...
1336
+ self.message(type(value))
1337
+
1338
+ complete_whatis = _complete_expression
1339
+
1340
+ def do_display(self, arg):
1341
+ """display [expression]
1342
+
1343
+ Display the value of the expression if it changed, each time execution
1344
+ stops in the current frame.
1345
+
1346
+ Without expression, list all display expressions for the current frame.
1347
+ """
1348
+ if not arg:
1349
+ self.message('Currently displaying:')
1350
+ for item in self.displaying.get(self.curframe, {}).items():
1351
+ self.message('%s: %r' % item)
1352
+ else:
1353
+ val = self._getval_except(arg)
1354
+ self.displaying.setdefault(self.curframe, {})[arg] = val
1355
+ self.message('display %s: %r' % (arg, val))
1356
+
1357
+ complete_display = _complete_expression
1358
+
1359
+ def do_undisplay(self, arg):
1360
+ """undisplay [expression]
1361
+
1362
+ Do not display the expression any more in the current frame.
1363
+
1364
+ Without expression, clear all display expressions for the current frame.
1365
+ """
1366
+ if arg:
1367
+ try:
1368
+ del self.displaying.get(self.curframe, {})[arg]
1369
+ except KeyError:
1370
+ self.error('not displaying %s' % arg)
1371
+ else:
1372
+ self.displaying.pop(self.curframe, None)
1373
+
1374
+ def complete_undisplay(self, text, line, begidx, endidx):
1375
+ return [e for e in self.displaying.get(self.curframe, {})
1376
+ if e.startswith(text)]
1377
+
1378
+ def do_interact(self, arg):
1379
+ """interact
1380
+
1381
+ Start an interactive interpreter whose global namespace
1382
+ contains all the (global and local) names found in the current scope.
1383
+ """
1384
+ ns = {**self.curframe.f_globals, **self.curframe_locals}
1385
+ code.interact("*interactive*", local=ns)
1386
+
1387
+ def do_alias(self, arg):
1388
+ """alias [name [command [parameter parameter ...] ]]
1389
+ Create an alias called 'name' that executes 'command'. The
1390
+ command must *not* be enclosed in quotes. Replaceable
1391
+ parameters can be indicated by %1, %2, and so on, while %* is
1392
+ replaced by all the parameters. If no command is given, the
1393
+ current alias for name is shown. If no name is given, all
1394
+ aliases are listed.
1395
+
1396
+ Aliases may be nested and can contain anything that can be
1397
+ legally typed at the pdb prompt. Note! You *can* override
1398
+ internal pdb commands with aliases! Those internal commands
1399
+ are then hidden until the alias is removed. Aliasing is
1400
+ recursively applied to the first word of the command line; all
1401
+ other words in the line are left alone.
1402
+
1403
+ As an example, here are two useful aliases (especially when
1404
+ placed in the .pdbrc file):
1405
+
1406
+ # Print instance variables (usage "pi classInst")
1407
+ alias pi for k in %1.__dict__.keys(): print("%1.",k,"=",%1.__dict__[k])
1408
+ # Print instance variables in self
1409
+ alias ps pi self
1410
+ """
1411
+ args = arg.split()
1412
+ if len(args) == 0:
1413
+ keys = sorted(self.aliases.keys())
1414
+ for alias in keys:
1415
+ self.message("%s = %s" % (alias, self.aliases[alias]))
1416
+ return
1417
+ if args[0] in self.aliases and len(args) == 1:
1418
+ self.message("%s = %s" % (args[0], self.aliases[args[0]]))
1419
+ else:
1420
+ self.aliases[args[0]] = ' '.join(args[1:])
1421
+
1422
+ def do_unalias(self, arg):
1423
+ """unalias name
1424
+ Delete the specified alias.
1425
+ """
1426
+ args = arg.split()
1427
+ if len(args) == 0: return
1428
+ if args[0] in self.aliases:
1429
+ del self.aliases[args[0]]
1430
+
1431
+ def complete_unalias(self, text, line, begidx, endidx):
1432
+ return [a for a in self.aliases if a.startswith(text)]
1433
+
1434
+ # List of all the commands making the program resume execution.
1435
+ commands_resuming = ['do_continue', 'do_step', 'do_next', 'do_return',
1436
+ 'do_quit', 'do_jump']
1437
+
1438
+ # Print a traceback starting at the top stack frame.
1439
+ # The most recently entered frame is printed last;
1440
+ # this is different from dbx and gdb, but consistent with
1441
+ # the Python interpreter's stack trace.
1442
+ # It is also consistent with the up/down commands (which are
1443
+ # compatible with dbx and gdb: up moves towards 'main()'
1444
+ # and down moves towards the most recent stack frame).
1445
+
1446
+ def print_stack_trace(self):
1447
+ try:
1448
+ for frame_lineno in self.stack:
1449
+ self.print_stack_entry(frame_lineno)
1450
+ except KeyboardInterrupt:
1451
+ pass
1452
+
1453
+ def print_stack_entry(self, frame_lineno, prompt_prefix=line_prefix):
1454
+ frame, lineno = frame_lineno
1455
+ if frame is self.curframe:
1456
+ prefix = '> '
1457
+ else:
1458
+ prefix = ' '
1459
+ self.message(prefix +
1460
+ self.format_stack_entry(frame_lineno, prompt_prefix))
1461
+
1462
+ # Provide help
1463
+
1464
+ def do_help(self, arg):
1465
+ """h(elp)
1466
+ Without argument, print the list of available commands.
1467
+ With a command name as argument, print help about that command.
1468
+ "help pdb" shows the full pdb documentation.
1469
+ "help exec" gives help on the ! command.
1470
+ """
1471
+ if not arg:
1472
+ return cmd.Cmd.do_help(self, arg)
1473
+ try:
1474
+ try:
1475
+ topic = getattr(self, 'help_' + arg)
1476
+ return topic()
1477
+ except AttributeError:
1478
+ command = getattr(self, 'do_' + arg)
1479
+ except AttributeError:
1480
+ self.error('No help for %r' % arg)
1481
+ else:
1482
+ if sys.flags.optimize >= 2:
1483
+ self.error('No help for %r; please do not run Python with -OO '
1484
+ 'if you need command help' % arg)
1485
+ return
1486
+ self.message(command.__doc__.rstrip())
1487
+
1488
+ do_h = do_help
1489
+
1490
+ def help_exec(self):
1491
+ """(!) statement
1492
+ Execute the (one-line) statement in the context of the current
1493
+ stack frame. The exclamation point can be omitted unless the
1494
+ first word of the statement resembles a debugger command. To
1495
+ assign to a global variable you must always prefix the command
1496
+ with a 'global' command, e.g.:
1497
+ (Pdb) global list_options; list_options = ['-l']
1498
+ (Pdb)
1499
+ """
1500
+ self.message((self.help_exec.__doc__ or '').strip())
1501
+
1502
+ def help_pdb(self):
1503
+ help()
1504
+
1505
+ # other helper functions
1506
+
1507
+ def lookupmodule(self, filename):
1508
+ """Helper function for break/clear parsing -- may be overridden.
1509
+
1510
+ lookupmodule() translates (possibly incomplete) file or module name
1511
+ into an absolute file name.
1512
+ """
1513
+ if os.path.isabs(filename) and os.path.exists(filename):
1514
+ return filename
1515
+ f = os.path.join(sys.path[0], filename)
1516
+ if os.path.exists(f) and self.canonic(f) == self.mainpyfile:
1517
+ return f
1518
+ root, ext = os.path.splitext(filename)
1519
+ if ext == '':
1520
+ filename = filename + '.py'
1521
+ if os.path.isabs(filename):
1522
+ return filename
1523
+ for dirname in sys.path:
1524
+ while os.path.islink(dirname):
1525
+ dirname = os.readlink(dirname)
1526
+ fullname = os.path.join(dirname, filename)
1527
+ if os.path.exists(fullname):
1528
+ return fullname
1529
+ return None
1530
+
1531
+ def _runmodule(self, module_name):
1532
+ self._wait_for_mainpyfile = True
1533
+ self._user_requested_quit = False
1534
+ import runpy
1535
+ mod_name, mod_spec, code = runpy._get_module_details(module_name)
1536
+ self.mainpyfile = self.canonic(code.co_filename)
1537
+ import __main__
1538
+ __main__.__dict__.clear()
1539
+ __main__.__dict__.update({
1540
+ "__name__": "__main__",
1541
+ "__file__": self.mainpyfile,
1542
+ "__package__": mod_spec.parent,
1543
+ "__loader__": mod_spec.loader,
1544
+ "__spec__": mod_spec,
1545
+ "__builtins__": __builtins__,
1546
+ })
1547
+ self.run(code)
1548
+
1549
+ def _runscript(self, filename):
1550
+ # The script has to run in __main__ namespace (or imports from
1551
+ # __main__ will break).
1552
+ #
1553
+ # So we clear up the __main__ and set several special variables
1554
+ # (this gets rid of pdb's globals and cleans old variables on restarts).
1555
+ import __main__
1556
+ __main__.__dict__.clear()
1557
+ __main__.__dict__.update({"__name__" : "__main__",
1558
+ "__file__" : filename,
1559
+ "__builtins__": __builtins__,
1560
+ })
1561
+
1562
+ # When bdb sets tracing, a number of call and line events happens
1563
+ # BEFORE debugger even reaches user's code (and the exact sequence of
1564
+ # events depends on python version). So we take special measures to
1565
+ # avoid stopping before we reach the main script (see user_line and
1566
+ # user_call for details).
1567
+ self._wait_for_mainpyfile = True
1568
+ self.mainpyfile = self.canonic(filename)
1569
+ self._user_requested_quit = False
1570
+ with io.open_code(filename) as fp:
1571
+ statement = "exec(compile(%r, %r, 'exec'))" % \
1572
+ (fp.read(), self.mainpyfile)
1573
+ self.run(statement)
1574
+
1575
+ # Collect all command help into docstring, if not run with -OO
1576
+
1577
+ if __doc__ is not None:
1578
+ # unfortunately we can't guess this order from the class definition
1579
+ _help_order = [
1580
+ 'help', 'where', 'down', 'up', 'break', 'tbreak', 'clear', 'disable',
1581
+ 'enable', 'ignore', 'condition', 'commands', 'step', 'next', 'until',
1582
+ 'jump', 'return', 'retval', 'run', 'continue', 'list', 'longlist',
1583
+ 'args', 'p', 'pp', 'whatis', 'source', 'display', 'undisplay',
1584
+ 'interact', 'alias', 'unalias', 'debug', 'quit',
1585
+ ]
1586
+
1587
+ for _command in _help_order:
1588
+ __doc__ += getattr(Pdb, 'do_' + _command).__doc__.strip() + '\n\n'
1589
+ __doc__ += Pdb.help_exec.__doc__
1590
+
1591
+ del _help_order, _command
1592
+
1593
+
1594
+ # Simplified interface
1595
+
1596
+ def run(statement, globals=None, locals=None):
1597
+ Pdb().run(statement, globals, locals)
1598
+
1599
+ def runeval(expression, globals=None, locals=None):
1600
+ return Pdb().runeval(expression, globals, locals)
1601
+
1602
+ def runctx(statement, globals, locals):
1603
+ # B/W compatibility
1604
+ run(statement, globals, locals)
1605
+
1606
+ def runcall(*args, **kwds):
1607
+ return Pdb().runcall(*args, **kwds)
1608
+
1609
+ def set_trace(*, header=None):
1610
+ pdb = Pdb()
1611
+ if header is not None:
1612
+ pdb.message(header)
1613
+ pdb.set_trace(sys._getframe().f_back)
1614
+
1615
+ # Post-Mortem interface
1616
+
1617
+ def post_mortem(t=None):
1618
+ # handling the default
1619
+ if t is None:
1620
+ # sys.exc_info() returns (type, value, traceback) if an exception is
1621
+ # being handled, otherwise it returns None
1622
+ t = sys.exc_info()[2]
1623
+ if t is None:
1624
+ raise ValueError("A valid traceback must be passed if no "
1625
+ "exception is being handled")
1626
+
1627
+ p = Pdb()
1628
+ p.reset()
1629
+ p.interaction(None, t)
1630
+
1631
+ def pm():
1632
+ post_mortem(sys.last_traceback)
1633
+
1634
+
1635
+ # Main program for testing
1636
+
1637
+ TESTCMD = 'import x; x.main()'
1638
+
1639
+ def test():
1640
+ run(TESTCMD)
1641
+
1642
+ # print help
1643
+ def help():
1644
+ import pydoc
1645
+ pydoc.pager(__doc__)
1646
+
1647
+ _usage = """\
1648
+ usage: pdb.py [-c command] ... [-m module | pyfile] [arg] ...
1649
+
1650
+ Debug the Python program given by pyfile. Alternatively,
1651
+ an executable module or package to debug can be specified using
1652
+ the -m switch.
1653
+
1654
+ Initial commands are read from .pdbrc files in your home directory
1655
+ and in the current directory, if they exist. Commands supplied with
1656
+ -c are executed after commands from .pdbrc files.
1657
+
1658
+ To let the script run until an exception occurs, use "-c continue".
1659
+ To let the script run up to a given line X in the debugged file, use
1660
+ "-c 'until X'"."""
1661
+
1662
+ def main():
1663
+ import getopt
1664
+
1665
+ opts, args = getopt.getopt(sys.argv[1:], 'mhc:', ['help', 'command='])
1666
+
1667
+ if not args:
1668
+ print(_usage)
1669
+ sys.exit(2)
1670
+
1671
+ commands = []
1672
+ run_as_module = False
1673
+ for opt, optarg in opts:
1674
+ if opt in ['-h', '--help']:
1675
+ print(_usage)
1676
+ sys.exit()
1677
+ elif opt in ['-c', '--command']:
1678
+ commands.append(optarg)
1679
+ elif opt in ['-m']:
1680
+ run_as_module = True
1681
+
1682
+ mainpyfile = args[0] # Get script filename
1683
+ if not run_as_module and not os.path.exists(mainpyfile):
1684
+ print('Error:', mainpyfile, 'does not exist')
1685
+ sys.exit(1)
1686
+
1687
+ sys.argv[:] = args # Hide "pdb.py" and pdb options from argument list
1688
+
1689
+ # Replace pdb's dir with script's dir in front of module search path.
1690
+ if not run_as_module:
1691
+ sys.path[0] = os.path.dirname(mainpyfile)
1692
+
1693
+ # Note on saving/restoring sys.argv: it's a good idea when sys.argv was
1694
+ # modified by the script being debugged. It's a bad idea when it was
1695
+ # changed by the user from the command line. There is a "restart" command
1696
+ # which allows explicit specification of command line arguments.
1697
+ pdb = Pdb()
1698
+ pdb.rcLines.extend(commands)
1699
+ while True:
1700
+ try:
1701
+ if run_as_module:
1702
+ pdb._runmodule(mainpyfile)
1703
+ else:
1704
+ pdb._runscript(mainpyfile)
1705
+ if pdb._user_requested_quit:
1706
+ break
1707
+ print("The program finished and will be restarted")
1708
+ except Restart:
1709
+ print("Restarting", mainpyfile, "with arguments:")
1710
+ print("\t" + " ".join(args))
1711
+ except SystemExit:
1712
+ # In most cases SystemExit does not warrant a post-mortem session.
1713
+ print("The program exited via sys.exit(). Exit status:", end=' ')
1714
+ print(sys.exc_info()[1])
1715
+ except SyntaxError:
1716
+ traceback.print_exc()
1717
+ sys.exit(1)
1718
+ except:
1719
+ traceback.print_exc()
1720
+ print("Uncaught exception. Entering post mortem debugging")
1721
+ print("Running 'cont' or 'step' will restart the program")
1722
+ t = sys.exc_info()[2]
1723
+ pdb.interaction(None, t)
1724
+ print("Post mortem debugger finished. The " + mainpyfile +
1725
+ " will be restarted")
1726
+
1727
+
1728
+ # When invoked as main program, invoke the debugger on a script
1729
+ if __name__ == '__main__':
1730
+ import pdb
1731
+ pdb.main()