@tedbrain/vlink 0.0.0-dpv2.ted-runner.python-darwin-arm64.3.12.10-dpv2.1.r5 → 0.0.0-dpv2.ted-runner.plugin.0.1.1.r6

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 (1882) hide show
  1. package/README.md +59 -0
  2. package/entry.py +5 -0
  3. package/openapi.yaml +739 -0
  4. package/package.json +1 -1
  5. package/plugin_cli.py +253 -0
  6. package/runtime/cli.ps1 +4 -0
  7. package/runtime/cli.sh +5 -0
  8. package/ted_runner_dpv2/__init__.py +5 -0
  9. package/ted_runner_dpv2/auth.py +95 -0
  10. package/ted_runner_dpv2/executor/__init__.py +8 -0
  11. package/ted_runner_dpv2/executor/isolated.py +111 -0
  12. package/ted_runner_dpv2/executor/launch.py +115 -0
  13. package/ted_runner_dpv2/executor/local.py +43 -0
  14. package/ted_runner_dpv2/executor/plan.py +290 -0
  15. package/ted_runner_dpv2/executor/podman.py +143 -0
  16. package/ted_runner_dpv2/files.py +204 -0
  17. package/ted_runner_dpv2/joblog.py +81 -0
  18. package/ted_runner_dpv2/jobrun/__init__.py +12 -0
  19. package/ted_runner_dpv2/jobrun/artifacts.py +90 -0
  20. package/ted_runner_dpv2/jobrun/environment.py +37 -0
  21. package/ted_runner_dpv2/jobrun/supervisor.py +313 -0
  22. package/ted_runner_dpv2/jobrun/worker.py +55 -0
  23. package/ted_runner_dpv2/jobs.py +300 -0
  24. package/ted_runner_dpv2/jsonio.py +57 -0
  25. package/ted_runner_dpv2/language.py +93 -0
  26. package/ted_runner_dpv2/lease.py +137 -0
  27. package/ted_runner_dpv2/pdk.py +133 -0
  28. package/ted_runner_dpv2/policy.py +73 -0
  29. package/ted_runner_dpv2/relay.py +283 -0
  30. package/ted_runner_dpv2/service.py +512 -0
  31. package/ted_runner_dpv2/worker.py +430 -0
  32. package/tedbrain_plugin_runtime/__init__.py +2 -0
  33. package/tedbrain_plugin_runtime/admission.py +39 -0
  34. package/tedbrain_plugin_runtime/auth.py +92 -0
  35. package/tedbrain_plugin_runtime/bootstrap.py +110 -0
  36. package/tedbrain_plugin_runtime/cli.py +238 -0
  37. package/tedbrain_plugin_runtime/engine.py +132 -0
  38. package/tedbrain_plugin_runtime/executor.py +115 -0
  39. package/tedbrain_plugin_runtime/handoff.py +193 -0
  40. package/tedbrain_plugin_runtime/installer.py +400 -0
  41. package/tedbrain_plugin_runtime/jobs.py +293 -0
  42. package/tedbrain_plugin_runtime/launcher.py +122 -0
  43. package/tedbrain_plugin_runtime/ops.py +311 -0
  44. package/tedbrain_plugin_runtime/publication.py +53 -0
  45. package/tedbrain_plugin_runtime/request_contract.py +226 -0
  46. package/tedbrain_plugin_runtime/rungc.py +178 -0
  47. package/tedbrain_plugin_runtime/service.py +382 -0
  48. package/tedbrain_plugin_runtime/sessions.py +96 -0
  49. package/tedbrain_plugin_runtime/ssh_workstation.py +40 -0
  50. package/tedbrain_plugin_runtime/supervisor.py +165 -0
  51. package/tedbrain_plugin_runtime/worker.py +345 -0
  52. package/tedbrain_plugin_runtime/workstations.py +170 -0
  53. package/BUILD +0 -1
  54. package/bin/2to3 +0 -7
  55. package/bin/2to3-3.12 +0 -7
  56. package/bin/idle3 +0 -7
  57. package/bin/idle3.12 +0 -7
  58. package/bin/pip +0 -10
  59. package/bin/pip3 +0 -10
  60. package/bin/pip3.12 +0 -10
  61. package/bin/pydoc3 +0 -7
  62. package/bin/pydoc3.12 +0 -7
  63. package/bin/python +0 -0
  64. package/bin/python3 +0 -0
  65. package/bin/python3-config +0 -76
  66. package/bin/python3.12 +0 -0
  67. package/bin/python3.12-config +0 -76
  68. package/include/python3.12/Python.h +0 -109
  69. package/include/python3.12/abstract.h +0 -899
  70. package/include/python3.12/bltinmodule.h +0 -14
  71. package/include/python3.12/boolobject.h +0 -42
  72. package/include/python3.12/bytearrayobject.h +0 -44
  73. package/include/python3.12/bytesobject.h +0 -69
  74. package/include/python3.12/ceval.h +0 -168
  75. package/include/python3.12/codecs.h +0 -248
  76. package/include/python3.12/compile.h +0 -22
  77. package/include/python3.12/complexobject.h +0 -30
  78. package/include/python3.12/cpython/abstract.h +0 -206
  79. package/include/python3.12/cpython/bytearrayobject.h +0 -34
  80. package/include/python3.12/cpython/bytesobject.h +0 -129
  81. package/include/python3.12/cpython/cellobject.h +0 -44
  82. package/include/python3.12/cpython/ceval.h +0 -35
  83. package/include/python3.12/cpython/classobject.h +0 -71
  84. package/include/python3.12/cpython/code.h +0 -389
  85. package/include/python3.12/cpython/compile.h +0 -69
  86. package/include/python3.12/cpython/complexobject.h +0 -44
  87. package/include/python3.12/cpython/context.h +0 -78
  88. package/include/python3.12/cpython/descrobject.h +0 -64
  89. package/include/python3.12/cpython/dictobject.h +0 -118
  90. package/include/python3.12/cpython/fileobject.h +0 -19
  91. package/include/python3.12/cpython/fileutils.h +0 -8
  92. package/include/python3.12/cpython/floatobject.h +0 -27
  93. package/include/python3.12/cpython/frameobject.h +0 -29
  94. package/include/python3.12/cpython/funcobject.h +0 -190
  95. package/include/python3.12/cpython/genobject.h +0 -89
  96. package/include/python3.12/cpython/import.h +0 -46
  97. package/include/python3.12/cpython/initconfig.h +0 -256
  98. package/include/python3.12/cpython/interpreteridobject.h +0 -11
  99. package/include/python3.12/cpython/listobject.h +0 -47
  100. package/include/python3.12/cpython/longintrepr.h +0 -133
  101. package/include/python3.12/cpython/longobject.h +0 -100
  102. package/include/python3.12/cpython/memoryobject.h +0 -52
  103. package/include/python3.12/cpython/methodobject.h +0 -66
  104. package/include/python3.12/cpython/modsupport.h +0 -109
  105. package/include/python3.12/cpython/object.h +0 -575
  106. package/include/python3.12/cpython/objimpl.h +0 -95
  107. package/include/python3.12/cpython/odictobject.h +0 -43
  108. package/include/python3.12/cpython/picklebufobject.h +0 -31
  109. package/include/python3.12/cpython/pthread_stubs.h +0 -88
  110. package/include/python3.12/cpython/pyctype.h +0 -39
  111. package/include/python3.12/cpython/pydebug.h +0 -38
  112. package/include/python3.12/cpython/pyerrors.h +0 -178
  113. package/include/python3.12/cpython/pyfpe.h +0 -15
  114. package/include/python3.12/cpython/pyframe.h +0 -35
  115. package/include/python3.12/cpython/pylifecycle.h +0 -111
  116. package/include/python3.12/cpython/pymem.h +0 -98
  117. package/include/python3.12/cpython/pystate.h +0 -456
  118. package/include/python3.12/cpython/pythonrun.h +0 -121
  119. package/include/python3.12/cpython/pythread.h +0 -42
  120. package/include/python3.12/cpython/pytime.h +0 -331
  121. package/include/python3.12/cpython/setobject.h +0 -72
  122. package/include/python3.12/cpython/sysmodule.h +0 -16
  123. package/include/python3.12/cpython/traceback.h +0 -16
  124. package/include/python3.12/cpython/tupleobject.h +0 -39
  125. package/include/python3.12/cpython/unicodeobject.h +0 -963
  126. package/include/python3.12/cpython/warnings.h +0 -20
  127. package/include/python3.12/cpython/weakrefobject.h +0 -56
  128. package/include/python3.12/datetime.h +0 -267
  129. package/include/python3.12/descrobject.h +0 -100
  130. package/include/python3.12/dictobject.h +0 -97
  131. package/include/python3.12/dynamic_annotations.h +0 -499
  132. package/include/python3.12/enumobject.h +0 -17
  133. package/include/python3.12/errcode.h +0 -38
  134. package/include/python3.12/exports.h +0 -36
  135. package/include/python3.12/fileobject.h +0 -49
  136. package/include/python3.12/fileutils.h +0 -26
  137. package/include/python3.12/floatobject.h +0 -54
  138. package/include/python3.12/frameobject.h +0 -20
  139. package/include/python3.12/genericaliasobject.h +0 -14
  140. package/include/python3.12/import.h +0 -98
  141. package/include/python3.12/internal/pycore_abstract.h +0 -25
  142. package/include/python3.12/internal/pycore_asdl.h +0 -112
  143. package/include/python3.12/internal/pycore_ast.h +0 -922
  144. package/include/python3.12/internal/pycore_ast_state.h +0 -265
  145. package/include/python3.12/internal/pycore_atexit.h +0 -57
  146. package/include/python3.12/internal/pycore_atomic.h +0 -557
  147. package/include/python3.12/internal/pycore_atomic_funcs.h +0 -94
  148. package/include/python3.12/internal/pycore_bitutils.h +0 -186
  149. package/include/python3.12/internal/pycore_blocks_output_buffer.h +0 -317
  150. package/include/python3.12/internal/pycore_bytes_methods.h +0 -73
  151. package/include/python3.12/internal/pycore_bytesobject.h +0 -47
  152. package/include/python3.12/internal/pycore_call.h +0 -133
  153. package/include/python3.12/internal/pycore_ceval.h +0 -164
  154. package/include/python3.12/internal/pycore_ceval_state.h +0 -103
  155. package/include/python3.12/internal/pycore_code.h +0 -496
  156. package/include/python3.12/internal/pycore_compile.h +0 -118
  157. package/include/python3.12/internal/pycore_condvar.h +0 -99
  158. package/include/python3.12/internal/pycore_context.h +0 -71
  159. package/include/python3.12/internal/pycore_descrobject.h +0 -26
  160. package/include/python3.12/internal/pycore_dict.h +0 -199
  161. package/include/python3.12/internal/pycore_dict_state.h +0 -50
  162. package/include/python3.12/internal/pycore_dtoa.h +0 -69
  163. package/include/python3.12/internal/pycore_emscripten_signal.h +0 -25
  164. package/include/python3.12/internal/pycore_exceptions.h +0 -37
  165. package/include/python3.12/internal/pycore_faulthandler.h +0 -99
  166. package/include/python3.12/internal/pycore_fileutils.h +0 -292
  167. package/include/python3.12/internal/pycore_fileutils_windows.h +0 -98
  168. package/include/python3.12/internal/pycore_floatobject.h +0 -71
  169. package/include/python3.12/internal/pycore_flowgraph.h +0 -120
  170. package/include/python3.12/internal/pycore_format.h +0 -27
  171. package/include/python3.12/internal/pycore_frame.h +0 -283
  172. package/include/python3.12/internal/pycore_function.h +0 -26
  173. package/include/python3.12/internal/pycore_gc.h +0 -211
  174. package/include/python3.12/internal/pycore_genobject.h +0 -49
  175. package/include/python3.12/internal/pycore_getopt.h +0 -22
  176. package/include/python3.12/internal/pycore_gil.h +0 -50
  177. package/include/python3.12/internal/pycore_global_objects.h +0 -105
  178. package/include/python3.12/internal/pycore_global_objects_fini_generated.h +0 -1517
  179. package/include/python3.12/internal/pycore_global_strings.h +0 -777
  180. package/include/python3.12/internal/pycore_hamt.h +0 -134
  181. package/include/python3.12/internal/pycore_hashtable.h +0 -149
  182. package/include/python3.12/internal/pycore_import.h +0 -183
  183. package/include/python3.12/internal/pycore_initconfig.h +0 -179
  184. package/include/python3.12/internal/pycore_instruments.h +0 -106
  185. package/include/python3.12/internal/pycore_interp.h +0 -275
  186. package/include/python3.12/internal/pycore_intrinsics.h +0 -32
  187. package/include/python3.12/internal/pycore_list.h +0 -83
  188. package/include/python3.12/internal/pycore_long.h +0 -258
  189. package/include/python3.12/internal/pycore_memoryobject.h +0 -18
  190. package/include/python3.12/internal/pycore_moduleobject.h +0 -45
  191. package/include/python3.12/internal/pycore_namespace.h +0 -20
  192. package/include/python3.12/internal/pycore_object.h +0 -455
  193. package/include/python3.12/internal/pycore_object_state.h +0 -42
  194. package/include/python3.12/internal/pycore_obmalloc.h +0 -700
  195. package/include/python3.12/internal/pycore_obmalloc_init.h +0 -73
  196. package/include/python3.12/internal/pycore_opcode.h +0 -587
  197. package/include/python3.12/internal/pycore_opcode_utils.h +0 -92
  198. package/include/python3.12/internal/pycore_parser.h +0 -66
  199. package/include/python3.12/internal/pycore_pathconfig.h +0 -24
  200. package/include/python3.12/internal/pycore_pyarena.h +0 -64
  201. package/include/python3.12/internal/pycore_pyerrors.h +0 -129
  202. package/include/python3.12/internal/pycore_pyhash.h +0 -40
  203. package/include/python3.12/internal/pycore_pylifecycle.h +0 -99
  204. package/include/python3.12/internal/pycore_pymath.h +0 -205
  205. package/include/python3.12/internal/pycore_pymem.h +0 -98
  206. package/include/python3.12/internal/pycore_pymem_init.h +0 -85
  207. package/include/python3.12/internal/pycore_pystate.h +0 -180
  208. package/include/python3.12/internal/pycore_pythread.h +0 -81
  209. package/include/python3.12/internal/pycore_range.h +0 -21
  210. package/include/python3.12/internal/pycore_runtime.h +0 -235
  211. package/include/python3.12/internal/pycore_runtime_init.h +0 -188
  212. package/include/python3.12/internal/pycore_runtime_init_generated.h +0 -1511
  213. package/include/python3.12/internal/pycore_signal.h +0 -98
  214. package/include/python3.12/internal/pycore_sliceobject.h +0 -22
  215. package/include/python3.12/internal/pycore_strhex.h +0 -36
  216. package/include/python3.12/internal/pycore_structseq.h +0 -39
  217. package/include/python3.12/internal/pycore_symtable.h +0 -160
  218. package/include/python3.12/internal/pycore_sysmodule.h +0 -34
  219. package/include/python3.12/internal/pycore_time.h +0 -25
  220. package/include/python3.12/internal/pycore_token.h +0 -108
  221. package/include/python3.12/internal/pycore_traceback.h +0 -101
  222. package/include/python3.12/internal/pycore_tracemalloc.h +0 -123
  223. package/include/python3.12/internal/pycore_tuple.h +0 -79
  224. package/include/python3.12/internal/pycore_typeobject.h +0 -151
  225. package/include/python3.12/internal/pycore_typevarobject.h +0 -24
  226. package/include/python3.12/internal/pycore_ucnhash.h +0 -34
  227. package/include/python3.12/internal/pycore_unicodeobject.h +0 -86
  228. package/include/python3.12/internal/pycore_unicodeobject_generated.h +0 -2832
  229. package/include/python3.12/internal/pycore_unionobject.h +0 -23
  230. package/include/python3.12/internal/pycore_warnings.h +0 -29
  231. package/include/python3.12/interpreteridobject.h +0 -17
  232. package/include/python3.12/intrcheck.h +0 -30
  233. package/include/python3.12/iterobject.h +0 -27
  234. package/include/python3.12/listobject.h +0 -52
  235. package/include/python3.12/longobject.h +0 -108
  236. package/include/python3.12/marshal.h +0 -31
  237. package/include/python3.12/memoryobject.h +0 -34
  238. package/include/python3.12/methodobject.h +0 -132
  239. package/include/python3.12/modsupport.h +0 -168
  240. package/include/python3.12/moduleobject.h +0 -119
  241. package/include/python3.12/object.h +0 -993
  242. package/include/python3.12/objimpl.h +0 -234
  243. package/include/python3.12/opcode.h +0 -271
  244. package/include/python3.12/osdefs.h +0 -51
  245. package/include/python3.12/osmodule.h +0 -17
  246. package/include/python3.12/patchlevel.h +0 -35
  247. package/include/python3.12/py_curses.h +0 -99
  248. package/include/python3.12/pybuffer.h +0 -145
  249. package/include/python3.12/pycapsule.h +0 -59
  250. package/include/python3.12/pyconfig.h +0 -1940
  251. package/include/python3.12/pydtrace.h +0 -59
  252. package/include/python3.12/pyerrors.h +0 -337
  253. package/include/python3.12/pyexpat.h +0 -57
  254. package/include/python3.12/pyframe.h +0 -26
  255. package/include/python3.12/pyhash.h +0 -144
  256. package/include/python3.12/pylifecycle.h +0 -78
  257. package/include/python3.12/pymacconfig.h +0 -99
  258. package/include/python3.12/pymacro.h +0 -172
  259. package/include/python3.12/pymath.h +0 -62
  260. package/include/python3.12/pymem.h +0 -104
  261. package/include/python3.12/pyport.h +0 -782
  262. package/include/python3.12/pystate.h +0 -132
  263. package/include/python3.12/pystats.h +0 -110
  264. package/include/python3.12/pystrcmp.h +0 -23
  265. package/include/python3.12/pystrtod.h +0 -46
  266. package/include/python3.12/pythonrun.h +0 -49
  267. package/include/python3.12/pythread.h +0 -135
  268. package/include/python3.12/pytypedefs.h +0 -30
  269. package/include/python3.12/rangeobject.h +0 -27
  270. package/include/python3.12/setobject.h +0 -49
  271. package/include/python3.12/sliceobject.h +0 -65
  272. package/include/python3.12/structmember.h +0 -56
  273. package/include/python3.12/structseq.h +0 -49
  274. package/include/python3.12/sysmodule.h +0 -54
  275. package/include/python3.12/traceback.h +0 -26
  276. package/include/python3.12/tracemalloc.h +0 -77
  277. package/include/python3.12/tupleobject.h +0 -46
  278. package/include/python3.12/typeslots.h +0 -88
  279. package/include/python3.12/unicodeobject.h +0 -1020
  280. package/include/python3.12/warnings.h +0 -45
  281. package/include/python3.12/weakrefobject.h +0 -42
  282. package/lib/itcl4.2.4/itcl.tcl +0 -151
  283. package/lib/itcl4.2.4/itclConfig.sh +0 -67
  284. package/lib/itcl4.2.4/itclHullCmds.tcl +0 -562
  285. package/lib/itcl4.2.4/itclWidget.tcl +0 -447
  286. package/lib/itcl4.2.4/libitcl4.2.4.a +0 -0
  287. package/lib/itcl4.2.4/libitclstub4.2.4.a +0 -0
  288. package/lib/libpython3.12.dylib +0 -0
  289. package/lib/pkgconfig/python-3.12-embed.pc +0 -13
  290. package/lib/pkgconfig/python-3.12.pc +0 -13
  291. package/lib/pkgconfig/python3-embed.pc +0 -13
  292. package/lib/pkgconfig/python3.pc +0 -13
  293. package/lib/python3.12/EXTERNALLY-MANAGED +0 -2
  294. package/lib/python3.12/LICENSE.txt +0 -279
  295. package/lib/python3.12/__future__.py +0 -147
  296. package/lib/python3.12/__hello__.py +0 -16
  297. package/lib/python3.12/__phello__/__init__.py +0 -7
  298. package/lib/python3.12/__phello__/spam.py +0 -7
  299. package/lib/python3.12/_aix_support.py +0 -108
  300. package/lib/python3.12/_collections_abc.py +0 -1173
  301. package/lib/python3.12/_compat_pickle.py +0 -252
  302. package/lib/python3.12/_compression.py +0 -162
  303. package/lib/python3.12/_markupbase.py +0 -396
  304. package/lib/python3.12/_osx_support.py +0 -579
  305. package/lib/python3.12/_py_abc.py +0 -147
  306. package/lib/python3.12/_pydatetime.py +0 -2643
  307. package/lib/python3.12/_pydecimal.py +0 -6339
  308. package/lib/python3.12/_pyio.py +0 -2698
  309. package/lib/python3.12/_pylong.py +0 -329
  310. package/lib/python3.12/_sitebuiltins.py +0 -103
  311. package/lib/python3.12/_strptime.py +0 -664
  312. package/lib/python3.12/_sysconfigdata__darwin_darwin.py +0 -986
  313. package/lib/python3.12/_threading_local.py +0 -242
  314. package/lib/python3.12/_weakrefset.py +0 -205
  315. package/lib/python3.12/abc.py +0 -188
  316. package/lib/python3.12/aifc.py +0 -984
  317. package/lib/python3.12/antigravity.py +0 -17
  318. package/lib/python3.12/argparse.py +0 -2650
  319. package/lib/python3.12/ast.py +0 -1840
  320. package/lib/python3.12/asyncio/__init__.py +0 -47
  321. package/lib/python3.12/asyncio/__main__.py +0 -128
  322. package/lib/python3.12/asyncio/base_events.py +0 -2024
  323. package/lib/python3.12/asyncio/base_futures.py +0 -67
  324. package/lib/python3.12/asyncio/base_subprocess.py +0 -285
  325. package/lib/python3.12/asyncio/base_tasks.py +0 -94
  326. package/lib/python3.12/asyncio/constants.py +0 -41
  327. package/lib/python3.12/asyncio/coroutines.py +0 -109
  328. package/lib/python3.12/asyncio/events.py +0 -868
  329. package/lib/python3.12/asyncio/exceptions.py +0 -62
  330. package/lib/python3.12/asyncio/format_helpers.py +0 -76
  331. package/lib/python3.12/asyncio/futures.py +0 -430
  332. package/lib/python3.12/asyncio/locks.py +0 -586
  333. package/lib/python3.12/asyncio/log.py +0 -7
  334. package/lib/python3.12/asyncio/mixins.py +0 -21
  335. package/lib/python3.12/asyncio/proactor_events.py +0 -897
  336. package/lib/python3.12/asyncio/protocols.py +0 -216
  337. package/lib/python3.12/asyncio/queues.py +0 -244
  338. package/lib/python3.12/asyncio/runners.py +0 -216
  339. package/lib/python3.12/asyncio/selector_events.py +0 -1324
  340. package/lib/python3.12/asyncio/sslproto.py +0 -929
  341. package/lib/python3.12/asyncio/staggered.py +0 -174
  342. package/lib/python3.12/asyncio/streams.py +0 -770
  343. package/lib/python3.12/asyncio/subprocess.py +0 -229
  344. package/lib/python3.12/asyncio/taskgroups.py +0 -268
  345. package/lib/python3.12/asyncio/tasks.py +0 -1065
  346. package/lib/python3.12/asyncio/threads.py +0 -25
  347. package/lib/python3.12/asyncio/timeouts.py +0 -168
  348. package/lib/python3.12/asyncio/transports.py +0 -335
  349. package/lib/python3.12/asyncio/trsock.py +0 -98
  350. package/lib/python3.12/asyncio/unix_events.py +0 -1500
  351. package/lib/python3.12/asyncio/windows_events.py +0 -901
  352. package/lib/python3.12/asyncio/windows_utils.py +0 -173
  353. package/lib/python3.12/base64.py +0 -586
  354. package/lib/python3.12/bdb.py +0 -920
  355. package/lib/python3.12/bisect.py +0 -118
  356. package/lib/python3.12/bz2.py +0 -344
  357. package/lib/python3.12/cProfile.py +0 -195
  358. package/lib/python3.12/calendar.py +0 -808
  359. package/lib/python3.12/cgi.py +0 -1014
  360. package/lib/python3.12/cgitb.py +0 -332
  361. package/lib/python3.12/chunk.py +0 -173
  362. package/lib/python3.12/cmd.py +0 -401
  363. package/lib/python3.12/code.py +0 -324
  364. package/lib/python3.12/codecs.py +0 -1129
  365. package/lib/python3.12/codeop.py +0 -161
  366. package/lib/python3.12/collections/__init__.py +0 -1592
  367. package/lib/python3.12/collections/abc.py +0 -3
  368. package/lib/python3.12/colorsys.py +0 -166
  369. package/lib/python3.12/compileall.py +0 -469
  370. package/lib/python3.12/concurrent/__init__.py +0 -1
  371. package/lib/python3.12/concurrent/futures/__init__.py +0 -54
  372. package/lib/python3.12/concurrent/futures/_base.py +0 -654
  373. package/lib/python3.12/concurrent/futures/process.py +0 -876
  374. package/lib/python3.12/concurrent/futures/thread.py +0 -240
  375. package/lib/python3.12/config-3.12-darwin/Makefile +0 -3183
  376. package/lib/python3.12/config-3.12-darwin/Setup +0 -303
  377. package/lib/python3.12/config-3.12-darwin/Setup.bootstrap +0 -36
  378. package/lib/python3.12/config-3.12-darwin/Setup.local +0 -90
  379. package/lib/python3.12/config-3.12-darwin/Setup.stdlib +0 -183
  380. package/lib/python3.12/config-3.12-darwin/config.c +0 -260
  381. package/lib/python3.12/config-3.12-darwin/config.c.in +0 -71
  382. package/lib/python3.12/config-3.12-darwin/install-sh +0 -541
  383. package/lib/python3.12/config-3.12-darwin/makesetup +0 -353
  384. package/lib/python3.12/config-3.12-darwin/python-config.py +0 -76
  385. package/lib/python3.12/config-3.12-darwin/python.o +0 -0
  386. package/lib/python3.12/configparser.py +0 -1333
  387. package/lib/python3.12/contextlib.py +0 -800
  388. package/lib/python3.12/contextvars.py +0 -4
  389. package/lib/python3.12/copy.py +0 -292
  390. package/lib/python3.12/copyreg.py +0 -217
  391. package/lib/python3.12/crypt.py +0 -124
  392. package/lib/python3.12/csv.py +0 -451
  393. package/lib/python3.12/ctypes/__init__.py +0 -582
  394. package/lib/python3.12/ctypes/_aix.py +0 -327
  395. package/lib/python3.12/ctypes/_endian.py +0 -78
  396. package/lib/python3.12/ctypes/macholib/README.ctypes +0 -7
  397. package/lib/python3.12/ctypes/macholib/__init__.py +0 -9
  398. package/lib/python3.12/ctypes/macholib/dyld.py +0 -165
  399. package/lib/python3.12/ctypes/macholib/dylib.py +0 -42
  400. package/lib/python3.12/ctypes/macholib/fetch_macholib +0 -2
  401. package/lib/python3.12/ctypes/macholib/fetch_macholib.bat +0 -1
  402. package/lib/python3.12/ctypes/macholib/framework.py +0 -42
  403. package/lib/python3.12/ctypes/util.py +0 -379
  404. package/lib/python3.12/ctypes/wintypes.py +0 -202
  405. package/lib/python3.12/curses/__init__.py +0 -101
  406. package/lib/python3.12/curses/ascii.py +0 -99
  407. package/lib/python3.12/curses/has_key.py +0 -192
  408. package/lib/python3.12/curses/panel.py +0 -6
  409. package/lib/python3.12/curses/textpad.py +0 -204
  410. package/lib/python3.12/dataclasses.py +0 -1588
  411. package/lib/python3.12/datetime.py +0 -9
  412. package/lib/python3.12/dbm/__init__.py +0 -190
  413. package/lib/python3.12/dbm/dumb.py +0 -317
  414. package/lib/python3.12/dbm/gnu.py +0 -3
  415. package/lib/python3.12/dbm/ndbm.py +0 -3
  416. package/lib/python3.12/decimal.py +0 -108
  417. package/lib/python3.12/difflib.py +0 -2056
  418. package/lib/python3.12/dis.py +0 -805
  419. package/lib/python3.12/doctest.py +0 -2845
  420. package/lib/python3.12/email/__init__.py +0 -61
  421. package/lib/python3.12/email/_encoded_words.py +0 -233
  422. package/lib/python3.12/email/_header_value_parser.py +0 -3095
  423. package/lib/python3.12/email/_parseaddr.py +0 -557
  424. package/lib/python3.12/email/_policybase.py +0 -382
  425. package/lib/python3.12/email/architecture.rst +0 -216
  426. package/lib/python3.12/email/base64mime.py +0 -115
  427. package/lib/python3.12/email/charset.py +0 -398
  428. package/lib/python3.12/email/contentmanager.py +0 -251
  429. package/lib/python3.12/email/encoders.py +0 -65
  430. package/lib/python3.12/email/errors.py +0 -117
  431. package/lib/python3.12/email/feedparser.py +0 -534
  432. package/lib/python3.12/email/generator.py +0 -520
  433. package/lib/python3.12/email/header.py +0 -573
  434. package/lib/python3.12/email/headerregistry.py +0 -604
  435. package/lib/python3.12/email/iterators.py +0 -68
  436. package/lib/python3.12/email/message.py +0 -1209
  437. package/lib/python3.12/email/mime/__init__.py +0 -0
  438. package/lib/python3.12/email/mime/application.py +0 -37
  439. package/lib/python3.12/email/mime/audio.py +0 -100
  440. package/lib/python3.12/email/mime/base.py +0 -29
  441. package/lib/python3.12/email/mime/image.py +0 -152
  442. package/lib/python3.12/email/mime/message.py +0 -33
  443. package/lib/python3.12/email/mime/multipart.py +0 -47
  444. package/lib/python3.12/email/mime/nonmultipart.py +0 -21
  445. package/lib/python3.12/email/mime/text.py +0 -40
  446. package/lib/python3.12/email/parser.py +0 -127
  447. package/lib/python3.12/email/policy.py +0 -232
  448. package/lib/python3.12/email/quoprimime.py +0 -300
  449. package/lib/python3.12/email/utils.py +0 -486
  450. package/lib/python3.12/encodings/__init__.py +0 -174
  451. package/lib/python3.12/encodings/aliases.py +0 -551
  452. package/lib/python3.12/encodings/ascii.py +0 -50
  453. package/lib/python3.12/encodings/base64_codec.py +0 -55
  454. package/lib/python3.12/encodings/big5.py +0 -39
  455. package/lib/python3.12/encodings/big5hkscs.py +0 -39
  456. package/lib/python3.12/encodings/bz2_codec.py +0 -78
  457. package/lib/python3.12/encodings/charmap.py +0 -69
  458. package/lib/python3.12/encodings/cp037.py +0 -307
  459. package/lib/python3.12/encodings/cp1006.py +0 -307
  460. package/lib/python3.12/encodings/cp1026.py +0 -307
  461. package/lib/python3.12/encodings/cp1125.py +0 -698
  462. package/lib/python3.12/encodings/cp1140.py +0 -307
  463. package/lib/python3.12/encodings/cp1250.py +0 -307
  464. package/lib/python3.12/encodings/cp1251.py +0 -307
  465. package/lib/python3.12/encodings/cp1252.py +0 -307
  466. package/lib/python3.12/encodings/cp1253.py +0 -307
  467. package/lib/python3.12/encodings/cp1254.py +0 -307
  468. package/lib/python3.12/encodings/cp1255.py +0 -307
  469. package/lib/python3.12/encodings/cp1256.py +0 -307
  470. package/lib/python3.12/encodings/cp1257.py +0 -307
  471. package/lib/python3.12/encodings/cp1258.py +0 -307
  472. package/lib/python3.12/encodings/cp273.py +0 -307
  473. package/lib/python3.12/encodings/cp424.py +0 -307
  474. package/lib/python3.12/encodings/cp437.py +0 -698
  475. package/lib/python3.12/encodings/cp500.py +0 -307
  476. package/lib/python3.12/encodings/cp720.py +0 -309
  477. package/lib/python3.12/encodings/cp737.py +0 -698
  478. package/lib/python3.12/encodings/cp775.py +0 -697
  479. package/lib/python3.12/encodings/cp850.py +0 -698
  480. package/lib/python3.12/encodings/cp852.py +0 -698
  481. package/lib/python3.12/encodings/cp855.py +0 -698
  482. package/lib/python3.12/encodings/cp856.py +0 -307
  483. package/lib/python3.12/encodings/cp857.py +0 -694
  484. package/lib/python3.12/encodings/cp858.py +0 -698
  485. package/lib/python3.12/encodings/cp860.py +0 -698
  486. package/lib/python3.12/encodings/cp861.py +0 -698
  487. package/lib/python3.12/encodings/cp862.py +0 -698
  488. package/lib/python3.12/encodings/cp863.py +0 -698
  489. package/lib/python3.12/encodings/cp864.py +0 -690
  490. package/lib/python3.12/encodings/cp865.py +0 -698
  491. package/lib/python3.12/encodings/cp866.py +0 -698
  492. package/lib/python3.12/encodings/cp869.py +0 -689
  493. package/lib/python3.12/encodings/cp874.py +0 -307
  494. package/lib/python3.12/encodings/cp875.py +0 -307
  495. package/lib/python3.12/encodings/cp932.py +0 -39
  496. package/lib/python3.12/encodings/cp949.py +0 -39
  497. package/lib/python3.12/encodings/cp950.py +0 -39
  498. package/lib/python3.12/encodings/euc_jis_2004.py +0 -39
  499. package/lib/python3.12/encodings/euc_jisx0213.py +0 -39
  500. package/lib/python3.12/encodings/euc_jp.py +0 -39
  501. package/lib/python3.12/encodings/euc_kr.py +0 -39
  502. package/lib/python3.12/encodings/gb18030.py +0 -39
  503. package/lib/python3.12/encodings/gb2312.py +0 -39
  504. package/lib/python3.12/encodings/gbk.py +0 -39
  505. package/lib/python3.12/encodings/hex_codec.py +0 -55
  506. package/lib/python3.12/encodings/hp_roman8.py +0 -314
  507. package/lib/python3.12/encodings/hz.py +0 -39
  508. package/lib/python3.12/encodings/idna.py +0 -317
  509. package/lib/python3.12/encodings/iso2022_jp.py +0 -39
  510. package/lib/python3.12/encodings/iso2022_jp_1.py +0 -39
  511. package/lib/python3.12/encodings/iso2022_jp_2.py +0 -39
  512. package/lib/python3.12/encodings/iso2022_jp_2004.py +0 -39
  513. package/lib/python3.12/encodings/iso2022_jp_3.py +0 -39
  514. package/lib/python3.12/encodings/iso2022_jp_ext.py +0 -39
  515. package/lib/python3.12/encodings/iso2022_kr.py +0 -39
  516. package/lib/python3.12/encodings/iso8859_1.py +0 -307
  517. package/lib/python3.12/encodings/iso8859_10.py +0 -307
  518. package/lib/python3.12/encodings/iso8859_11.py +0 -307
  519. package/lib/python3.12/encodings/iso8859_13.py +0 -307
  520. package/lib/python3.12/encodings/iso8859_14.py +0 -307
  521. package/lib/python3.12/encodings/iso8859_15.py +0 -307
  522. package/lib/python3.12/encodings/iso8859_16.py +0 -307
  523. package/lib/python3.12/encodings/iso8859_2.py +0 -307
  524. package/lib/python3.12/encodings/iso8859_3.py +0 -307
  525. package/lib/python3.12/encodings/iso8859_4.py +0 -307
  526. package/lib/python3.12/encodings/iso8859_5.py +0 -307
  527. package/lib/python3.12/encodings/iso8859_6.py +0 -307
  528. package/lib/python3.12/encodings/iso8859_7.py +0 -307
  529. package/lib/python3.12/encodings/iso8859_8.py +0 -307
  530. package/lib/python3.12/encodings/iso8859_9.py +0 -307
  531. package/lib/python3.12/encodings/johab.py +0 -39
  532. package/lib/python3.12/encodings/koi8_r.py +0 -307
  533. package/lib/python3.12/encodings/koi8_t.py +0 -308
  534. package/lib/python3.12/encodings/koi8_u.py +0 -307
  535. package/lib/python3.12/encodings/kz1048.py +0 -307
  536. package/lib/python3.12/encodings/latin_1.py +0 -50
  537. package/lib/python3.12/encodings/mac_arabic.py +0 -698
  538. package/lib/python3.12/encodings/mac_croatian.py +0 -307
  539. package/lib/python3.12/encodings/mac_cyrillic.py +0 -307
  540. package/lib/python3.12/encodings/mac_farsi.py +0 -307
  541. package/lib/python3.12/encodings/mac_greek.py +0 -307
  542. package/lib/python3.12/encodings/mac_iceland.py +0 -307
  543. package/lib/python3.12/encodings/mac_latin2.py +0 -312
  544. package/lib/python3.12/encodings/mac_roman.py +0 -307
  545. package/lib/python3.12/encodings/mac_romanian.py +0 -307
  546. package/lib/python3.12/encodings/mac_turkish.py +0 -307
  547. package/lib/python3.12/encodings/mbcs.py +0 -47
  548. package/lib/python3.12/encodings/oem.py +0 -41
  549. package/lib/python3.12/encodings/palmos.py +0 -308
  550. package/lib/python3.12/encodings/ptcp154.py +0 -312
  551. package/lib/python3.12/encodings/punycode.py +0 -237
  552. package/lib/python3.12/encodings/quopri_codec.py +0 -56
  553. package/lib/python3.12/encodings/raw_unicode_escape.py +0 -46
  554. package/lib/python3.12/encodings/rot_13.py +0 -113
  555. package/lib/python3.12/encodings/shift_jis.py +0 -39
  556. package/lib/python3.12/encodings/shift_jis_2004.py +0 -39
  557. package/lib/python3.12/encodings/shift_jisx0213.py +0 -39
  558. package/lib/python3.12/encodings/tis_620.py +0 -307
  559. package/lib/python3.12/encodings/undefined.py +0 -49
  560. package/lib/python3.12/encodings/unicode_escape.py +0 -46
  561. package/lib/python3.12/encodings/utf_16.py +0 -155
  562. package/lib/python3.12/encodings/utf_16_be.py +0 -42
  563. package/lib/python3.12/encodings/utf_16_le.py +0 -42
  564. package/lib/python3.12/encodings/utf_32.py +0 -150
  565. package/lib/python3.12/encodings/utf_32_be.py +0 -37
  566. package/lib/python3.12/encodings/utf_32_le.py +0 -37
  567. package/lib/python3.12/encodings/utf_7.py +0 -38
  568. package/lib/python3.12/encodings/utf_8.py +0 -42
  569. package/lib/python3.12/encodings/utf_8_sig.py +0 -130
  570. package/lib/python3.12/encodings/uu_codec.py +0 -103
  571. package/lib/python3.12/encodings/zlib_codec.py +0 -77
  572. package/lib/python3.12/ensurepip/__init__.py +0 -291
  573. package/lib/python3.12/ensurepip/__main__.py +0 -5
  574. package/lib/python3.12/ensurepip/_bundled/pip-25.0.1-py3-none-any.whl +0 -0
  575. package/lib/python3.12/ensurepip/_uninstall.py +0 -31
  576. package/lib/python3.12/enum.py +0 -2108
  577. package/lib/python3.12/filecmp.py +0 -315
  578. package/lib/python3.12/fileinput.py +0 -442
  579. package/lib/python3.12/fnmatch.py +0 -185
  580. package/lib/python3.12/fractions.py +0 -990
  581. package/lib/python3.12/ftplib.py +0 -966
  582. package/lib/python3.12/functools.py +0 -1009
  583. package/lib/python3.12/genericpath.py +0 -167
  584. package/lib/python3.12/getopt.py +0 -215
  585. package/lib/python3.12/getpass.py +0 -185
  586. package/lib/python3.12/gettext.py +0 -646
  587. package/lib/python3.12/glob.py +0 -252
  588. package/lib/python3.12/graphlib.py +0 -250
  589. package/lib/python3.12/gzip.py +0 -711
  590. package/lib/python3.12/hashlib.py +0 -253
  591. package/lib/python3.12/heapq.py +0 -603
  592. package/lib/python3.12/hmac.py +0 -219
  593. package/lib/python3.12/html/__init__.py +0 -132
  594. package/lib/python3.12/html/entities.py +0 -2513
  595. package/lib/python3.12/html/parser.py +0 -456
  596. package/lib/python3.12/http/__init__.py +0 -200
  597. package/lib/python3.12/http/client.py +0 -1550
  598. package/lib/python3.12/http/cookiejar.py +0 -2121
  599. package/lib/python3.12/http/cookies.py +0 -596
  600. package/lib/python3.12/http/server.py +0 -1320
  601. package/lib/python3.12/idlelib/CREDITS.txt +0 -47
  602. package/lib/python3.12/idlelib/ChangeLog +0 -1591
  603. package/lib/python3.12/idlelib/HISTORY.txt +0 -296
  604. package/lib/python3.12/idlelib/Icons/README.txt +0 -51
  605. package/lib/python3.12/idlelib/Icons/folder.gif +0 -0
  606. package/lib/python3.12/idlelib/Icons/idle.ico +0 -0
  607. package/lib/python3.12/idlelib/Icons/idle_16.gif +0 -0
  608. package/lib/python3.12/idlelib/Icons/idle_16.png +0 -0
  609. package/lib/python3.12/idlelib/Icons/idle_256.png +0 -0
  610. package/lib/python3.12/idlelib/Icons/idle_32.gif +0 -0
  611. package/lib/python3.12/idlelib/Icons/idle_32.png +0 -0
  612. package/lib/python3.12/idlelib/Icons/idle_48.gif +0 -0
  613. package/lib/python3.12/idlelib/Icons/idle_48.png +0 -0
  614. package/lib/python3.12/idlelib/Icons/minusnode.gif +0 -0
  615. package/lib/python3.12/idlelib/Icons/openfolder.gif +0 -0
  616. package/lib/python3.12/idlelib/Icons/plusnode.gif +0 -0
  617. package/lib/python3.12/idlelib/Icons/python.gif +0 -0
  618. package/lib/python3.12/idlelib/Icons/tk.gif +0 -0
  619. package/lib/python3.12/idlelib/NEWS2x.txt +0 -660
  620. package/lib/python3.12/idlelib/News3.txt +0 -1390
  621. package/lib/python3.12/idlelib/README.txt +0 -290
  622. package/lib/python3.12/idlelib/TODO.txt +0 -210
  623. package/lib/python3.12/idlelib/__init__.py +0 -10
  624. package/lib/python3.12/idlelib/__main__.py +0 -7
  625. package/lib/python3.12/idlelib/autocomplete.py +0 -228
  626. package/lib/python3.12/idlelib/autocomplete_w.py +0 -498
  627. package/lib/python3.12/idlelib/autoexpand.py +0 -96
  628. package/lib/python3.12/idlelib/browser.py +0 -260
  629. package/lib/python3.12/idlelib/calltip.py +0 -205
  630. package/lib/python3.12/idlelib/calltip_w.py +0 -202
  631. package/lib/python3.12/idlelib/codecontext.py +0 -270
  632. package/lib/python3.12/idlelib/colorizer.py +0 -384
  633. package/lib/python3.12/idlelib/config-extensions.def +0 -62
  634. package/lib/python3.12/idlelib/config-highlight.def +0 -105
  635. package/lib/python3.12/idlelib/config-keys.def +0 -309
  636. package/lib/python3.12/idlelib/config-main.def +0 -93
  637. package/lib/python3.12/idlelib/config.py +0 -917
  638. package/lib/python3.12/idlelib/config_key.py +0 -354
  639. package/lib/python3.12/idlelib/configdialog.py +0 -2408
  640. package/lib/python3.12/idlelib/debugger.py +0 -602
  641. package/lib/python3.12/idlelib/debugger_r.py +0 -390
  642. package/lib/python3.12/idlelib/debugobj.py +0 -146
  643. package/lib/python3.12/idlelib/debugobj_r.py +0 -41
  644. package/lib/python3.12/idlelib/delegator.py +0 -34
  645. package/lib/python3.12/idlelib/dynoption.py +0 -57
  646. package/lib/python3.12/idlelib/editor.py +0 -1767
  647. package/lib/python3.12/idlelib/extend.txt +0 -83
  648. package/lib/python3.12/idlelib/filelist.py +0 -132
  649. package/lib/python3.12/idlelib/format.py +0 -426
  650. package/lib/python3.12/idlelib/grep.py +0 -223
  651. package/lib/python3.12/idlelib/help.html +0 -805
  652. package/lib/python3.12/idlelib/help.py +0 -297
  653. package/lib/python3.12/idlelib/help_about.py +0 -211
  654. package/lib/python3.12/idlelib/history.py +0 -106
  655. package/lib/python3.12/idlelib/hyperparser.py +0 -312
  656. package/lib/python3.12/idlelib/idle.bat +0 -4
  657. package/lib/python3.12/idlelib/idle.py +0 -14
  658. package/lib/python3.12/idlelib/idle.pyw +0 -17
  659. package/lib/python3.12/idlelib/iomenu.py +0 -441
  660. package/lib/python3.12/idlelib/macosx.py +0 -278
  661. package/lib/python3.12/idlelib/mainmenu.py +0 -126
  662. package/lib/python3.12/idlelib/multicall.py +0 -451
  663. package/lib/python3.12/idlelib/outwin.py +0 -188
  664. package/lib/python3.12/idlelib/parenmatch.py +0 -183
  665. package/lib/python3.12/idlelib/pathbrowser.py +0 -107
  666. package/lib/python3.12/idlelib/percolator.py +0 -120
  667. package/lib/python3.12/idlelib/pyparse.py +0 -589
  668. package/lib/python3.12/idlelib/pyshell.py +0 -1694
  669. package/lib/python3.12/idlelib/query.py +0 -392
  670. package/lib/python3.12/idlelib/redirector.py +0 -173
  671. package/lib/python3.12/idlelib/replace.py +0 -300
  672. package/lib/python3.12/idlelib/rpc.py +0 -635
  673. package/lib/python3.12/idlelib/run.py +0 -646
  674. package/lib/python3.12/idlelib/runscript.py +0 -213
  675. package/lib/python3.12/idlelib/scrolledlist.py +0 -151
  676. package/lib/python3.12/idlelib/search.py +0 -165
  677. package/lib/python3.12/idlelib/searchbase.py +0 -210
  678. package/lib/python3.12/idlelib/searchengine.py +0 -235
  679. package/lib/python3.12/idlelib/sidebar.py +0 -544
  680. package/lib/python3.12/idlelib/squeezer.py +0 -345
  681. package/lib/python3.12/idlelib/stackviewer.py +0 -134
  682. package/lib/python3.12/idlelib/statusbar.py +0 -52
  683. package/lib/python3.12/idlelib/textview.py +0 -193
  684. package/lib/python3.12/idlelib/tooltip.py +0 -190
  685. package/lib/python3.12/idlelib/tree.py +0 -509
  686. package/lib/python3.12/idlelib/undo.py +0 -367
  687. package/lib/python3.12/idlelib/util.py +0 -37
  688. package/lib/python3.12/idlelib/window.py +0 -98
  689. package/lib/python3.12/idlelib/zoomheight.py +0 -124
  690. package/lib/python3.12/idlelib/zzdummy.py +0 -73
  691. package/lib/python3.12/imaplib.py +0 -1641
  692. package/lib/python3.12/imghdr.py +0 -180
  693. package/lib/python3.12/importlib/__init__.py +0 -138
  694. package/lib/python3.12/importlib/_abc.py +0 -39
  695. package/lib/python3.12/importlib/_bootstrap.py +0 -1551
  696. package/lib/python3.12/importlib/_bootstrap_external.py +0 -1749
  697. package/lib/python3.12/importlib/abc.py +0 -239
  698. package/lib/python3.12/importlib/machinery.py +0 -20
  699. package/lib/python3.12/importlib/metadata/__init__.py +0 -966
  700. package/lib/python3.12/importlib/metadata/_adapters.py +0 -89
  701. package/lib/python3.12/importlib/metadata/_collections.py +0 -30
  702. package/lib/python3.12/importlib/metadata/_functools.py +0 -104
  703. package/lib/python3.12/importlib/metadata/_itertools.py +0 -73
  704. package/lib/python3.12/importlib/metadata/_meta.py +0 -63
  705. package/lib/python3.12/importlib/metadata/_text.py +0 -99
  706. package/lib/python3.12/importlib/readers.py +0 -12
  707. package/lib/python3.12/importlib/resources/__init__.py +0 -38
  708. package/lib/python3.12/importlib/resources/_adapters.py +0 -168
  709. package/lib/python3.12/importlib/resources/_common.py +0 -208
  710. package/lib/python3.12/importlib/resources/_itertools.py +0 -38
  711. package/lib/python3.12/importlib/resources/_legacy.py +0 -98
  712. package/lib/python3.12/importlib/resources/abc.py +0 -173
  713. package/lib/python3.12/importlib/resources/readers.py +0 -146
  714. package/lib/python3.12/importlib/resources/simple.py +0 -106
  715. package/lib/python3.12/importlib/simple.py +0 -14
  716. package/lib/python3.12/importlib/util.py +0 -270
  717. package/lib/python3.12/inspect.py +0 -3433
  718. package/lib/python3.12/io.py +0 -99
  719. package/lib/python3.12/ipaddress.py +0 -2380
  720. package/lib/python3.12/json/__init__.py +0 -359
  721. package/lib/python3.12/json/decoder.py +0 -357
  722. package/lib/python3.12/json/encoder.py +0 -443
  723. package/lib/python3.12/json/scanner.py +0 -73
  724. package/lib/python3.12/json/tool.py +0 -85
  725. package/lib/python3.12/keyword.py +0 -64
  726. package/lib/python3.12/lib-dynload/.empty +0 -0
  727. package/lib/python3.12/lib-dynload/_crypt.cpython-312-darwin.so +0 -0
  728. package/lib/python3.12/lib2to3/Grammar.txt +0 -196
  729. package/lib/python3.12/lib2to3/Grammar3.12.10.final.0.pickle +0 -0
  730. package/lib/python3.12/lib2to3/PatternGrammar.txt +0 -28
  731. package/lib/python3.12/lib2to3/PatternGrammar3.12.10.final.0.pickle +0 -0
  732. package/lib/python3.12/lib2to3/__init__.py +0 -8
  733. package/lib/python3.12/lib2to3/__main__.py +0 -4
  734. package/lib/python3.12/lib2to3/btm_matcher.py +0 -163
  735. package/lib/python3.12/lib2to3/btm_utils.py +0 -280
  736. package/lib/python3.12/lib2to3/fixer_base.py +0 -186
  737. package/lib/python3.12/lib2to3/fixer_util.py +0 -453
  738. package/lib/python3.12/lib2to3/fixes/__init__.py +0 -1
  739. package/lib/python3.12/lib2to3/fixes/fix_apply.py +0 -68
  740. package/lib/python3.12/lib2to3/fixes/fix_asserts.py +0 -34
  741. package/lib/python3.12/lib2to3/fixes/fix_basestring.py +0 -14
  742. package/lib/python3.12/lib2to3/fixes/fix_buffer.py +0 -22
  743. package/lib/python3.12/lib2to3/fixes/fix_dict.py +0 -106
  744. package/lib/python3.12/lib2to3/fixes/fix_except.py +0 -93
  745. package/lib/python3.12/lib2to3/fixes/fix_exec.py +0 -39
  746. package/lib/python3.12/lib2to3/fixes/fix_execfile.py +0 -53
  747. package/lib/python3.12/lib2to3/fixes/fix_exitfunc.py +0 -72
  748. package/lib/python3.12/lib2to3/fixes/fix_filter.py +0 -94
  749. package/lib/python3.12/lib2to3/fixes/fix_funcattrs.py +0 -21
  750. package/lib/python3.12/lib2to3/fixes/fix_future.py +0 -22
  751. package/lib/python3.12/lib2to3/fixes/fix_getcwdu.py +0 -19
  752. package/lib/python3.12/lib2to3/fixes/fix_has_key.py +0 -109
  753. package/lib/python3.12/lib2to3/fixes/fix_idioms.py +0 -152
  754. package/lib/python3.12/lib2to3/fixes/fix_import.py +0 -99
  755. package/lib/python3.12/lib2to3/fixes/fix_imports.py +0 -145
  756. package/lib/python3.12/lib2to3/fixes/fix_imports2.py +0 -16
  757. package/lib/python3.12/lib2to3/fixes/fix_input.py +0 -26
  758. package/lib/python3.12/lib2to3/fixes/fix_intern.py +0 -39
  759. package/lib/python3.12/lib2to3/fixes/fix_isinstance.py +0 -52
  760. package/lib/python3.12/lib2to3/fixes/fix_itertools.py +0 -43
  761. package/lib/python3.12/lib2to3/fixes/fix_itertools_imports.py +0 -57
  762. package/lib/python3.12/lib2to3/fixes/fix_long.py +0 -19
  763. package/lib/python3.12/lib2to3/fixes/fix_map.py +0 -110
  764. package/lib/python3.12/lib2to3/fixes/fix_metaclass.py +0 -228
  765. package/lib/python3.12/lib2to3/fixes/fix_methodattrs.py +0 -24
  766. package/lib/python3.12/lib2to3/fixes/fix_ne.py +0 -23
  767. package/lib/python3.12/lib2to3/fixes/fix_next.py +0 -103
  768. package/lib/python3.12/lib2to3/fixes/fix_nonzero.py +0 -21
  769. package/lib/python3.12/lib2to3/fixes/fix_numliterals.py +0 -28
  770. package/lib/python3.12/lib2to3/fixes/fix_operator.py +0 -97
  771. package/lib/python3.12/lib2to3/fixes/fix_paren.py +0 -44
  772. package/lib/python3.12/lib2to3/fixes/fix_print.py +0 -87
  773. package/lib/python3.12/lib2to3/fixes/fix_raise.py +0 -90
  774. package/lib/python3.12/lib2to3/fixes/fix_raw_input.py +0 -17
  775. package/lib/python3.12/lib2to3/fixes/fix_reduce.py +0 -35
  776. package/lib/python3.12/lib2to3/fixes/fix_reload.py +0 -36
  777. package/lib/python3.12/lib2to3/fixes/fix_renames.py +0 -70
  778. package/lib/python3.12/lib2to3/fixes/fix_repr.py +0 -23
  779. package/lib/python3.12/lib2to3/fixes/fix_set_literal.py +0 -53
  780. package/lib/python3.12/lib2to3/fixes/fix_standarderror.py +0 -18
  781. package/lib/python3.12/lib2to3/fixes/fix_sys_exc.py +0 -30
  782. package/lib/python3.12/lib2to3/fixes/fix_throw.py +0 -56
  783. package/lib/python3.12/lib2to3/fixes/fix_tuple_params.py +0 -175
  784. package/lib/python3.12/lib2to3/fixes/fix_types.py +0 -61
  785. package/lib/python3.12/lib2to3/fixes/fix_unicode.py +0 -42
  786. package/lib/python3.12/lib2to3/fixes/fix_urllib.py +0 -196
  787. package/lib/python3.12/lib2to3/fixes/fix_ws_comma.py +0 -39
  788. package/lib/python3.12/lib2to3/fixes/fix_xrange.py +0 -73
  789. package/lib/python3.12/lib2to3/fixes/fix_xreadlines.py +0 -25
  790. package/lib/python3.12/lib2to3/fixes/fix_zip.py +0 -46
  791. package/lib/python3.12/lib2to3/main.py +0 -273
  792. package/lib/python3.12/lib2to3/patcomp.py +0 -204
  793. package/lib/python3.12/lib2to3/pgen2/__init__.py +0 -4
  794. package/lib/python3.12/lib2to3/pgen2/conv.py +0 -257
  795. package/lib/python3.12/lib2to3/pgen2/driver.py +0 -177
  796. package/lib/python3.12/lib2to3/pgen2/grammar.py +0 -189
  797. package/lib/python3.12/lib2to3/pgen2/literals.py +0 -60
  798. package/lib/python3.12/lib2to3/pgen2/parse.py +0 -204
  799. package/lib/python3.12/lib2to3/pgen2/pgen.py +0 -386
  800. package/lib/python3.12/lib2to3/pgen2/token.py +0 -86
  801. package/lib/python3.12/lib2to3/pgen2/tokenize.py +0 -564
  802. package/lib/python3.12/lib2to3/pygram.py +0 -43
  803. package/lib/python3.12/lib2to3/pytree.py +0 -853
  804. package/lib/python3.12/lib2to3/refactor.py +0 -732
  805. package/lib/python3.12/linecache.py +0 -185
  806. package/lib/python3.12/locale.py +0 -1779
  807. package/lib/python3.12/logging/__init__.py +0 -2345
  808. package/lib/python3.12/logging/config.py +0 -1078
  809. package/lib/python3.12/logging/handlers.py +0 -1624
  810. package/lib/python3.12/lzma.py +0 -356
  811. package/lib/python3.12/mailbox.py +0 -2153
  812. package/lib/python3.12/mailcap.py +0 -302
  813. package/lib/python3.12/mimetypes.py +0 -656
  814. package/lib/python3.12/modulefinder.py +0 -666
  815. package/lib/python3.12/multiprocessing/__init__.py +0 -37
  816. package/lib/python3.12/multiprocessing/connection.py +0 -1178
  817. package/lib/python3.12/multiprocessing/context.py +0 -377
  818. package/lib/python3.12/multiprocessing/dummy/__init__.py +0 -126
  819. package/lib/python3.12/multiprocessing/dummy/connection.py +0 -75
  820. package/lib/python3.12/multiprocessing/forkserver.py +0 -350
  821. package/lib/python3.12/multiprocessing/heap.py +0 -337
  822. package/lib/python3.12/multiprocessing/managers.py +0 -1387
  823. package/lib/python3.12/multiprocessing/pool.py +0 -957
  824. package/lib/python3.12/multiprocessing/popen_fork.py +0 -83
  825. package/lib/python3.12/multiprocessing/popen_forkserver.py +0 -74
  826. package/lib/python3.12/multiprocessing/popen_spawn_posix.py +0 -72
  827. package/lib/python3.12/multiprocessing/popen_spawn_win32.py +0 -145
  828. package/lib/python3.12/multiprocessing/process.py +0 -439
  829. package/lib/python3.12/multiprocessing/queues.py +0 -401
  830. package/lib/python3.12/multiprocessing/reduction.py +0 -281
  831. package/lib/python3.12/multiprocessing/resource_sharer.py +0 -154
  832. package/lib/python3.12/multiprocessing/resource_tracker.py +0 -294
  833. package/lib/python3.12/multiprocessing/shared_memory.py +0 -534
  834. package/lib/python3.12/multiprocessing/sharedctypes.py +0 -240
  835. package/lib/python3.12/multiprocessing/spawn.py +0 -307
  836. package/lib/python3.12/multiprocessing/synchronize.py +0 -404
  837. package/lib/python3.12/multiprocessing/util.py +0 -494
  838. package/lib/python3.12/netrc.py +0 -192
  839. package/lib/python3.12/nntplib.py +0 -1093
  840. package/lib/python3.12/ntpath.py +0 -902
  841. package/lib/python3.12/nturl2path.py +0 -69
  842. package/lib/python3.12/numbers.py +0 -418
  843. package/lib/python3.12/opcode.py +0 -493
  844. package/lib/python3.12/operator.py +0 -467
  845. package/lib/python3.12/optparse.py +0 -1681
  846. package/lib/python3.12/os.py +0 -1159
  847. package/lib/python3.12/pathlib.py +0 -1435
  848. package/lib/python3.12/pdb.py +0 -1987
  849. package/lib/python3.12/pickle.py +0 -1866
  850. package/lib/python3.12/pickletools.py +0 -2904
  851. package/lib/python3.12/pipes.py +0 -250
  852. package/lib/python3.12/pkgutil.py +0 -529
  853. package/lib/python3.12/platform.py +0 -1359
  854. package/lib/python3.12/plistlib.py +0 -911
  855. package/lib/python3.12/poplib.py +0 -478
  856. package/lib/python3.12/posixpath.py +0 -573
  857. package/lib/python3.12/pprint.py +0 -658
  858. package/lib/python3.12/profile.py +0 -615
  859. package/lib/python3.12/pstats.py +0 -778
  860. package/lib/python3.12/pty.py +0 -211
  861. package/lib/python3.12/py_compile.py +0 -212
  862. package/lib/python3.12/pyclbr.py +0 -314
  863. package/lib/python3.12/pydoc.py +0 -2950
  864. package/lib/python3.12/pydoc_data/__init__.py +0 -0
  865. package/lib/python3.12/pydoc_data/_pydoc.css +0 -112
  866. package/lib/python3.12/pydoc_data/topics.py +0 -12500
  867. package/lib/python3.12/queue.py +0 -326
  868. package/lib/python3.12/quopri.py +0 -237
  869. package/lib/python3.12/random.py +0 -996
  870. package/lib/python3.12/re/__init__.py +0 -385
  871. package/lib/python3.12/re/_casefix.py +0 -106
  872. package/lib/python3.12/re/_compiler.py +0 -770
  873. package/lib/python3.12/re/_constants.py +0 -220
  874. package/lib/python3.12/re/_parser.py +0 -1080
  875. package/lib/python3.12/reprlib.py +0 -214
  876. package/lib/python3.12/rlcompleter.py +0 -219
  877. package/lib/python3.12/runpy.py +0 -319
  878. package/lib/python3.12/sched.py +0 -167
  879. package/lib/python3.12/secrets.py +0 -71
  880. package/lib/python3.12/selectors.py +0 -623
  881. package/lib/python3.12/shelve.py +0 -243
  882. package/lib/python3.12/shlex.py +0 -345
  883. package/lib/python3.12/shutil.py +0 -1566
  884. package/lib/python3.12/signal.py +0 -94
  885. package/lib/python3.12/site-packages/README.txt +0 -2
  886. package/lib/python3.12/site-packages/pip/__init__.py +0 -13
  887. package/lib/python3.12/site-packages/pip/__main__.py +0 -24
  888. package/lib/python3.12/site-packages/pip/__pip-runner__.py +0 -50
  889. package/lib/python3.12/site-packages/pip/_internal/__init__.py +0 -18
  890. package/lib/python3.12/site-packages/pip/_internal/build_env.py +0 -319
  891. package/lib/python3.12/site-packages/pip/_internal/cache.py +0 -290
  892. package/lib/python3.12/site-packages/pip/_internal/cli/__init__.py +0 -4
  893. package/lib/python3.12/site-packages/pip/_internal/cli/autocompletion.py +0 -176
  894. package/lib/python3.12/site-packages/pip/_internal/cli/base_command.py +0 -231
  895. package/lib/python3.12/site-packages/pip/_internal/cli/cmdoptions.py +0 -1075
  896. package/lib/python3.12/site-packages/pip/_internal/cli/command_context.py +0 -27
  897. package/lib/python3.12/site-packages/pip/_internal/cli/index_command.py +0 -170
  898. package/lib/python3.12/site-packages/pip/_internal/cli/main.py +0 -80
  899. package/lib/python3.12/site-packages/pip/_internal/cli/main_parser.py +0 -134
  900. package/lib/python3.12/site-packages/pip/_internal/cli/parser.py +0 -294
  901. package/lib/python3.12/site-packages/pip/_internal/cli/progress_bars.py +0 -94
  902. package/lib/python3.12/site-packages/pip/_internal/cli/req_command.py +0 -329
  903. package/lib/python3.12/site-packages/pip/_internal/cli/spinners.py +0 -159
  904. package/lib/python3.12/site-packages/pip/_internal/cli/status_codes.py +0 -6
  905. package/lib/python3.12/site-packages/pip/_internal/commands/__init__.py +0 -132
  906. package/lib/python3.12/site-packages/pip/_internal/commands/cache.py +0 -225
  907. package/lib/python3.12/site-packages/pip/_internal/commands/check.py +0 -67
  908. package/lib/python3.12/site-packages/pip/_internal/commands/completion.py +0 -130
  909. package/lib/python3.12/site-packages/pip/_internal/commands/configuration.py +0 -280
  910. package/lib/python3.12/site-packages/pip/_internal/commands/debug.py +0 -201
  911. package/lib/python3.12/site-packages/pip/_internal/commands/download.py +0 -146
  912. package/lib/python3.12/site-packages/pip/_internal/commands/freeze.py +0 -109
  913. package/lib/python3.12/site-packages/pip/_internal/commands/hash.py +0 -59
  914. package/lib/python3.12/site-packages/pip/_internal/commands/help.py +0 -41
  915. package/lib/python3.12/site-packages/pip/_internal/commands/index.py +0 -139
  916. package/lib/python3.12/site-packages/pip/_internal/commands/inspect.py +0 -92
  917. package/lib/python3.12/site-packages/pip/_internal/commands/install.py +0 -783
  918. package/lib/python3.12/site-packages/pip/_internal/commands/list.py +0 -375
  919. package/lib/python3.12/site-packages/pip/_internal/commands/search.py +0 -172
  920. package/lib/python3.12/site-packages/pip/_internal/commands/show.py +0 -217
  921. package/lib/python3.12/site-packages/pip/_internal/commands/uninstall.py +0 -114
  922. package/lib/python3.12/site-packages/pip/_internal/commands/wheel.py +0 -182
  923. package/lib/python3.12/site-packages/pip/_internal/configuration.py +0 -383
  924. package/lib/python3.12/site-packages/pip/_internal/distributions/__init__.py +0 -21
  925. package/lib/python3.12/site-packages/pip/_internal/distributions/base.py +0 -53
  926. package/lib/python3.12/site-packages/pip/_internal/distributions/installed.py +0 -29
  927. package/lib/python3.12/site-packages/pip/_internal/distributions/sdist.py +0 -158
  928. package/lib/python3.12/site-packages/pip/_internal/distributions/wheel.py +0 -42
  929. package/lib/python3.12/site-packages/pip/_internal/exceptions.py +0 -809
  930. package/lib/python3.12/site-packages/pip/_internal/index/__init__.py +0 -2
  931. package/lib/python3.12/site-packages/pip/_internal/index/collector.py +0 -494
  932. package/lib/python3.12/site-packages/pip/_internal/index/package_finder.py +0 -1020
  933. package/lib/python3.12/site-packages/pip/_internal/index/sources.py +0 -284
  934. package/lib/python3.12/site-packages/pip/_internal/locations/__init__.py +0 -456
  935. package/lib/python3.12/site-packages/pip/_internal/locations/_distutils.py +0 -172
  936. package/lib/python3.12/site-packages/pip/_internal/locations/_sysconfig.py +0 -214
  937. package/lib/python3.12/site-packages/pip/_internal/locations/base.py +0 -81
  938. package/lib/python3.12/site-packages/pip/_internal/main.py +0 -12
  939. package/lib/python3.12/site-packages/pip/_internal/metadata/__init__.py +0 -128
  940. package/lib/python3.12/site-packages/pip/_internal/metadata/_json.py +0 -84
  941. package/lib/python3.12/site-packages/pip/_internal/metadata/base.py +0 -688
  942. package/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__init__.py +0 -6
  943. package/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_compat.py +0 -85
  944. package/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_dists.py +0 -221
  945. package/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py +0 -189
  946. package/lib/python3.12/site-packages/pip/_internal/metadata/pkg_resources.py +0 -301
  947. package/lib/python3.12/site-packages/pip/_internal/models/__init__.py +0 -2
  948. package/lib/python3.12/site-packages/pip/_internal/models/candidate.py +0 -25
  949. package/lib/python3.12/site-packages/pip/_internal/models/direct_url.py +0 -224
  950. package/lib/python3.12/site-packages/pip/_internal/models/format_control.py +0 -78
  951. package/lib/python3.12/site-packages/pip/_internal/models/index.py +0 -28
  952. package/lib/python3.12/site-packages/pip/_internal/models/installation_report.py +0 -56
  953. package/lib/python3.12/site-packages/pip/_internal/models/link.py +0 -590
  954. package/lib/python3.12/site-packages/pip/_internal/models/scheme.py +0 -25
  955. package/lib/python3.12/site-packages/pip/_internal/models/search_scope.py +0 -127
  956. package/lib/python3.12/site-packages/pip/_internal/models/selection_prefs.py +0 -53
  957. package/lib/python3.12/site-packages/pip/_internal/models/target_python.py +0 -121
  958. package/lib/python3.12/site-packages/pip/_internal/models/wheel.py +0 -118
  959. package/lib/python3.12/site-packages/pip/_internal/network/__init__.py +0 -2
  960. package/lib/python3.12/site-packages/pip/_internal/network/auth.py +0 -566
  961. package/lib/python3.12/site-packages/pip/_internal/network/cache.py +0 -106
  962. package/lib/python3.12/site-packages/pip/_internal/network/download.py +0 -187
  963. package/lib/python3.12/site-packages/pip/_internal/network/lazy_wheel.py +0 -210
  964. package/lib/python3.12/site-packages/pip/_internal/network/session.py +0 -522
  965. package/lib/python3.12/site-packages/pip/_internal/network/utils.py +0 -98
  966. package/lib/python3.12/site-packages/pip/_internal/network/xmlrpc.py +0 -62
  967. package/lib/python3.12/site-packages/pip/_internal/operations/__init__.py +0 -0
  968. package/lib/python3.12/site-packages/pip/_internal/operations/build/__init__.py +0 -0
  969. package/lib/python3.12/site-packages/pip/_internal/operations/build/build_tracker.py +0 -138
  970. package/lib/python3.12/site-packages/pip/_internal/operations/build/metadata.py +0 -39
  971. package/lib/python3.12/site-packages/pip/_internal/operations/build/metadata_editable.py +0 -41
  972. package/lib/python3.12/site-packages/pip/_internal/operations/build/metadata_legacy.py +0 -74
  973. package/lib/python3.12/site-packages/pip/_internal/operations/build/wheel.py +0 -37
  974. package/lib/python3.12/site-packages/pip/_internal/operations/build/wheel_editable.py +0 -46
  975. package/lib/python3.12/site-packages/pip/_internal/operations/build/wheel_legacy.py +0 -102
  976. package/lib/python3.12/site-packages/pip/_internal/operations/check.py +0 -181
  977. package/lib/python3.12/site-packages/pip/_internal/operations/freeze.py +0 -258
  978. package/lib/python3.12/site-packages/pip/_internal/operations/install/__init__.py +0 -2
  979. package/lib/python3.12/site-packages/pip/_internal/operations/install/editable_legacy.py +0 -47
  980. package/lib/python3.12/site-packages/pip/_internal/operations/install/wheel.py +0 -741
  981. package/lib/python3.12/site-packages/pip/_internal/operations/prepare.py +0 -732
  982. package/lib/python3.12/site-packages/pip/_internal/pyproject.py +0 -185
  983. package/lib/python3.12/site-packages/pip/_internal/req/__init__.py +0 -90
  984. package/lib/python3.12/site-packages/pip/_internal/req/constructors.py +0 -560
  985. package/lib/python3.12/site-packages/pip/_internal/req/req_file.py +0 -574
  986. package/lib/python3.12/site-packages/pip/_internal/req/req_install.py +0 -934
  987. package/lib/python3.12/site-packages/pip/_internal/req/req_set.py +0 -82
  988. package/lib/python3.12/site-packages/pip/_internal/req/req_uninstall.py +0 -633
  989. package/lib/python3.12/site-packages/pip/_internal/resolution/__init__.py +0 -0
  990. package/lib/python3.12/site-packages/pip/_internal/resolution/base.py +0 -20
  991. package/lib/python3.12/site-packages/pip/_internal/resolution/legacy/__init__.py +0 -0
  992. package/lib/python3.12/site-packages/pip/_internal/resolution/legacy/resolver.py +0 -597
  993. package/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/__init__.py +0 -0
  994. package/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/base.py +0 -139
  995. package/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py +0 -574
  996. package/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/factory.py +0 -823
  997. package/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py +0 -174
  998. package/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/provider.py +0 -258
  999. package/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/reporter.py +0 -81
  1000. package/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/requirements.py +0 -245
  1001. package/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/resolver.py +0 -317
  1002. package/lib/python3.12/site-packages/pip/_internal/self_outdated_check.py +0 -244
  1003. package/lib/python3.12/site-packages/pip/_internal/utils/__init__.py +0 -0
  1004. package/lib/python3.12/site-packages/pip/_internal/utils/_jaraco_text.py +0 -109
  1005. package/lib/python3.12/site-packages/pip/_internal/utils/_log.py +0 -38
  1006. package/lib/python3.12/site-packages/pip/_internal/utils/appdirs.py +0 -52
  1007. package/lib/python3.12/site-packages/pip/_internal/utils/compat.py +0 -79
  1008. package/lib/python3.12/site-packages/pip/_internal/utils/compatibility_tags.py +0 -188
  1009. package/lib/python3.12/site-packages/pip/_internal/utils/datetime.py +0 -11
  1010. package/lib/python3.12/site-packages/pip/_internal/utils/deprecation.py +0 -124
  1011. package/lib/python3.12/site-packages/pip/_internal/utils/direct_url_helpers.py +0 -87
  1012. package/lib/python3.12/site-packages/pip/_internal/utils/egg_link.py +0 -80
  1013. package/lib/python3.12/site-packages/pip/_internal/utils/encoding.py +0 -36
  1014. package/lib/python3.12/site-packages/pip/_internal/utils/entrypoints.py +0 -84
  1015. package/lib/python3.12/site-packages/pip/_internal/utils/filesystem.py +0 -149
  1016. package/lib/python3.12/site-packages/pip/_internal/utils/filetypes.py +0 -27
  1017. package/lib/python3.12/site-packages/pip/_internal/utils/glibc.py +0 -101
  1018. package/lib/python3.12/site-packages/pip/_internal/utils/hashes.py +0 -147
  1019. package/lib/python3.12/site-packages/pip/_internal/utils/logging.py +0 -347
  1020. package/lib/python3.12/site-packages/pip/_internal/utils/misc.py +0 -772
  1021. package/lib/python3.12/site-packages/pip/_internal/utils/packaging.py +0 -57
  1022. package/lib/python3.12/site-packages/pip/_internal/utils/retry.py +0 -42
  1023. package/lib/python3.12/site-packages/pip/_internal/utils/setuptools_build.py +0 -146
  1024. package/lib/python3.12/site-packages/pip/_internal/utils/subprocess.py +0 -245
  1025. package/lib/python3.12/site-packages/pip/_internal/utils/temp_dir.py +0 -296
  1026. package/lib/python3.12/site-packages/pip/_internal/utils/unpacking.py +0 -337
  1027. package/lib/python3.12/site-packages/pip/_internal/utils/urls.py +0 -55
  1028. package/lib/python3.12/site-packages/pip/_internal/utils/virtualenv.py +0 -104
  1029. package/lib/python3.12/site-packages/pip/_internal/utils/wheel.py +0 -134
  1030. package/lib/python3.12/site-packages/pip/_internal/vcs/__init__.py +0 -15
  1031. package/lib/python3.12/site-packages/pip/_internal/vcs/bazaar.py +0 -112
  1032. package/lib/python3.12/site-packages/pip/_internal/vcs/git.py +0 -527
  1033. package/lib/python3.12/site-packages/pip/_internal/vcs/mercurial.py +0 -163
  1034. package/lib/python3.12/site-packages/pip/_internal/vcs/subversion.py +0 -324
  1035. package/lib/python3.12/site-packages/pip/_internal/vcs/versioncontrol.py +0 -688
  1036. package/lib/python3.12/site-packages/pip/_internal/wheel_builder.py +0 -354
  1037. package/lib/python3.12/site-packages/pip/_vendor/__init__.py +0 -116
  1038. package/lib/python3.12/site-packages/pip/_vendor/cachecontrol/__init__.py +0 -28
  1039. package/lib/python3.12/site-packages/pip/_vendor/cachecontrol/_cmd.py +0 -70
  1040. package/lib/python3.12/site-packages/pip/_vendor/cachecontrol/adapter.py +0 -161
  1041. package/lib/python3.12/site-packages/pip/_vendor/cachecontrol/cache.py +0 -74
  1042. package/lib/python3.12/site-packages/pip/_vendor/cachecontrol/caches/__init__.py +0 -8
  1043. package/lib/python3.12/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py +0 -182
  1044. package/lib/python3.12/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py +0 -48
  1045. package/lib/python3.12/site-packages/pip/_vendor/cachecontrol/controller.py +0 -499
  1046. package/lib/python3.12/site-packages/pip/_vendor/cachecontrol/filewrapper.py +0 -119
  1047. package/lib/python3.12/site-packages/pip/_vendor/cachecontrol/heuristics.py +0 -154
  1048. package/lib/python3.12/site-packages/pip/_vendor/cachecontrol/py.typed +0 -0
  1049. package/lib/python3.12/site-packages/pip/_vendor/cachecontrol/serialize.py +0 -146
  1050. package/lib/python3.12/site-packages/pip/_vendor/cachecontrol/wrapper.py +0 -43
  1051. package/lib/python3.12/site-packages/pip/_vendor/certifi/__init__.py +0 -4
  1052. package/lib/python3.12/site-packages/pip/_vendor/certifi/__main__.py +0 -12
  1053. package/lib/python3.12/site-packages/pip/_vendor/certifi/cacert.pem +0 -4929
  1054. package/lib/python3.12/site-packages/pip/_vendor/certifi/core.py +0 -114
  1055. package/lib/python3.12/site-packages/pip/_vendor/certifi/py.typed +0 -0
  1056. package/lib/python3.12/site-packages/pip/_vendor/distlib/__init__.py +0 -33
  1057. package/lib/python3.12/site-packages/pip/_vendor/distlib/compat.py +0 -1137
  1058. package/lib/python3.12/site-packages/pip/_vendor/distlib/database.py +0 -1329
  1059. package/lib/python3.12/site-packages/pip/_vendor/distlib/index.py +0 -508
  1060. package/lib/python3.12/site-packages/pip/_vendor/distlib/locators.py +0 -1295
  1061. package/lib/python3.12/site-packages/pip/_vendor/distlib/manifest.py +0 -384
  1062. package/lib/python3.12/site-packages/pip/_vendor/distlib/markers.py +0 -162
  1063. package/lib/python3.12/site-packages/pip/_vendor/distlib/metadata.py +0 -1031
  1064. package/lib/python3.12/site-packages/pip/_vendor/distlib/resources.py +0 -358
  1065. package/lib/python3.12/site-packages/pip/_vendor/distlib/scripts.py +0 -447
  1066. package/lib/python3.12/site-packages/pip/_vendor/distlib/t32.exe +0 -0
  1067. package/lib/python3.12/site-packages/pip/_vendor/distlib/t64-arm.exe +0 -0
  1068. package/lib/python3.12/site-packages/pip/_vendor/distlib/t64.exe +0 -0
  1069. package/lib/python3.12/site-packages/pip/_vendor/distlib/util.py +0 -1984
  1070. package/lib/python3.12/site-packages/pip/_vendor/distlib/version.py +0 -750
  1071. package/lib/python3.12/site-packages/pip/_vendor/distlib/w32.exe +0 -0
  1072. package/lib/python3.12/site-packages/pip/_vendor/distlib/w64-arm.exe +0 -0
  1073. package/lib/python3.12/site-packages/pip/_vendor/distlib/w64.exe +0 -0
  1074. package/lib/python3.12/site-packages/pip/_vendor/distlib/wheel.py +0 -1100
  1075. package/lib/python3.12/site-packages/pip/_vendor/distro/__init__.py +0 -54
  1076. package/lib/python3.12/site-packages/pip/_vendor/distro/__main__.py +0 -4
  1077. package/lib/python3.12/site-packages/pip/_vendor/distro/distro.py +0 -1403
  1078. package/lib/python3.12/site-packages/pip/_vendor/distro/py.typed +0 -0
  1079. package/lib/python3.12/site-packages/pip/_vendor/idna/__init__.py +0 -44
  1080. package/lib/python3.12/site-packages/pip/_vendor/idna/codec.py +0 -118
  1081. package/lib/python3.12/site-packages/pip/_vendor/idna/compat.py +0 -13
  1082. package/lib/python3.12/site-packages/pip/_vendor/idna/core.py +0 -395
  1083. package/lib/python3.12/site-packages/pip/_vendor/idna/idnadata.py +0 -4245
  1084. package/lib/python3.12/site-packages/pip/_vendor/idna/intranges.py +0 -54
  1085. package/lib/python3.12/site-packages/pip/_vendor/idna/package_data.py +0 -2
  1086. package/lib/python3.12/site-packages/pip/_vendor/idna/py.typed +0 -0
  1087. package/lib/python3.12/site-packages/pip/_vendor/idna/uts46data.py +0 -8598
  1088. package/lib/python3.12/site-packages/pip/_vendor/msgpack/__init__.py +0 -55
  1089. package/lib/python3.12/site-packages/pip/_vendor/msgpack/exceptions.py +0 -48
  1090. package/lib/python3.12/site-packages/pip/_vendor/msgpack/ext.py +0 -168
  1091. package/lib/python3.12/site-packages/pip/_vendor/msgpack/fallback.py +0 -951
  1092. package/lib/python3.12/site-packages/pip/_vendor/packaging/__init__.py +0 -15
  1093. package/lib/python3.12/site-packages/pip/_vendor/packaging/_elffile.py +0 -110
  1094. package/lib/python3.12/site-packages/pip/_vendor/packaging/_manylinux.py +0 -262
  1095. package/lib/python3.12/site-packages/pip/_vendor/packaging/_musllinux.py +0 -85
  1096. package/lib/python3.12/site-packages/pip/_vendor/packaging/_parser.py +0 -354
  1097. package/lib/python3.12/site-packages/pip/_vendor/packaging/_structures.py +0 -61
  1098. package/lib/python3.12/site-packages/pip/_vendor/packaging/_tokenizer.py +0 -194
  1099. package/lib/python3.12/site-packages/pip/_vendor/packaging/markers.py +0 -325
  1100. package/lib/python3.12/site-packages/pip/_vendor/packaging/metadata.py +0 -804
  1101. package/lib/python3.12/site-packages/pip/_vendor/packaging/py.typed +0 -0
  1102. package/lib/python3.12/site-packages/pip/_vendor/packaging/requirements.py +0 -91
  1103. package/lib/python3.12/site-packages/pip/_vendor/packaging/specifiers.py +0 -1009
  1104. package/lib/python3.12/site-packages/pip/_vendor/packaging/tags.py +0 -627
  1105. package/lib/python3.12/site-packages/pip/_vendor/packaging/utils.py +0 -174
  1106. package/lib/python3.12/site-packages/pip/_vendor/packaging/version.py +0 -563
  1107. package/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__init__.py +0 -3676
  1108. package/lib/python3.12/site-packages/pip/_vendor/platformdirs/__init__.py +0 -627
  1109. package/lib/python3.12/site-packages/pip/_vendor/platformdirs/__main__.py +0 -55
  1110. package/lib/python3.12/site-packages/pip/_vendor/platformdirs/android.py +0 -249
  1111. package/lib/python3.12/site-packages/pip/_vendor/platformdirs/api.py +0 -292
  1112. package/lib/python3.12/site-packages/pip/_vendor/platformdirs/macos.py +0 -130
  1113. package/lib/python3.12/site-packages/pip/_vendor/platformdirs/py.typed +0 -0
  1114. package/lib/python3.12/site-packages/pip/_vendor/platformdirs/unix.py +0 -275
  1115. package/lib/python3.12/site-packages/pip/_vendor/platformdirs/version.py +0 -16
  1116. package/lib/python3.12/site-packages/pip/_vendor/platformdirs/windows.py +0 -272
  1117. package/lib/python3.12/site-packages/pip/_vendor/pygments/__init__.py +0 -82
  1118. package/lib/python3.12/site-packages/pip/_vendor/pygments/__main__.py +0 -17
  1119. package/lib/python3.12/site-packages/pip/_vendor/pygments/cmdline.py +0 -668
  1120. package/lib/python3.12/site-packages/pip/_vendor/pygments/console.py +0 -70
  1121. package/lib/python3.12/site-packages/pip/_vendor/pygments/filter.py +0 -70
  1122. package/lib/python3.12/site-packages/pip/_vendor/pygments/filters/__init__.py +0 -940
  1123. package/lib/python3.12/site-packages/pip/_vendor/pygments/formatter.py +0 -129
  1124. package/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__init__.py +0 -157
  1125. package/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/_mapping.py +0 -23
  1126. package/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/bbcode.py +0 -108
  1127. package/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/groff.py +0 -170
  1128. package/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/html.py +0 -987
  1129. package/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/img.py +0 -685
  1130. package/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/irc.py +0 -154
  1131. package/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/latex.py +0 -518
  1132. package/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/other.py +0 -160
  1133. package/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/pangomarkup.py +0 -83
  1134. package/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/rtf.py +0 -349
  1135. package/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/svg.py +0 -185
  1136. package/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/terminal.py +0 -127
  1137. package/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/terminal256.py +0 -338
  1138. package/lib/python3.12/site-packages/pip/_vendor/pygments/lexer.py +0 -963
  1139. package/lib/python3.12/site-packages/pip/_vendor/pygments/lexers/__init__.py +0 -362
  1140. package/lib/python3.12/site-packages/pip/_vendor/pygments/lexers/_mapping.py +0 -589
  1141. package/lib/python3.12/site-packages/pip/_vendor/pygments/lexers/python.py +0 -1198
  1142. package/lib/python3.12/site-packages/pip/_vendor/pygments/modeline.py +0 -43
  1143. package/lib/python3.12/site-packages/pip/_vendor/pygments/plugin.py +0 -72
  1144. package/lib/python3.12/site-packages/pip/_vendor/pygments/regexopt.py +0 -91
  1145. package/lib/python3.12/site-packages/pip/_vendor/pygments/scanner.py +0 -104
  1146. package/lib/python3.12/site-packages/pip/_vendor/pygments/sphinxext.py +0 -247
  1147. package/lib/python3.12/site-packages/pip/_vendor/pygments/style.py +0 -203
  1148. package/lib/python3.12/site-packages/pip/_vendor/pygments/styles/__init__.py +0 -61
  1149. package/lib/python3.12/site-packages/pip/_vendor/pygments/styles/_mapping.py +0 -54
  1150. package/lib/python3.12/site-packages/pip/_vendor/pygments/token.py +0 -214
  1151. package/lib/python3.12/site-packages/pip/_vendor/pygments/unistring.py +0 -153
  1152. package/lib/python3.12/site-packages/pip/_vendor/pygments/util.py +0 -324
  1153. package/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/__init__.py +0 -23
  1154. package/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_compat.py +0 -8
  1155. package/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_impl.py +0 -330
  1156. package/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/__init__.py +0 -18
  1157. package/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py +0 -353
  1158. package/lib/python3.12/site-packages/pip/_vendor/requests/__init__.py +0 -179
  1159. package/lib/python3.12/site-packages/pip/_vendor/requests/__version__.py +0 -14
  1160. package/lib/python3.12/site-packages/pip/_vendor/requests/_internal_utils.py +0 -50
  1161. package/lib/python3.12/site-packages/pip/_vendor/requests/adapters.py +0 -719
  1162. package/lib/python3.12/site-packages/pip/_vendor/requests/api.py +0 -157
  1163. package/lib/python3.12/site-packages/pip/_vendor/requests/auth.py +0 -314
  1164. package/lib/python3.12/site-packages/pip/_vendor/requests/certs.py +0 -24
  1165. package/lib/python3.12/site-packages/pip/_vendor/requests/compat.py +0 -78
  1166. package/lib/python3.12/site-packages/pip/_vendor/requests/cookies.py +0 -561
  1167. package/lib/python3.12/site-packages/pip/_vendor/requests/exceptions.py +0 -151
  1168. package/lib/python3.12/site-packages/pip/_vendor/requests/help.py +0 -127
  1169. package/lib/python3.12/site-packages/pip/_vendor/requests/hooks.py +0 -33
  1170. package/lib/python3.12/site-packages/pip/_vendor/requests/models.py +0 -1037
  1171. package/lib/python3.12/site-packages/pip/_vendor/requests/packages.py +0 -25
  1172. package/lib/python3.12/site-packages/pip/_vendor/requests/sessions.py +0 -831
  1173. package/lib/python3.12/site-packages/pip/_vendor/requests/status_codes.py +0 -128
  1174. package/lib/python3.12/site-packages/pip/_vendor/requests/structures.py +0 -99
  1175. package/lib/python3.12/site-packages/pip/_vendor/requests/utils.py +0 -1096
  1176. package/lib/python3.12/site-packages/pip/_vendor/resolvelib/__init__.py +0 -26
  1177. package/lib/python3.12/site-packages/pip/_vendor/resolvelib/compat/__init__.py +0 -0
  1178. package/lib/python3.12/site-packages/pip/_vendor/resolvelib/compat/collections_abc.py +0 -6
  1179. package/lib/python3.12/site-packages/pip/_vendor/resolvelib/providers.py +0 -133
  1180. package/lib/python3.12/site-packages/pip/_vendor/resolvelib/py.typed +0 -0
  1181. package/lib/python3.12/site-packages/pip/_vendor/resolvelib/reporters.py +0 -43
  1182. package/lib/python3.12/site-packages/pip/_vendor/resolvelib/resolvers.py +0 -547
  1183. package/lib/python3.12/site-packages/pip/_vendor/resolvelib/structs.py +0 -170
  1184. package/lib/python3.12/site-packages/pip/_vendor/rich/__init__.py +0 -177
  1185. package/lib/python3.12/site-packages/pip/_vendor/rich/__main__.py +0 -273
  1186. package/lib/python3.12/site-packages/pip/_vendor/rich/_cell_widths.py +0 -454
  1187. package/lib/python3.12/site-packages/pip/_vendor/rich/_emoji_codes.py +0 -3610
  1188. package/lib/python3.12/site-packages/pip/_vendor/rich/_emoji_replace.py +0 -32
  1189. package/lib/python3.12/site-packages/pip/_vendor/rich/_export_format.py +0 -76
  1190. package/lib/python3.12/site-packages/pip/_vendor/rich/_extension.py +0 -10
  1191. package/lib/python3.12/site-packages/pip/_vendor/rich/_fileno.py +0 -24
  1192. package/lib/python3.12/site-packages/pip/_vendor/rich/_inspect.py +0 -270
  1193. package/lib/python3.12/site-packages/pip/_vendor/rich/_log_render.py +0 -94
  1194. package/lib/python3.12/site-packages/pip/_vendor/rich/_loop.py +0 -43
  1195. package/lib/python3.12/site-packages/pip/_vendor/rich/_null_file.py +0 -69
  1196. package/lib/python3.12/site-packages/pip/_vendor/rich/_palettes.py +0 -309
  1197. package/lib/python3.12/site-packages/pip/_vendor/rich/_pick.py +0 -17
  1198. package/lib/python3.12/site-packages/pip/_vendor/rich/_ratio.py +0 -159
  1199. package/lib/python3.12/site-packages/pip/_vendor/rich/_spinners.py +0 -482
  1200. package/lib/python3.12/site-packages/pip/_vendor/rich/_stack.py +0 -16
  1201. package/lib/python3.12/site-packages/pip/_vendor/rich/_timer.py +0 -19
  1202. package/lib/python3.12/site-packages/pip/_vendor/rich/_win32_console.py +0 -662
  1203. package/lib/python3.12/site-packages/pip/_vendor/rich/_windows.py +0 -71
  1204. package/lib/python3.12/site-packages/pip/_vendor/rich/_windows_renderer.py +0 -56
  1205. package/lib/python3.12/site-packages/pip/_vendor/rich/_wrap.py +0 -93
  1206. package/lib/python3.12/site-packages/pip/_vendor/rich/abc.py +0 -33
  1207. package/lib/python3.12/site-packages/pip/_vendor/rich/align.py +0 -311
  1208. package/lib/python3.12/site-packages/pip/_vendor/rich/ansi.py +0 -240
  1209. package/lib/python3.12/site-packages/pip/_vendor/rich/bar.py +0 -93
  1210. package/lib/python3.12/site-packages/pip/_vendor/rich/box.py +0 -480
  1211. package/lib/python3.12/site-packages/pip/_vendor/rich/cells.py +0 -167
  1212. package/lib/python3.12/site-packages/pip/_vendor/rich/color.py +0 -621
  1213. package/lib/python3.12/site-packages/pip/_vendor/rich/color_triplet.py +0 -38
  1214. package/lib/python3.12/site-packages/pip/_vendor/rich/columns.py +0 -187
  1215. package/lib/python3.12/site-packages/pip/_vendor/rich/console.py +0 -2633
  1216. package/lib/python3.12/site-packages/pip/_vendor/rich/constrain.py +0 -37
  1217. package/lib/python3.12/site-packages/pip/_vendor/rich/containers.py +0 -167
  1218. package/lib/python3.12/site-packages/pip/_vendor/rich/control.py +0 -225
  1219. package/lib/python3.12/site-packages/pip/_vendor/rich/default_styles.py +0 -190
  1220. package/lib/python3.12/site-packages/pip/_vendor/rich/diagnose.py +0 -37
  1221. package/lib/python3.12/site-packages/pip/_vendor/rich/emoji.py +0 -96
  1222. package/lib/python3.12/site-packages/pip/_vendor/rich/errors.py +0 -34
  1223. package/lib/python3.12/site-packages/pip/_vendor/rich/file_proxy.py +0 -57
  1224. package/lib/python3.12/site-packages/pip/_vendor/rich/filesize.py +0 -89
  1225. package/lib/python3.12/site-packages/pip/_vendor/rich/highlighter.py +0 -232
  1226. package/lib/python3.12/site-packages/pip/_vendor/rich/json.py +0 -139
  1227. package/lib/python3.12/site-packages/pip/_vendor/rich/jupyter.py +0 -101
  1228. package/lib/python3.12/site-packages/pip/_vendor/rich/layout.py +0 -442
  1229. package/lib/python3.12/site-packages/pip/_vendor/rich/live.py +0 -375
  1230. package/lib/python3.12/site-packages/pip/_vendor/rich/live_render.py +0 -112
  1231. package/lib/python3.12/site-packages/pip/_vendor/rich/logging.py +0 -289
  1232. package/lib/python3.12/site-packages/pip/_vendor/rich/markup.py +0 -251
  1233. package/lib/python3.12/site-packages/pip/_vendor/rich/measure.py +0 -151
  1234. package/lib/python3.12/site-packages/pip/_vendor/rich/padding.py +0 -141
  1235. package/lib/python3.12/site-packages/pip/_vendor/rich/pager.py +0 -34
  1236. package/lib/python3.12/site-packages/pip/_vendor/rich/palette.py +0 -100
  1237. package/lib/python3.12/site-packages/pip/_vendor/rich/panel.py +0 -312
  1238. package/lib/python3.12/site-packages/pip/_vendor/rich/pretty.py +0 -995
  1239. package/lib/python3.12/site-packages/pip/_vendor/rich/progress.py +0 -1699
  1240. package/lib/python3.12/site-packages/pip/_vendor/rich/progress_bar.py +0 -223
  1241. package/lib/python3.12/site-packages/pip/_vendor/rich/prompt.py +0 -375
  1242. package/lib/python3.12/site-packages/pip/_vendor/rich/protocol.py +0 -42
  1243. package/lib/python3.12/site-packages/pip/_vendor/rich/py.typed +0 -0
  1244. package/lib/python3.12/site-packages/pip/_vendor/rich/region.py +0 -10
  1245. package/lib/python3.12/site-packages/pip/_vendor/rich/repr.py +0 -149
  1246. package/lib/python3.12/site-packages/pip/_vendor/rich/rule.py +0 -130
  1247. package/lib/python3.12/site-packages/pip/_vendor/rich/scope.py +0 -86
  1248. package/lib/python3.12/site-packages/pip/_vendor/rich/screen.py +0 -54
  1249. package/lib/python3.12/site-packages/pip/_vendor/rich/segment.py +0 -738
  1250. package/lib/python3.12/site-packages/pip/_vendor/rich/spinner.py +0 -137
  1251. package/lib/python3.12/site-packages/pip/_vendor/rich/status.py +0 -131
  1252. package/lib/python3.12/site-packages/pip/_vendor/rich/style.py +0 -796
  1253. package/lib/python3.12/site-packages/pip/_vendor/rich/styled.py +0 -42
  1254. package/lib/python3.12/site-packages/pip/_vendor/rich/syntax.py +0 -958
  1255. package/lib/python3.12/site-packages/pip/_vendor/rich/table.py +0 -1000
  1256. package/lib/python3.12/site-packages/pip/_vendor/rich/terminal_theme.py +0 -153
  1257. package/lib/python3.12/site-packages/pip/_vendor/rich/text.py +0 -1357
  1258. package/lib/python3.12/site-packages/pip/_vendor/rich/theme.py +0 -115
  1259. package/lib/python3.12/site-packages/pip/_vendor/rich/themes.py +0 -5
  1260. package/lib/python3.12/site-packages/pip/_vendor/rich/traceback.py +0 -753
  1261. package/lib/python3.12/site-packages/pip/_vendor/rich/tree.py +0 -249
  1262. package/lib/python3.12/site-packages/pip/_vendor/tomli/__init__.py +0 -11
  1263. package/lib/python3.12/site-packages/pip/_vendor/tomli/_parser.py +0 -691
  1264. package/lib/python3.12/site-packages/pip/_vendor/tomli/_re.py +0 -107
  1265. package/lib/python3.12/site-packages/pip/_vendor/tomli/_types.py +0 -10
  1266. package/lib/python3.12/site-packages/pip/_vendor/tomli/py.typed +0 -1
  1267. package/lib/python3.12/site-packages/pip/_vendor/truststore/__init__.py +0 -36
  1268. package/lib/python3.12/site-packages/pip/_vendor/truststore/_api.py +0 -316
  1269. package/lib/python3.12/site-packages/pip/_vendor/truststore/_macos.py +0 -571
  1270. package/lib/python3.12/site-packages/pip/_vendor/truststore/_openssl.py +0 -66
  1271. package/lib/python3.12/site-packages/pip/_vendor/truststore/_ssl_constants.py +0 -31
  1272. package/lib/python3.12/site-packages/pip/_vendor/truststore/_windows.py +0 -567
  1273. package/lib/python3.12/site-packages/pip/_vendor/truststore/py.typed +0 -0
  1274. package/lib/python3.12/site-packages/pip/_vendor/typing_extensions.py +0 -3641
  1275. package/lib/python3.12/site-packages/pip/_vendor/urllib3/__init__.py +0 -102
  1276. package/lib/python3.12/site-packages/pip/_vendor/urllib3/_collections.py +0 -355
  1277. package/lib/python3.12/site-packages/pip/_vendor/urllib3/_version.py +0 -2
  1278. package/lib/python3.12/site-packages/pip/_vendor/urllib3/connection.py +0 -572
  1279. package/lib/python3.12/site-packages/pip/_vendor/urllib3/connectionpool.py +0 -1140
  1280. package/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/__init__.py +0 -0
  1281. package/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/_appengine_environ.py +0 -36
  1282. package/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py +0 -0
  1283. package/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py +0 -519
  1284. package/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py +0 -397
  1285. package/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/appengine.py +0 -314
  1286. package/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/ntlmpool.py +0 -130
  1287. package/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +0 -518
  1288. package/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/securetransport.py +0 -920
  1289. package/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/socks.py +0 -216
  1290. package/lib/python3.12/site-packages/pip/_vendor/urllib3/exceptions.py +0 -323
  1291. package/lib/python3.12/site-packages/pip/_vendor/urllib3/fields.py +0 -274
  1292. package/lib/python3.12/site-packages/pip/_vendor/urllib3/filepost.py +0 -98
  1293. package/lib/python3.12/site-packages/pip/_vendor/urllib3/packages/__init__.py +0 -0
  1294. package/lib/python3.12/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py +0 -0
  1295. package/lib/python3.12/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py +0 -51
  1296. package/lib/python3.12/site-packages/pip/_vendor/urllib3/packages/backports/weakref_finalize.py +0 -155
  1297. package/lib/python3.12/site-packages/pip/_vendor/urllib3/packages/six.py +0 -1076
  1298. package/lib/python3.12/site-packages/pip/_vendor/urllib3/poolmanager.py +0 -540
  1299. package/lib/python3.12/site-packages/pip/_vendor/urllib3/request.py +0 -191
  1300. package/lib/python3.12/site-packages/pip/_vendor/urllib3/response.py +0 -879
  1301. package/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__init__.py +0 -49
  1302. package/lib/python3.12/site-packages/pip/_vendor/urllib3/util/connection.py +0 -149
  1303. package/lib/python3.12/site-packages/pip/_vendor/urllib3/util/proxy.py +0 -57
  1304. package/lib/python3.12/site-packages/pip/_vendor/urllib3/util/queue.py +0 -22
  1305. package/lib/python3.12/site-packages/pip/_vendor/urllib3/util/request.py +0 -137
  1306. package/lib/python3.12/site-packages/pip/_vendor/urllib3/util/response.py +0 -107
  1307. package/lib/python3.12/site-packages/pip/_vendor/urllib3/util/retry.py +0 -622
  1308. package/lib/python3.12/site-packages/pip/_vendor/urllib3/util/ssl_.py +0 -504
  1309. package/lib/python3.12/site-packages/pip/_vendor/urllib3/util/ssl_match_hostname.py +0 -159
  1310. package/lib/python3.12/site-packages/pip/_vendor/urllib3/util/ssltransport.py +0 -221
  1311. package/lib/python3.12/site-packages/pip/_vendor/urllib3/util/timeout.py +0 -271
  1312. package/lib/python3.12/site-packages/pip/_vendor/urllib3/util/url.py +0 -435
  1313. package/lib/python3.12/site-packages/pip/_vendor/urllib3/util/wait.py +0 -152
  1314. package/lib/python3.12/site-packages/pip/_vendor/vendor.txt +0 -18
  1315. package/lib/python3.12/site-packages/pip/py.typed +0 -4
  1316. package/lib/python3.12/site-packages/pip-24.3.1.dist-info/AUTHORS.txt +0 -799
  1317. package/lib/python3.12/site-packages/pip-24.3.1.dist-info/INSTALLER +0 -1
  1318. package/lib/python3.12/site-packages/pip-24.3.1.dist-info/LICENSE.txt +0 -20
  1319. package/lib/python3.12/site-packages/pip-24.3.1.dist-info/METADATA +0 -90
  1320. package/lib/python3.12/site-packages/pip-24.3.1.dist-info/RECORD +0 -854
  1321. package/lib/python3.12/site-packages/pip-24.3.1.dist-info/REQUESTED +0 -0
  1322. package/lib/python3.12/site-packages/pip-24.3.1.dist-info/WHEEL +0 -5
  1323. package/lib/python3.12/site-packages/pip-24.3.1.dist-info/direct_url.json +0 -1
  1324. package/lib/python3.12/site-packages/pip-24.3.1.dist-info/entry_points.txt +0 -3
  1325. package/lib/python3.12/site-packages/pip-24.3.1.dist-info/top_level.txt +0 -1
  1326. package/lib/python3.12/site.py +0 -693
  1327. package/lib/python3.12/smtplib.py +0 -1109
  1328. package/lib/python3.12/sndhdr.py +0 -271
  1329. package/lib/python3.12/socket.py +0 -983
  1330. package/lib/python3.12/socketserver.py +0 -863
  1331. package/lib/python3.12/sqlite3/__init__.py +0 -70
  1332. package/lib/python3.12/sqlite3/__main__.py +0 -127
  1333. package/lib/python3.12/sqlite3/dbapi2.py +0 -108
  1334. package/lib/python3.12/sqlite3/dump.py +0 -89
  1335. package/lib/python3.12/sre_compile.py +0 -7
  1336. package/lib/python3.12/sre_constants.py +0 -7
  1337. package/lib/python3.12/sre_parse.py +0 -7
  1338. package/lib/python3.12/ssl.py +0 -1476
  1339. package/lib/python3.12/stat.py +0 -195
  1340. package/lib/python3.12/statistics.py +0 -1454
  1341. package/lib/python3.12/string.py +0 -309
  1342. package/lib/python3.12/stringprep.py +0 -272
  1343. package/lib/python3.12/struct.py +0 -15
  1344. package/lib/python3.12/subprocess.py +0 -2216
  1345. package/lib/python3.12/sunau.py +0 -533
  1346. package/lib/python3.12/symtable.py +0 -362
  1347. package/lib/python3.12/sysconfig.py +0 -894
  1348. package/lib/python3.12/tabnanny.py +0 -340
  1349. package/lib/python3.12/tarfile.py +0 -2933
  1350. package/lib/python3.12/telnetlib.py +0 -680
  1351. package/lib/python3.12/tempfile.py +0 -956
  1352. package/lib/python3.12/textwrap.py +0 -491
  1353. package/lib/python3.12/this.py +0 -28
  1354. package/lib/python3.12/threading.py +0 -1708
  1355. package/lib/python3.12/timeit.py +0 -381
  1356. package/lib/python3.12/tkinter/__init__.py +0 -4682
  1357. package/lib/python3.12/tkinter/__main__.py +0 -7
  1358. package/lib/python3.12/tkinter/colorchooser.py +0 -86
  1359. package/lib/python3.12/tkinter/commondialog.py +0 -53
  1360. package/lib/python3.12/tkinter/constants.py +0 -110
  1361. package/lib/python3.12/tkinter/dialog.py +0 -49
  1362. package/lib/python3.12/tkinter/dnd.py +0 -324
  1363. package/lib/python3.12/tkinter/filedialog.py +0 -492
  1364. package/lib/python3.12/tkinter/font.py +0 -239
  1365. package/lib/python3.12/tkinter/messagebox.py +0 -146
  1366. package/lib/python3.12/tkinter/scrolledtext.py +0 -56
  1367. package/lib/python3.12/tkinter/simpledialog.py +0 -441
  1368. package/lib/python3.12/tkinter/tix.py +0 -1948
  1369. package/lib/python3.12/tkinter/ttk.py +0 -1640
  1370. package/lib/python3.12/token.py +0 -143
  1371. package/lib/python3.12/tokenize.py +0 -594
  1372. package/lib/python3.12/tomllib/__init__.py +0 -10
  1373. package/lib/python3.12/tomllib/_parser.py +0 -691
  1374. package/lib/python3.12/tomllib/_re.py +0 -107
  1375. package/lib/python3.12/tomllib/_types.py +0 -10
  1376. package/lib/python3.12/trace.py +0 -748
  1377. package/lib/python3.12/traceback.py +0 -1187
  1378. package/lib/python3.12/tracemalloc.py +0 -560
  1379. package/lib/python3.12/tty.py +0 -73
  1380. package/lib/python3.12/turtle.py +0 -4207
  1381. package/lib/python3.12/turtledemo/__init__.py +0 -14
  1382. package/lib/python3.12/turtledemo/__main__.py +0 -404
  1383. package/lib/python3.12/turtledemo/bytedesign.py +0 -161
  1384. package/lib/python3.12/turtledemo/chaos.py +0 -59
  1385. package/lib/python3.12/turtledemo/clock.py +0 -138
  1386. package/lib/python3.12/turtledemo/colormixer.py +0 -58
  1387. package/lib/python3.12/turtledemo/forest.py +0 -108
  1388. package/lib/python3.12/turtledemo/fractalcurves.py +0 -138
  1389. package/lib/python3.12/turtledemo/lindenmayer.py +0 -119
  1390. package/lib/python3.12/turtledemo/minimal_hanoi.py +0 -79
  1391. package/lib/python3.12/turtledemo/nim.py +0 -226
  1392. package/lib/python3.12/turtledemo/paint.py +0 -54
  1393. package/lib/python3.12/turtledemo/peace.py +0 -61
  1394. package/lib/python3.12/turtledemo/penrose.py +0 -175
  1395. package/lib/python3.12/turtledemo/planet_and_moon.py +0 -111
  1396. package/lib/python3.12/turtledemo/rosette.py +0 -65
  1397. package/lib/python3.12/turtledemo/round_dance.py +0 -86
  1398. package/lib/python3.12/turtledemo/sorting_animate.py +0 -204
  1399. package/lib/python3.12/turtledemo/tree.py +0 -62
  1400. package/lib/python3.12/turtledemo/turtle.cfg +0 -10
  1401. package/lib/python3.12/turtledemo/two_canvases.py +0 -54
  1402. package/lib/python3.12/turtledemo/yinyang.py +0 -49
  1403. package/lib/python3.12/types.py +0 -333
  1404. package/lib/python3.12/typing.py +0 -3494
  1405. package/lib/python3.12/unittest/__init__.py +0 -85
  1406. package/lib/python3.12/unittest/__main__.py +0 -18
  1407. package/lib/python3.12/unittest/_log.py +0 -86
  1408. package/lib/python3.12/unittest/async_case.py +0 -143
  1409. package/lib/python3.12/unittest/case.py +0 -1456
  1410. package/lib/python3.12/unittest/loader.py +0 -497
  1411. package/lib/python3.12/unittest/main.py +0 -291
  1412. package/lib/python3.12/unittest/mock.py +0 -3054
  1413. package/lib/python3.12/unittest/result.py +0 -256
  1414. package/lib/python3.12/unittest/runner.py +0 -292
  1415. package/lib/python3.12/unittest/signals.py +0 -71
  1416. package/lib/python3.12/unittest/suite.py +0 -379
  1417. package/lib/python3.12/unittest/util.py +0 -170
  1418. package/lib/python3.12/urllib/__init__.py +0 -0
  1419. package/lib/python3.12/urllib/error.py +0 -74
  1420. package/lib/python3.12/urllib/parse.py +0 -1262
  1421. package/lib/python3.12/urllib/request.py +0 -2811
  1422. package/lib/python3.12/urllib/response.py +0 -84
  1423. package/lib/python3.12/urllib/robotparser.py +0 -275
  1424. package/lib/python3.12/uu.py +0 -216
  1425. package/lib/python3.12/uuid.py +0 -793
  1426. package/lib/python3.12/venv/__init__.py +0 -608
  1427. package/lib/python3.12/venv/__main__.py +0 -10
  1428. package/lib/python3.12/venv/scripts/common/Activate.ps1 +0 -247
  1429. package/lib/python3.12/venv/scripts/common/activate +0 -76
  1430. package/lib/python3.12/venv/scripts/posix/activate.csh +0 -27
  1431. package/lib/python3.12/venv/scripts/posix/activate.fish +0 -69
  1432. package/lib/python3.12/warnings.py +0 -598
  1433. package/lib/python3.12/wave.py +0 -653
  1434. package/lib/python3.12/weakref.py +0 -674
  1435. package/lib/python3.12/webbrowser.py +0 -689
  1436. package/lib/python3.12/wsgiref/__init__.py +0 -25
  1437. package/lib/python3.12/wsgiref/handlers.py +0 -573
  1438. package/lib/python3.12/wsgiref/headers.py +0 -184
  1439. package/lib/python3.12/wsgiref/simple_server.py +0 -165
  1440. package/lib/python3.12/wsgiref/types.py +0 -54
  1441. package/lib/python3.12/wsgiref/util.py +0 -159
  1442. package/lib/python3.12/wsgiref/validate.py +0 -438
  1443. package/lib/python3.12/xdrlib.py +0 -242
  1444. package/lib/python3.12/xml/__init__.py +0 -20
  1445. package/lib/python3.12/xml/dom/NodeFilter.py +0 -27
  1446. package/lib/python3.12/xml/dom/__init__.py +0 -140
  1447. package/lib/python3.12/xml/dom/domreg.py +0 -99
  1448. package/lib/python3.12/xml/dom/expatbuilder.py +0 -962
  1449. package/lib/python3.12/xml/dom/minicompat.py +0 -109
  1450. package/lib/python3.12/xml/dom/minidom.py +0 -2013
  1451. package/lib/python3.12/xml/dom/pulldom.py +0 -336
  1452. package/lib/python3.12/xml/dom/xmlbuilder.py +0 -389
  1453. package/lib/python3.12/xml/etree/ElementInclude.py +0 -186
  1454. package/lib/python3.12/xml/etree/ElementPath.py +0 -423
  1455. package/lib/python3.12/xml/etree/ElementTree.py +0 -2085
  1456. package/lib/python3.12/xml/etree/__init__.py +0 -33
  1457. package/lib/python3.12/xml/etree/cElementTree.py +0 -3
  1458. package/lib/python3.12/xml/parsers/__init__.py +0 -8
  1459. package/lib/python3.12/xml/parsers/expat.py +0 -8
  1460. package/lib/python3.12/xml/sax/__init__.py +0 -94
  1461. package/lib/python3.12/xml/sax/_exceptions.py +0 -127
  1462. package/lib/python3.12/xml/sax/expatreader.py +0 -454
  1463. package/lib/python3.12/xml/sax/handler.py +0 -387
  1464. package/lib/python3.12/xml/sax/saxutils.py +0 -369
  1465. package/lib/python3.12/xml/sax/xmlreader.py +0 -378
  1466. package/lib/python3.12/xmlrpc/__init__.py +0 -1
  1467. package/lib/python3.12/xmlrpc/client.py +0 -1529
  1468. package/lib/python3.12/xmlrpc/server.py +0 -1002
  1469. package/lib/python3.12/zipapp.py +0 -206
  1470. package/lib/python3.12/zipfile/__init__.py +0 -2327
  1471. package/lib/python3.12/zipfile/__main__.py +0 -4
  1472. package/lib/python3.12/zipfile/_path/__init__.py +0 -412
  1473. package/lib/python3.12/zipfile/_path/glob.py +0 -53
  1474. package/lib/python3.12/zipimport.py +0 -712
  1475. package/lib/python3.12/zoneinfo/__init__.py +0 -31
  1476. package/lib/python3.12/zoneinfo/_common.py +0 -164
  1477. package/lib/python3.12/zoneinfo/_tzpath.py +0 -181
  1478. package/lib/python3.12/zoneinfo/_zoneinfo.py +0 -772
  1479. package/lib/tcl8/8.4/platform/shell-1.1.4.tm +0 -241
  1480. package/lib/tcl8/8.4/platform-1.0.19.tm +0 -450
  1481. package/lib/tcl8/8.5/msgcat-1.6.1.tm +0 -1210
  1482. package/lib/tcl8/8.5/tcltest-2.5.7.tm +0 -3584
  1483. package/lib/tcl8/8.6/http-2.9.8.tm +0 -3604
  1484. package/lib/tcl8.6/auto.tcl +0 -648
  1485. package/lib/tcl8.6/clock.tcl +0 -4551
  1486. package/lib/tcl8.6/encoding/ascii.enc +0 -20
  1487. package/lib/tcl8.6/encoding/big5.enc +0 -1516
  1488. package/lib/tcl8.6/encoding/cns11643.enc +0 -1584
  1489. package/lib/tcl8.6/encoding/cp1250.enc +0 -20
  1490. package/lib/tcl8.6/encoding/cp1251.enc +0 -20
  1491. package/lib/tcl8.6/encoding/cp1252.enc +0 -20
  1492. package/lib/tcl8.6/encoding/cp1253.enc +0 -20
  1493. package/lib/tcl8.6/encoding/cp1254.enc +0 -20
  1494. package/lib/tcl8.6/encoding/cp1255.enc +0 -20
  1495. package/lib/tcl8.6/encoding/cp1256.enc +0 -20
  1496. package/lib/tcl8.6/encoding/cp1257.enc +0 -20
  1497. package/lib/tcl8.6/encoding/cp1258.enc +0 -20
  1498. package/lib/tcl8.6/encoding/cp437.enc +0 -20
  1499. package/lib/tcl8.6/encoding/cp737.enc +0 -20
  1500. package/lib/tcl8.6/encoding/cp775.enc +0 -20
  1501. package/lib/tcl8.6/encoding/cp850.enc +0 -20
  1502. package/lib/tcl8.6/encoding/cp852.enc +0 -20
  1503. package/lib/tcl8.6/encoding/cp855.enc +0 -20
  1504. package/lib/tcl8.6/encoding/cp857.enc +0 -20
  1505. package/lib/tcl8.6/encoding/cp860.enc +0 -20
  1506. package/lib/tcl8.6/encoding/cp861.enc +0 -20
  1507. package/lib/tcl8.6/encoding/cp862.enc +0 -20
  1508. package/lib/tcl8.6/encoding/cp863.enc +0 -20
  1509. package/lib/tcl8.6/encoding/cp864.enc +0 -20
  1510. package/lib/tcl8.6/encoding/cp865.enc +0 -20
  1511. package/lib/tcl8.6/encoding/cp866.enc +0 -20
  1512. package/lib/tcl8.6/encoding/cp869.enc +0 -20
  1513. package/lib/tcl8.6/encoding/cp874.enc +0 -20
  1514. package/lib/tcl8.6/encoding/cp932.enc +0 -801
  1515. package/lib/tcl8.6/encoding/cp936.enc +0 -2162
  1516. package/lib/tcl8.6/encoding/cp949.enc +0 -2128
  1517. package/lib/tcl8.6/encoding/cp950.enc +0 -1499
  1518. package/lib/tcl8.6/encoding/dingbats.enc +0 -20
  1519. package/lib/tcl8.6/encoding/ebcdic.enc +0 -19
  1520. package/lib/tcl8.6/encoding/euc-cn.enc +0 -1397
  1521. package/lib/tcl8.6/encoding/euc-jp.enc +0 -1353
  1522. package/lib/tcl8.6/encoding/euc-kr.enc +0 -1533
  1523. package/lib/tcl8.6/encoding/gb12345.enc +0 -1414
  1524. package/lib/tcl8.6/encoding/gb1988.enc +0 -20
  1525. package/lib/tcl8.6/encoding/gb2312-raw.enc +0 -1380
  1526. package/lib/tcl8.6/encoding/gb2312.enc +0 -1397
  1527. package/lib/tcl8.6/encoding/iso2022-jp.enc +0 -12
  1528. package/lib/tcl8.6/encoding/iso2022-kr.enc +0 -7
  1529. package/lib/tcl8.6/encoding/iso2022.enc +0 -14
  1530. package/lib/tcl8.6/encoding/iso8859-1.enc +0 -20
  1531. package/lib/tcl8.6/encoding/iso8859-10.enc +0 -20
  1532. package/lib/tcl8.6/encoding/iso8859-11.enc +0 -20
  1533. package/lib/tcl8.6/encoding/iso8859-13.enc +0 -20
  1534. package/lib/tcl8.6/encoding/iso8859-14.enc +0 -20
  1535. package/lib/tcl8.6/encoding/iso8859-15.enc +0 -20
  1536. package/lib/tcl8.6/encoding/iso8859-16.enc +0 -20
  1537. package/lib/tcl8.6/encoding/iso8859-2.enc +0 -20
  1538. package/lib/tcl8.6/encoding/iso8859-3.enc +0 -20
  1539. package/lib/tcl8.6/encoding/iso8859-4.enc +0 -20
  1540. package/lib/tcl8.6/encoding/iso8859-5.enc +0 -20
  1541. package/lib/tcl8.6/encoding/iso8859-6.enc +0 -20
  1542. package/lib/tcl8.6/encoding/iso8859-7.enc +0 -20
  1543. package/lib/tcl8.6/encoding/iso8859-8.enc +0 -20
  1544. package/lib/tcl8.6/encoding/iso8859-9.enc +0 -20
  1545. package/lib/tcl8.6/encoding/jis0201.enc +0 -20
  1546. package/lib/tcl8.6/encoding/jis0208.enc +0 -1319
  1547. package/lib/tcl8.6/encoding/jis0212.enc +0 -1159
  1548. package/lib/tcl8.6/encoding/koi8-r.enc +0 -20
  1549. package/lib/tcl8.6/encoding/koi8-u.enc +0 -20
  1550. package/lib/tcl8.6/encoding/ksc5601.enc +0 -1516
  1551. package/lib/tcl8.6/encoding/macCentEuro.enc +0 -20
  1552. package/lib/tcl8.6/encoding/macCroatian.enc +0 -20
  1553. package/lib/tcl8.6/encoding/macCyrillic.enc +0 -20
  1554. package/lib/tcl8.6/encoding/macDingbats.enc +0 -20
  1555. package/lib/tcl8.6/encoding/macGreek.enc +0 -20
  1556. package/lib/tcl8.6/encoding/macIceland.enc +0 -20
  1557. package/lib/tcl8.6/encoding/macJapan.enc +0 -785
  1558. package/lib/tcl8.6/encoding/macRoman.enc +0 -20
  1559. package/lib/tcl8.6/encoding/macRomania.enc +0 -20
  1560. package/lib/tcl8.6/encoding/macThai.enc +0 -20
  1561. package/lib/tcl8.6/encoding/macTurkish.enc +0 -20
  1562. package/lib/tcl8.6/encoding/macUkraine.enc +0 -20
  1563. package/lib/tcl8.6/encoding/shiftjis.enc +0 -690
  1564. package/lib/tcl8.6/encoding/symbol.enc +0 -20
  1565. package/lib/tcl8.6/encoding/tis-620.enc +0 -20
  1566. package/lib/tcl8.6/history.tcl +0 -335
  1567. package/lib/tcl8.6/http1.0/http.tcl +0 -377
  1568. package/lib/tcl8.6/http1.0/pkgIndex.tcl +0 -11
  1569. package/lib/tcl8.6/init.tcl +0 -827
  1570. package/lib/tcl8.6/msgs/af.msg +0 -49
  1571. package/lib/tcl8.6/msgs/af_za.msg +0 -6
  1572. package/lib/tcl8.6/msgs/ar.msg +0 -54
  1573. package/lib/tcl8.6/msgs/ar_in.msg +0 -6
  1574. package/lib/tcl8.6/msgs/ar_jo.msg +0 -39
  1575. package/lib/tcl8.6/msgs/ar_lb.msg +0 -39
  1576. package/lib/tcl8.6/msgs/ar_sy.msg +0 -39
  1577. package/lib/tcl8.6/msgs/be.msg +0 -52
  1578. package/lib/tcl8.6/msgs/bg.msg +0 -52
  1579. package/lib/tcl8.6/msgs/bn.msg +0 -49
  1580. package/lib/tcl8.6/msgs/bn_in.msg +0 -6
  1581. package/lib/tcl8.6/msgs/ca.msg +0 -50
  1582. package/lib/tcl8.6/msgs/cs.msg +0 -54
  1583. package/lib/tcl8.6/msgs/da.msg +0 -52
  1584. package/lib/tcl8.6/msgs/de.msg +0 -54
  1585. package/lib/tcl8.6/msgs/de_at.msg +0 -35
  1586. package/lib/tcl8.6/msgs/de_be.msg +0 -53
  1587. package/lib/tcl8.6/msgs/el.msg +0 -52
  1588. package/lib/tcl8.6/msgs/en_au.msg +0 -7
  1589. package/lib/tcl8.6/msgs/en_be.msg +0 -7
  1590. package/lib/tcl8.6/msgs/en_bw.msg +0 -6
  1591. package/lib/tcl8.6/msgs/en_ca.msg +0 -7
  1592. package/lib/tcl8.6/msgs/en_gb.msg +0 -7
  1593. package/lib/tcl8.6/msgs/en_hk.msg +0 -8
  1594. package/lib/tcl8.6/msgs/en_ie.msg +0 -7
  1595. package/lib/tcl8.6/msgs/en_in.msg +0 -8
  1596. package/lib/tcl8.6/msgs/en_nz.msg +0 -7
  1597. package/lib/tcl8.6/msgs/en_ph.msg +0 -8
  1598. package/lib/tcl8.6/msgs/en_sg.msg +0 -6
  1599. package/lib/tcl8.6/msgs/en_za.msg +0 -6
  1600. package/lib/tcl8.6/msgs/en_zw.msg +0 -6
  1601. package/lib/tcl8.6/msgs/eo.msg +0 -54
  1602. package/lib/tcl8.6/msgs/es.msg +0 -52
  1603. package/lib/tcl8.6/msgs/es_ar.msg +0 -6
  1604. package/lib/tcl8.6/msgs/es_bo.msg +0 -6
  1605. package/lib/tcl8.6/msgs/es_cl.msg +0 -6
  1606. package/lib/tcl8.6/msgs/es_co.msg +0 -6
  1607. package/lib/tcl8.6/msgs/es_cr.msg +0 -6
  1608. package/lib/tcl8.6/msgs/es_do.msg +0 -6
  1609. package/lib/tcl8.6/msgs/es_ec.msg +0 -6
  1610. package/lib/tcl8.6/msgs/es_gt.msg +0 -6
  1611. package/lib/tcl8.6/msgs/es_hn.msg +0 -6
  1612. package/lib/tcl8.6/msgs/es_mx.msg +0 -6
  1613. package/lib/tcl8.6/msgs/es_ni.msg +0 -6
  1614. package/lib/tcl8.6/msgs/es_pa.msg +0 -6
  1615. package/lib/tcl8.6/msgs/es_pe.msg +0 -6
  1616. package/lib/tcl8.6/msgs/es_pr.msg +0 -6
  1617. package/lib/tcl8.6/msgs/es_py.msg +0 -6
  1618. package/lib/tcl8.6/msgs/es_sv.msg +0 -6
  1619. package/lib/tcl8.6/msgs/es_uy.msg +0 -6
  1620. package/lib/tcl8.6/msgs/es_ve.msg +0 -6
  1621. package/lib/tcl8.6/msgs/et.msg +0 -52
  1622. package/lib/tcl8.6/msgs/eu.msg +0 -47
  1623. package/lib/tcl8.6/msgs/eu_es.msg +0 -7
  1624. package/lib/tcl8.6/msgs/fa.msg +0 -47
  1625. package/lib/tcl8.6/msgs/fa_in.msg +0 -52
  1626. package/lib/tcl8.6/msgs/fa_ir.msg +0 -9
  1627. package/lib/tcl8.6/msgs/fi.msg +0 -50
  1628. package/lib/tcl8.6/msgs/fo.msg +0 -47
  1629. package/lib/tcl8.6/msgs/fo_fo.msg +0 -7
  1630. package/lib/tcl8.6/msgs/fr.msg +0 -52
  1631. package/lib/tcl8.6/msgs/fr_be.msg +0 -7
  1632. package/lib/tcl8.6/msgs/fr_ca.msg +0 -7
  1633. package/lib/tcl8.6/msgs/fr_ch.msg +0 -7
  1634. package/lib/tcl8.6/msgs/ga.msg +0 -47
  1635. package/lib/tcl8.6/msgs/ga_ie.msg +0 -7
  1636. package/lib/tcl8.6/msgs/gl.msg +0 -47
  1637. package/lib/tcl8.6/msgs/gl_es.msg +0 -6
  1638. package/lib/tcl8.6/msgs/gv.msg +0 -47
  1639. package/lib/tcl8.6/msgs/gv_gb.msg +0 -6
  1640. package/lib/tcl8.6/msgs/he.msg +0 -52
  1641. package/lib/tcl8.6/msgs/hi.msg +0 -39
  1642. package/lib/tcl8.6/msgs/hi_in.msg +0 -6
  1643. package/lib/tcl8.6/msgs/hr.msg +0 -50
  1644. package/lib/tcl8.6/msgs/hu.msg +0 -54
  1645. package/lib/tcl8.6/msgs/id.msg +0 -47
  1646. package/lib/tcl8.6/msgs/id_id.msg +0 -6
  1647. package/lib/tcl8.6/msgs/is.msg +0 -50
  1648. package/lib/tcl8.6/msgs/it.msg +0 -54
  1649. package/lib/tcl8.6/msgs/it_ch.msg +0 -6
  1650. package/lib/tcl8.6/msgs/ja.msg +0 -44
  1651. package/lib/tcl8.6/msgs/kl.msg +0 -47
  1652. package/lib/tcl8.6/msgs/kl_gl.msg +0 -7
  1653. package/lib/tcl8.6/msgs/ko.msg +0 -55
  1654. package/lib/tcl8.6/msgs/ko_kr.msg +0 -8
  1655. package/lib/tcl8.6/msgs/kok.msg +0 -39
  1656. package/lib/tcl8.6/msgs/kok_in.msg +0 -6
  1657. package/lib/tcl8.6/msgs/kw.msg +0 -47
  1658. package/lib/tcl8.6/msgs/kw_gb.msg +0 -6
  1659. package/lib/tcl8.6/msgs/lt.msg +0 -52
  1660. package/lib/tcl8.6/msgs/lv.msg +0 -52
  1661. package/lib/tcl8.6/msgs/mk.msg +0 -52
  1662. package/lib/tcl8.6/msgs/mr.msg +0 -39
  1663. package/lib/tcl8.6/msgs/mr_in.msg +0 -6
  1664. package/lib/tcl8.6/msgs/ms.msg +0 -47
  1665. package/lib/tcl8.6/msgs/ms_my.msg +0 -6
  1666. package/lib/tcl8.6/msgs/mt.msg +0 -27
  1667. package/lib/tcl8.6/msgs/nb.msg +0 -52
  1668. package/lib/tcl8.6/msgs/nl.msg +0 -50
  1669. package/lib/tcl8.6/msgs/nl_be.msg +0 -7
  1670. package/lib/tcl8.6/msgs/nn.msg +0 -52
  1671. package/lib/tcl8.6/msgs/pl.msg +0 -52
  1672. package/lib/tcl8.6/msgs/pt.msg +0 -50
  1673. package/lib/tcl8.6/msgs/pt_br.msg +0 -7
  1674. package/lib/tcl8.6/msgs/ro.msg +0 -52
  1675. package/lib/tcl8.6/msgs/ru.msg +0 -52
  1676. package/lib/tcl8.6/msgs/ru_ua.msg +0 -6
  1677. package/lib/tcl8.6/msgs/sh.msg +0 -52
  1678. package/lib/tcl8.6/msgs/sk.msg +0 -52
  1679. package/lib/tcl8.6/msgs/sl.msg +0 -52
  1680. package/lib/tcl8.6/msgs/sq.msg +0 -54
  1681. package/lib/tcl8.6/msgs/sr.msg +0 -52
  1682. package/lib/tcl8.6/msgs/sv.msg +0 -52
  1683. package/lib/tcl8.6/msgs/sw.msg +0 -49
  1684. package/lib/tcl8.6/msgs/ta.msg +0 -39
  1685. package/lib/tcl8.6/msgs/ta_in.msg +0 -6
  1686. package/lib/tcl8.6/msgs/te.msg +0 -47
  1687. package/lib/tcl8.6/msgs/te_in.msg +0 -8
  1688. package/lib/tcl8.6/msgs/th.msg +0 -54
  1689. package/lib/tcl8.6/msgs/tr.msg +0 -50
  1690. package/lib/tcl8.6/msgs/uk.msg +0 -52
  1691. package/lib/tcl8.6/msgs/vi.msg +0 -50
  1692. package/lib/tcl8.6/msgs/zh.msg +0 -55
  1693. package/lib/tcl8.6/msgs/zh_cn.msg +0 -7
  1694. package/lib/tcl8.6/msgs/zh_hk.msg +0 -28
  1695. package/lib/tcl8.6/msgs/zh_sg.msg +0 -8
  1696. package/lib/tcl8.6/msgs/zh_tw.msg +0 -8
  1697. package/lib/tcl8.6/opt0.4/optparse.tcl +0 -1072
  1698. package/lib/tcl8.6/opt0.4/pkgIndex.tcl +0 -12
  1699. package/lib/tcl8.6/package.tcl +0 -751
  1700. package/lib/tcl8.6/parray.tcl +0 -28
  1701. package/lib/tcl8.6/safe.tcl +0 -1289
  1702. package/lib/tcl8.6/tclAppInit.c +0 -176
  1703. package/lib/tcl8.6/tclIndex +0 -79
  1704. package/lib/tcl8.6/tm.tcl +0 -380
  1705. package/lib/tcl8.6/word.tcl +0 -154
  1706. package/lib/thread2.8.9/libthread2.8.9.a +0 -0
  1707. package/lib/thread2.8.9/ttrace.tcl +0 -942
  1708. package/lib/tk8.6/bgerror.tcl +0 -272
  1709. package/lib/tk8.6/button.tcl +0 -782
  1710. package/lib/tk8.6/choosedir.tcl +0 -310
  1711. package/lib/tk8.6/clrpick.tcl +0 -694
  1712. package/lib/tk8.6/comdlg.tcl +0 -322
  1713. package/lib/tk8.6/console.tcl +0 -1154
  1714. package/lib/tk8.6/demos/README +0 -44
  1715. package/lib/tk8.6/demos/anilabel.tcl +0 -160
  1716. package/lib/tk8.6/demos/aniwave.tcl +0 -104
  1717. package/lib/tk8.6/demos/arrow.tcl +0 -241
  1718. package/lib/tk8.6/demos/bind.tcl +0 -78
  1719. package/lib/tk8.6/demos/bitmap.tcl +0 -52
  1720. package/lib/tk8.6/demos/browse +0 -66
  1721. package/lib/tk8.6/demos/button.tcl +0 -47
  1722. package/lib/tk8.6/demos/check.tcl +0 -71
  1723. package/lib/tk8.6/demos/clrpick.tcl +0 -54
  1724. package/lib/tk8.6/demos/colors.tcl +0 -99
  1725. package/lib/tk8.6/demos/combo.tcl +0 -61
  1726. package/lib/tk8.6/demos/cscroll.tcl +0 -172
  1727. package/lib/tk8.6/demos/ctext.tcl +0 -176
  1728. package/lib/tk8.6/demos/dialog1.tcl +0 -25
  1729. package/lib/tk8.6/demos/dialog2.tcl +0 -18
  1730. package/lib/tk8.6/demos/en.msg +0 -97
  1731. package/lib/tk8.6/demos/entry1.tcl +0 -34
  1732. package/lib/tk8.6/demos/entry2.tcl +0 -46
  1733. package/lib/tk8.6/demos/entry3.tcl +0 -185
  1734. package/lib/tk8.6/demos/filebox.tcl +0 -81
  1735. package/lib/tk8.6/demos/floor.tcl +0 -1372
  1736. package/lib/tk8.6/demos/fontchoose.tcl +0 -67
  1737. package/lib/tk8.6/demos/form.tcl +0 -38
  1738. package/lib/tk8.6/demos/goldberg.tcl +0 -1834
  1739. package/lib/tk8.6/demos/hello +0 -22
  1740. package/lib/tk8.6/demos/hscale.tcl +0 -45
  1741. package/lib/tk8.6/demos/icon.tcl +0 -51
  1742. package/lib/tk8.6/demos/image1.tcl +0 -35
  1743. package/lib/tk8.6/demos/image2.tcl +0 -108
  1744. package/lib/tk8.6/demos/images/earth.gif +0 -0
  1745. package/lib/tk8.6/demos/images/earthmenu.png +0 -0
  1746. package/lib/tk8.6/demos/images/earthris.gif +0 -0
  1747. package/lib/tk8.6/demos/images/flagdown.xbm +0 -27
  1748. package/lib/tk8.6/demos/images/flagup.xbm +0 -27
  1749. package/lib/tk8.6/demos/images/gray25.xbm +0 -6
  1750. package/lib/tk8.6/demos/images/letters.xbm +0 -27
  1751. package/lib/tk8.6/demos/images/noletter.xbm +0 -27
  1752. package/lib/tk8.6/demos/images/ouster.png +0 -0
  1753. package/lib/tk8.6/demos/images/pattern.xbm +0 -6
  1754. package/lib/tk8.6/demos/images/tcllogo.gif +0 -0
  1755. package/lib/tk8.6/demos/images/teapot.ppm +0 -56
  1756. package/lib/tk8.6/demos/items.tcl +0 -302
  1757. package/lib/tk8.6/demos/ixset +0 -328
  1758. package/lib/tk8.6/demos/knightstour.tcl +0 -268
  1759. package/lib/tk8.6/demos/label.tcl +0 -40
  1760. package/lib/tk8.6/demos/labelframe.tcl +0 -76
  1761. package/lib/tk8.6/demos/license.terms +0 -40
  1762. package/lib/tk8.6/demos/mclist.tcl +0 -119
  1763. package/lib/tk8.6/demos/menu.tcl +0 -177
  1764. package/lib/tk8.6/demos/menubu.tcl +0 -87
  1765. package/lib/tk8.6/demos/msgbox.tcl +0 -62
  1766. package/lib/tk8.6/demos/nl.msg +0 -125
  1767. package/lib/tk8.6/demos/paned1.tcl +0 -32
  1768. package/lib/tk8.6/demos/paned2.tcl +0 -74
  1769. package/lib/tk8.6/demos/pendulum.tcl +0 -197
  1770. package/lib/tk8.6/demos/plot.tcl +0 -97
  1771. package/lib/tk8.6/demos/puzzle.tcl +0 -82
  1772. package/lib/tk8.6/demos/radio.tcl +0 -66
  1773. package/lib/tk8.6/demos/rmt +0 -210
  1774. package/lib/tk8.6/demos/rolodex +0 -204
  1775. package/lib/tk8.6/demos/ruler.tcl +0 -175
  1776. package/lib/tk8.6/demos/sayings.tcl +0 -44
  1777. package/lib/tk8.6/demos/search.tcl +0 -139
  1778. package/lib/tk8.6/demos/spin.tcl +0 -53
  1779. package/lib/tk8.6/demos/states.tcl +0 -54
  1780. package/lib/tk8.6/demos/style.tcl +0 -155
  1781. package/lib/tk8.6/demos/tclIndex +0 -67
  1782. package/lib/tk8.6/demos/tcolor +0 -358
  1783. package/lib/tk8.6/demos/text.tcl +0 -113
  1784. package/lib/tk8.6/demos/textpeer.tcl +0 -62
  1785. package/lib/tk8.6/demos/timer +0 -47
  1786. package/lib/tk8.6/demos/toolbar.tcl +0 -92
  1787. package/lib/tk8.6/demos/tree.tcl +0 -89
  1788. package/lib/tk8.6/demos/ttkbut.tcl +0 -84
  1789. package/lib/tk8.6/demos/ttkmenu.tcl +0 -53
  1790. package/lib/tk8.6/demos/ttknote.tcl +0 -57
  1791. package/lib/tk8.6/demos/ttkpane.tcl +0 -112
  1792. package/lib/tk8.6/demos/ttkprogress.tcl +0 -46
  1793. package/lib/tk8.6/demos/ttkscale.tcl +0 -39
  1794. package/lib/tk8.6/demos/twind.tcl +0 -351
  1795. package/lib/tk8.6/demos/unicodeout.tcl +0 -145
  1796. package/lib/tk8.6/demos/vscale.tcl +0 -46
  1797. package/lib/tk8.6/demos/widget +0 -734
  1798. package/lib/tk8.6/dialog.tcl +0 -175
  1799. package/lib/tk8.6/entry.tcl +0 -699
  1800. package/lib/tk8.6/focus.tcl +0 -178
  1801. package/lib/tk8.6/fontchooser.tcl +0 -515
  1802. package/lib/tk8.6/iconlist.tcl +0 -715
  1803. package/lib/tk8.6/icons.tcl +0 -153
  1804. package/lib/tk8.6/images/README +0 -7
  1805. package/lib/tk8.6/images/logo.eps +0 -2091
  1806. package/lib/tk8.6/images/logo100.gif +0 -0
  1807. package/lib/tk8.6/images/logo64.gif +0 -0
  1808. package/lib/tk8.6/images/logoLarge.gif +0 -0
  1809. package/lib/tk8.6/images/logoMed.gif +0 -0
  1810. package/lib/tk8.6/images/pwrdLogo.eps +0 -1897
  1811. package/lib/tk8.6/images/pwrdLogo100.gif +0 -0
  1812. package/lib/tk8.6/images/pwrdLogo150.gif +0 -0
  1813. package/lib/tk8.6/images/pwrdLogo175.gif +0 -0
  1814. package/lib/tk8.6/images/pwrdLogo200.gif +0 -0
  1815. package/lib/tk8.6/images/pwrdLogo75.gif +0 -0
  1816. package/lib/tk8.6/images/tai-ku.gif +0 -0
  1817. package/lib/tk8.6/listbox.tcl +0 -560
  1818. package/lib/tk8.6/megawidget.tcl +0 -297
  1819. package/lib/tk8.6/menu.tcl +0 -1387
  1820. package/lib/tk8.6/mkpsenc.tcl +0 -1488
  1821. package/lib/tk8.6/msgbox.tcl +0 -427
  1822. package/lib/tk8.6/msgs/cs.msg +0 -77
  1823. package/lib/tk8.6/msgs/da.msg +0 -78
  1824. package/lib/tk8.6/msgs/de.msg +0 -91
  1825. package/lib/tk8.6/msgs/el.msg +0 -86
  1826. package/lib/tk8.6/msgs/en.msg +0 -91
  1827. package/lib/tk8.6/msgs/en_gb.msg +0 -3
  1828. package/lib/tk8.6/msgs/eo.msg +0 -75
  1829. package/lib/tk8.6/msgs/es.msg +0 -76
  1830. package/lib/tk8.6/msgs/fi.msg +0 -89
  1831. package/lib/tk8.6/msgs/fr.msg +0 -72
  1832. package/lib/tk8.6/msgs/hu.msg +0 -78
  1833. package/lib/tk8.6/msgs/it.msg +0 -73
  1834. package/lib/tk8.6/msgs/nl.msg +0 -91
  1835. package/lib/tk8.6/msgs/pl.msg +0 -91
  1836. package/lib/tk8.6/msgs/pt.msg +0 -74
  1837. package/lib/tk8.6/msgs/ru.msg +0 -93
  1838. package/lib/tk8.6/msgs/sv.msg +0 -76
  1839. package/lib/tk8.6/msgs/zh_cn.msg +0 -92
  1840. package/lib/tk8.6/obsolete.tcl +0 -178
  1841. package/lib/tk8.6/optMenu.tcl +0 -43
  1842. package/lib/tk8.6/palette.tcl +0 -244
  1843. package/lib/tk8.6/panedwindow.tcl +0 -194
  1844. package/lib/tk8.6/safetk.tcl +0 -262
  1845. package/lib/tk8.6/scale.tcl +0 -307
  1846. package/lib/tk8.6/scrlbar.tcl +0 -456
  1847. package/lib/tk8.6/spinbox.tcl +0 -594
  1848. package/lib/tk8.6/tclIndex +0 -253
  1849. package/lib/tk8.6/tearoff.tcl +0 -157
  1850. package/lib/tk8.6/text.tcl +0 -1242
  1851. package/lib/tk8.6/tk.tcl +0 -708
  1852. package/lib/tk8.6/tkAppInit.c +0 -177
  1853. package/lib/tk8.6/tkfbox.tcl +0 -1241
  1854. package/lib/tk8.6/ttk/altTheme.tcl +0 -109
  1855. package/lib/tk8.6/ttk/aquaTheme.tcl +0 -119
  1856. package/lib/tk8.6/ttk/button.tcl +0 -83
  1857. package/lib/tk8.6/ttk/clamTheme.tcl +0 -147
  1858. package/lib/tk8.6/ttk/classicTheme.tcl +0 -115
  1859. package/lib/tk8.6/ttk/combobox.tcl +0 -448
  1860. package/lib/tk8.6/ttk/cursors.tcl +0 -205
  1861. package/lib/tk8.6/ttk/defaults.tcl +0 -143
  1862. package/lib/tk8.6/ttk/entry.tcl +0 -641
  1863. package/lib/tk8.6/ttk/fonts.tcl +0 -154
  1864. package/lib/tk8.6/ttk/menubutton.tcl +0 -233
  1865. package/lib/tk8.6/ttk/notebook.tcl +0 -201
  1866. package/lib/tk8.6/ttk/panedwindow.tcl +0 -91
  1867. package/lib/tk8.6/ttk/progress.tcl +0 -49
  1868. package/lib/tk8.6/ttk/scale.tcl +0 -94
  1869. package/lib/tk8.6/ttk/scrollbar.tcl +0 -126
  1870. package/lib/tk8.6/ttk/sizegrip.tcl +0 -102
  1871. package/lib/tk8.6/ttk/spinbox.tcl +0 -192
  1872. package/lib/tk8.6/ttk/treeview.tcl +0 -383
  1873. package/lib/tk8.6/ttk/ttk.tcl +0 -176
  1874. package/lib/tk8.6/ttk/utils.tcl +0 -337
  1875. package/lib/tk8.6/ttk/vistaTheme.tcl +0 -229
  1876. package/lib/tk8.6/ttk/winTheme.tcl +0 -84
  1877. package/lib/tk8.6/ttk/xpTheme.tcl +0 -67
  1878. package/lib/tk8.6/unsupported.tcl +0 -269
  1879. package/lib/tk8.6/xmfbox.tcl +0 -989
  1880. package/share/man/man1/python3.1 +0 -630
  1881. package/share/man/man1/python3.12.1 +0 -630
  1882. package/ssl/cacert.pem +0 -3959
@@ -1,4682 +0,0 @@
1
- """Wrapper functions for Tcl/Tk.
2
-
3
- Tkinter provides classes which allow the display, positioning and
4
- control of widgets. Toplevel widgets are Tk and Toplevel. Other
5
- widgets are Frame, Label, Entry, Text, Canvas, Button, Radiobutton,
6
- Checkbutton, Scale, Listbox, Scrollbar, OptionMenu, Spinbox
7
- LabelFrame and PanedWindow.
8
-
9
- Properties of the widgets are specified with keyword arguments.
10
- Keyword arguments have the same name as the corresponding resource
11
- under Tk.
12
-
13
- Widgets are positioned with one of the geometry managers Place, Pack
14
- or Grid. These managers can be called with methods place, pack, grid
15
- available in every Widget.
16
-
17
- Actions are bound to events by resources (e.g. keyword argument
18
- command) or with the method bind.
19
-
20
- Example (Hello, World):
21
- import tkinter
22
- from tkinter.constants import *
23
- tk = tkinter.Tk()
24
- frame = tkinter.Frame(tk, relief=RIDGE, borderwidth=2)
25
- frame.pack(fill=BOTH,expand=1)
26
- label = tkinter.Label(frame, text="Hello, World")
27
- label.pack(fill=X, expand=1)
28
- button = tkinter.Button(frame,text="Exit",command=tk.destroy)
29
- button.pack(side=BOTTOM)
30
- tk.mainloop()
31
- """
32
-
33
- import collections
34
- import enum
35
- import sys
36
- import types
37
-
38
- import _tkinter # If this fails your Python may not be configured for Tk
39
- TclError = _tkinter.TclError
40
- from tkinter.constants import *
41
- import re
42
-
43
- wantobjects = 1
44
- _debug = False # set to True to print executed Tcl/Tk commands
45
-
46
- TkVersion = float(_tkinter.TK_VERSION)
47
- TclVersion = float(_tkinter.TCL_VERSION)
48
-
49
- READABLE = _tkinter.READABLE
50
- WRITABLE = _tkinter.WRITABLE
51
- EXCEPTION = _tkinter.EXCEPTION
52
-
53
-
54
- _magic_re = re.compile(r'([\\{}])')
55
- _space_re = re.compile(r'([\s])', re.ASCII)
56
-
57
-
58
- def _join(value):
59
- """Internal function."""
60
- return ' '.join(map(_stringify, value))
61
-
62
-
63
- def _stringify(value):
64
- """Internal function."""
65
- if isinstance(value, (list, tuple)):
66
- if len(value) == 1:
67
- value = _stringify(value[0])
68
- if _magic_re.search(value):
69
- value = '{%s}' % value
70
- else:
71
- value = '{%s}' % _join(value)
72
- else:
73
- if isinstance(value, bytes):
74
- value = str(value, 'latin1')
75
- else:
76
- value = str(value)
77
- if not value:
78
- value = '{}'
79
- elif _magic_re.search(value):
80
- # add '\' before special characters and spaces
81
- value = _magic_re.sub(r'\\\1', value)
82
- value = value.replace('\n', r'\n')
83
- value = _space_re.sub(r'\\\1', value)
84
- if value[0] == '"':
85
- value = '\\' + value
86
- elif value[0] == '"' or _space_re.search(value):
87
- value = '{%s}' % value
88
- return value
89
-
90
-
91
- def _flatten(seq):
92
- """Internal function."""
93
- res = ()
94
- for item in seq:
95
- if isinstance(item, (tuple, list)):
96
- res = res + _flatten(item)
97
- elif item is not None:
98
- res = res + (item,)
99
- return res
100
-
101
-
102
- try: _flatten = _tkinter._flatten
103
- except AttributeError: pass
104
-
105
-
106
- def _cnfmerge(cnfs):
107
- """Internal function."""
108
- if isinstance(cnfs, dict):
109
- return cnfs
110
- elif isinstance(cnfs, (type(None), str)):
111
- return cnfs
112
- else:
113
- cnf = {}
114
- for c in _flatten(cnfs):
115
- try:
116
- cnf.update(c)
117
- except (AttributeError, TypeError) as msg:
118
- print("_cnfmerge: fallback due to:", msg)
119
- for k, v in c.items():
120
- cnf[k] = v
121
- return cnf
122
-
123
-
124
- try: _cnfmerge = _tkinter._cnfmerge
125
- except AttributeError: pass
126
-
127
-
128
- def _splitdict(tk, v, cut_minus=True, conv=None):
129
- """Return a properly formatted dict built from Tcl list pairs.
130
-
131
- If cut_minus is True, the supposed '-' prefix will be removed from
132
- keys. If conv is specified, it is used to convert values.
133
-
134
- Tcl list is expected to contain an even number of elements.
135
- """
136
- t = tk.splitlist(v)
137
- if len(t) % 2:
138
- raise RuntimeError('Tcl list representing a dict is expected '
139
- 'to contain an even number of elements')
140
- it = iter(t)
141
- dict = {}
142
- for key, value in zip(it, it):
143
- key = str(key)
144
- if cut_minus and key[0] == '-':
145
- key = key[1:]
146
- if conv:
147
- value = conv(value)
148
- dict[key] = value
149
- return dict
150
-
151
- class _VersionInfoType(collections.namedtuple('_VersionInfoType',
152
- ('major', 'minor', 'micro', 'releaselevel', 'serial'))):
153
- def __str__(self):
154
- if self.releaselevel == 'final':
155
- return f'{self.major}.{self.minor}.{self.micro}'
156
- else:
157
- return f'{self.major}.{self.minor}{self.releaselevel[0]}{self.serial}'
158
-
159
- def _parse_version(version):
160
- import re
161
- m = re.fullmatch(r'(\d+)\.(\d+)([ab.])(\d+)', version)
162
- major, minor, releaselevel, serial = m.groups()
163
- major, minor, serial = int(major), int(minor), int(serial)
164
- if releaselevel == '.':
165
- micro = serial
166
- serial = 0
167
- releaselevel = 'final'
168
- else:
169
- micro = 0
170
- releaselevel = {'a': 'alpha', 'b': 'beta'}[releaselevel]
171
- return _VersionInfoType(major, minor, micro, releaselevel, serial)
172
-
173
-
174
- @enum._simple_enum(enum.StrEnum)
175
- class EventType:
176
- KeyPress = '2'
177
- Key = KeyPress
178
- KeyRelease = '3'
179
- ButtonPress = '4'
180
- Button = ButtonPress
181
- ButtonRelease = '5'
182
- Motion = '6'
183
- Enter = '7'
184
- Leave = '8'
185
- FocusIn = '9'
186
- FocusOut = '10'
187
- Keymap = '11' # undocumented
188
- Expose = '12'
189
- GraphicsExpose = '13' # undocumented
190
- NoExpose = '14' # undocumented
191
- Visibility = '15'
192
- Create = '16'
193
- Destroy = '17'
194
- Unmap = '18'
195
- Map = '19'
196
- MapRequest = '20'
197
- Reparent = '21'
198
- Configure = '22'
199
- ConfigureRequest = '23'
200
- Gravity = '24'
201
- ResizeRequest = '25'
202
- Circulate = '26'
203
- CirculateRequest = '27'
204
- Property = '28'
205
- SelectionClear = '29' # undocumented
206
- SelectionRequest = '30' # undocumented
207
- Selection = '31' # undocumented
208
- Colormap = '32'
209
- ClientMessage = '33' # undocumented
210
- Mapping = '34' # undocumented
211
- VirtualEvent = '35' # undocumented
212
- Activate = '36'
213
- Deactivate = '37'
214
- MouseWheel = '38'
215
-
216
-
217
- class Event:
218
- """Container for the properties of an event.
219
-
220
- Instances of this type are generated if one of the following events occurs:
221
-
222
- KeyPress, KeyRelease - for keyboard events
223
- ButtonPress, ButtonRelease, Motion, Enter, Leave, MouseWheel - for mouse events
224
- Visibility, Unmap, Map, Expose, FocusIn, FocusOut, Circulate,
225
- Colormap, Gravity, Reparent, Property, Destroy, Activate,
226
- Deactivate - for window events.
227
-
228
- If a callback function for one of these events is registered
229
- using bind, bind_all, bind_class, or tag_bind, the callback is
230
- called with an Event as first argument. It will have the
231
- following attributes (in braces are the event types for which
232
- the attribute is valid):
233
-
234
- serial - serial number of event
235
- num - mouse button pressed (ButtonPress, ButtonRelease)
236
- focus - whether the window has the focus (Enter, Leave)
237
- height - height of the exposed window (Configure, Expose)
238
- width - width of the exposed window (Configure, Expose)
239
- keycode - keycode of the pressed key (KeyPress, KeyRelease)
240
- state - state of the event as a number (ButtonPress, ButtonRelease,
241
- Enter, KeyPress, KeyRelease,
242
- Leave, Motion)
243
- state - state as a string (Visibility)
244
- time - when the event occurred
245
- x - x-position of the mouse
246
- y - y-position of the mouse
247
- x_root - x-position of the mouse on the screen
248
- (ButtonPress, ButtonRelease, KeyPress, KeyRelease, Motion)
249
- y_root - y-position of the mouse on the screen
250
- (ButtonPress, ButtonRelease, KeyPress, KeyRelease, Motion)
251
- char - pressed character (KeyPress, KeyRelease)
252
- send_event - see X/Windows documentation
253
- keysym - keysym of the event as a string (KeyPress, KeyRelease)
254
- keysym_num - keysym of the event as a number (KeyPress, KeyRelease)
255
- type - type of the event as a number
256
- widget - widget in which the event occurred
257
- delta - delta of wheel movement (MouseWheel)
258
- """
259
-
260
- def __repr__(self):
261
- attrs = {k: v for k, v in self.__dict__.items() if v != '??'}
262
- if not self.char:
263
- del attrs['char']
264
- elif self.char != '??':
265
- attrs['char'] = repr(self.char)
266
- if not getattr(self, 'send_event', True):
267
- del attrs['send_event']
268
- if self.state == 0:
269
- del attrs['state']
270
- elif isinstance(self.state, int):
271
- state = self.state
272
- mods = ('Shift', 'Lock', 'Control',
273
- 'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5',
274
- 'Button1', 'Button2', 'Button3', 'Button4', 'Button5')
275
- s = []
276
- for i, n in enumerate(mods):
277
- if state & (1 << i):
278
- s.append(n)
279
- state = state & ~((1<< len(mods)) - 1)
280
- if state or not s:
281
- s.append(hex(state))
282
- attrs['state'] = '|'.join(s)
283
- if self.delta == 0:
284
- del attrs['delta']
285
- # widget usually is known
286
- # serial and time are not very interesting
287
- # keysym_num duplicates keysym
288
- # x_root and y_root mostly duplicate x and y
289
- keys = ('send_event',
290
- 'state', 'keysym', 'keycode', 'char',
291
- 'num', 'delta', 'focus',
292
- 'x', 'y', 'width', 'height')
293
- return '<%s event%s>' % (
294
- getattr(self.type, 'name', self.type),
295
- ''.join(' %s=%s' % (k, attrs[k]) for k in keys if k in attrs)
296
- )
297
-
298
-
299
- _support_default_root = True
300
- _default_root = None
301
-
302
-
303
- def NoDefaultRoot():
304
- """Inhibit setting of default root window.
305
-
306
- Call this function to inhibit that the first instance of
307
- Tk is used for windows without an explicit parent window.
308
- """
309
- global _support_default_root, _default_root
310
- _support_default_root = False
311
- # Delete, so any use of _default_root will immediately raise an exception.
312
- # Rebind before deletion, so repeated calls will not fail.
313
- _default_root = None
314
- del _default_root
315
-
316
-
317
- def _get_default_root(what=None):
318
- if not _support_default_root:
319
- raise RuntimeError("No master specified and tkinter is "
320
- "configured to not support default root")
321
- if _default_root is None:
322
- if what:
323
- raise RuntimeError(f"Too early to {what}: no default root window")
324
- root = Tk()
325
- assert _default_root is root
326
- return _default_root
327
-
328
-
329
- def _get_temp_root():
330
- global _support_default_root
331
- if not _support_default_root:
332
- raise RuntimeError("No master specified and tkinter is "
333
- "configured to not support default root")
334
- root = _default_root
335
- if root is None:
336
- assert _support_default_root
337
- _support_default_root = False
338
- root = Tk()
339
- _support_default_root = True
340
- assert _default_root is None
341
- root.withdraw()
342
- root._temporary = True
343
- return root
344
-
345
-
346
- def _destroy_temp_root(master):
347
- if getattr(master, '_temporary', False):
348
- try:
349
- master.destroy()
350
- except TclError:
351
- pass
352
-
353
-
354
- def _tkerror(err):
355
- """Internal function."""
356
- pass
357
-
358
-
359
- def _exit(code=0):
360
- """Internal function. Calling it will raise the exception SystemExit."""
361
- try:
362
- code = int(code)
363
- except ValueError:
364
- pass
365
- raise SystemExit(code)
366
-
367
-
368
- _varnum = 0
369
-
370
-
371
- class Variable:
372
- """Class to define value holders for e.g. buttons.
373
-
374
- Subclasses StringVar, IntVar, DoubleVar, BooleanVar are specializations
375
- that constrain the type of the value returned from get()."""
376
- _default = ""
377
- _tk = None
378
- _tclCommands = None
379
-
380
- def __init__(self, master=None, value=None, name=None):
381
- """Construct a variable
382
-
383
- MASTER can be given as master widget.
384
- VALUE is an optional value (defaults to "")
385
- NAME is an optional Tcl name (defaults to PY_VARnum).
386
-
387
- If NAME matches an existing variable and VALUE is omitted
388
- then the existing value is retained.
389
- """
390
- # check for type of NAME parameter to override weird error message
391
- # raised from Modules/_tkinter.c:SetVar like:
392
- # TypeError: setvar() takes exactly 3 arguments (2 given)
393
- if name is not None and not isinstance(name, str):
394
- raise TypeError("name must be a string")
395
- global _varnum
396
- if master is None:
397
- master = _get_default_root('create variable')
398
- self._root = master._root()
399
- self._tk = master.tk
400
- if name:
401
- self._name = name
402
- else:
403
- self._name = 'PY_VAR' + repr(_varnum)
404
- _varnum += 1
405
- if value is not None:
406
- self.initialize(value)
407
- elif not self._tk.getboolean(self._tk.call("info", "exists", self._name)):
408
- self.initialize(self._default)
409
-
410
- def __del__(self):
411
- """Unset the variable in Tcl."""
412
- if self._tk is None:
413
- return
414
- if self._tk.getboolean(self._tk.call("info", "exists", self._name)):
415
- self._tk.globalunsetvar(self._name)
416
- if self._tclCommands is not None:
417
- for name in self._tclCommands:
418
- self._tk.deletecommand(name)
419
- self._tclCommands = None
420
-
421
- def __str__(self):
422
- """Return the name of the variable in Tcl."""
423
- return self._name
424
-
425
- def set(self, value):
426
- """Set the variable to VALUE."""
427
- return self._tk.globalsetvar(self._name, value)
428
-
429
- initialize = set
430
-
431
- def get(self):
432
- """Return value of variable."""
433
- return self._tk.globalgetvar(self._name)
434
-
435
- def _register(self, callback):
436
- f = CallWrapper(callback, None, self._root).__call__
437
- cbname = repr(id(f))
438
- try:
439
- callback = callback.__func__
440
- except AttributeError:
441
- pass
442
- try:
443
- cbname = cbname + callback.__name__
444
- except AttributeError:
445
- pass
446
- self._tk.createcommand(cbname, f)
447
- if self._tclCommands is None:
448
- self._tclCommands = []
449
- self._tclCommands.append(cbname)
450
- return cbname
451
-
452
- def trace_add(self, mode, callback):
453
- """Define a trace callback for the variable.
454
-
455
- Mode is one of "read", "write", "unset", or a list or tuple of
456
- such strings.
457
- Callback must be a function which is called when the variable is
458
- read, written or unset.
459
-
460
- Return the name of the callback.
461
- """
462
- cbname = self._register(callback)
463
- self._tk.call('trace', 'add', 'variable',
464
- self._name, mode, (cbname,))
465
- return cbname
466
-
467
- def trace_remove(self, mode, cbname):
468
- """Delete the trace callback for a variable.
469
-
470
- Mode is one of "read", "write", "unset" or a list or tuple of
471
- such strings. Must be same as were specified in trace_add().
472
- cbname is the name of the callback returned from trace_add().
473
- """
474
- self._tk.call('trace', 'remove', 'variable',
475
- self._name, mode, cbname)
476
- for m, ca in self.trace_info():
477
- if self._tk.splitlist(ca)[0] == cbname:
478
- break
479
- else:
480
- self._tk.deletecommand(cbname)
481
- try:
482
- self._tclCommands.remove(cbname)
483
- except ValueError:
484
- pass
485
-
486
- def trace_info(self):
487
- """Return all trace callback information."""
488
- splitlist = self._tk.splitlist
489
- return [(splitlist(k), v) for k, v in map(splitlist,
490
- splitlist(self._tk.call('trace', 'info', 'variable', self._name)))]
491
-
492
- def trace_variable(self, mode, callback):
493
- """Define a trace callback for the variable.
494
-
495
- MODE is one of "r", "w", "u" for read, write, undefine.
496
- CALLBACK must be a function which is called when
497
- the variable is read, written or undefined.
498
-
499
- Return the name of the callback.
500
-
501
- This deprecated method wraps a deprecated Tcl method that will
502
- likely be removed in the future. Use trace_add() instead.
503
- """
504
- # TODO: Add deprecation warning
505
- cbname = self._register(callback)
506
- self._tk.call("trace", "variable", self._name, mode, cbname)
507
- return cbname
508
-
509
- trace = trace_variable
510
-
511
- def trace_vdelete(self, mode, cbname):
512
- """Delete the trace callback for a variable.
513
-
514
- MODE is one of "r", "w", "u" for read, write, undefine.
515
- CBNAME is the name of the callback returned from trace_variable or trace.
516
-
517
- This deprecated method wraps a deprecated Tcl method that will
518
- likely be removed in the future. Use trace_remove() instead.
519
- """
520
- # TODO: Add deprecation warning
521
- self._tk.call("trace", "vdelete", self._name, mode, cbname)
522
- cbname = self._tk.splitlist(cbname)[0]
523
- for m, ca in self.trace_info():
524
- if self._tk.splitlist(ca)[0] == cbname:
525
- break
526
- else:
527
- self._tk.deletecommand(cbname)
528
- try:
529
- self._tclCommands.remove(cbname)
530
- except ValueError:
531
- pass
532
-
533
- def trace_vinfo(self):
534
- """Return all trace callback information.
535
-
536
- This deprecated method wraps a deprecated Tcl method that will
537
- likely be removed in the future. Use trace_info() instead.
538
- """
539
- # TODO: Add deprecation warning
540
- return [self._tk.splitlist(x) for x in self._tk.splitlist(
541
- self._tk.call("trace", "vinfo", self._name))]
542
-
543
- def __eq__(self, other):
544
- if not isinstance(other, Variable):
545
- return NotImplemented
546
- return (self._name == other._name
547
- and self.__class__.__name__ == other.__class__.__name__
548
- and self._tk == other._tk)
549
-
550
-
551
- class StringVar(Variable):
552
- """Value holder for strings variables."""
553
- _default = ""
554
-
555
- def __init__(self, master=None, value=None, name=None):
556
- """Construct a string variable.
557
-
558
- MASTER can be given as master widget.
559
- VALUE is an optional value (defaults to "")
560
- NAME is an optional Tcl name (defaults to PY_VARnum).
561
-
562
- If NAME matches an existing variable and VALUE is omitted
563
- then the existing value is retained.
564
- """
565
- Variable.__init__(self, master, value, name)
566
-
567
- def get(self):
568
- """Return value of variable as string."""
569
- value = self._tk.globalgetvar(self._name)
570
- if isinstance(value, str):
571
- return value
572
- return str(value)
573
-
574
-
575
- class IntVar(Variable):
576
- """Value holder for integer variables."""
577
- _default = 0
578
-
579
- def __init__(self, master=None, value=None, name=None):
580
- """Construct an integer variable.
581
-
582
- MASTER can be given as master widget.
583
- VALUE is an optional value (defaults to 0)
584
- NAME is an optional Tcl name (defaults to PY_VARnum).
585
-
586
- If NAME matches an existing variable and VALUE is omitted
587
- then the existing value is retained.
588
- """
589
- Variable.__init__(self, master, value, name)
590
-
591
- def get(self):
592
- """Return the value of the variable as an integer."""
593
- value = self._tk.globalgetvar(self._name)
594
- try:
595
- return self._tk.getint(value)
596
- except (TypeError, TclError):
597
- return int(self._tk.getdouble(value))
598
-
599
-
600
- class DoubleVar(Variable):
601
- """Value holder for float variables."""
602
- _default = 0.0
603
-
604
- def __init__(self, master=None, value=None, name=None):
605
- """Construct a float variable.
606
-
607
- MASTER can be given as master widget.
608
- VALUE is an optional value (defaults to 0.0)
609
- NAME is an optional Tcl name (defaults to PY_VARnum).
610
-
611
- If NAME matches an existing variable and VALUE is omitted
612
- then the existing value is retained.
613
- """
614
- Variable.__init__(self, master, value, name)
615
-
616
- def get(self):
617
- """Return the value of the variable as a float."""
618
- return self._tk.getdouble(self._tk.globalgetvar(self._name))
619
-
620
-
621
- class BooleanVar(Variable):
622
- """Value holder for boolean variables."""
623
- _default = False
624
-
625
- def __init__(self, master=None, value=None, name=None):
626
- """Construct a boolean variable.
627
-
628
- MASTER can be given as master widget.
629
- VALUE is an optional value (defaults to False)
630
- NAME is an optional Tcl name (defaults to PY_VARnum).
631
-
632
- If NAME matches an existing variable and VALUE is omitted
633
- then the existing value is retained.
634
- """
635
- Variable.__init__(self, master, value, name)
636
-
637
- def set(self, value):
638
- """Set the variable to VALUE."""
639
- return self._tk.globalsetvar(self._name, self._tk.getboolean(value))
640
-
641
- initialize = set
642
-
643
- def get(self):
644
- """Return the value of the variable as a bool."""
645
- try:
646
- return self._tk.getboolean(self._tk.globalgetvar(self._name))
647
- except TclError:
648
- raise ValueError("invalid literal for getboolean()")
649
-
650
-
651
- def mainloop(n=0):
652
- """Run the main loop of Tcl."""
653
- _get_default_root('run the main loop').tk.mainloop(n)
654
-
655
-
656
- getint = int
657
-
658
- getdouble = float
659
-
660
-
661
- def getboolean(s):
662
- """Convert Tcl object to True or False."""
663
- try:
664
- return _get_default_root('use getboolean()').tk.getboolean(s)
665
- except TclError:
666
- raise ValueError("invalid literal for getboolean()")
667
-
668
-
669
- # Methods defined on both toplevel and interior widgets
670
-
671
- class Misc:
672
- """Internal class.
673
-
674
- Base class which defines methods common for interior widgets."""
675
-
676
- # used for generating child widget names
677
- _last_child_ids = None
678
-
679
- # XXX font command?
680
- _tclCommands = None
681
-
682
- def destroy(self):
683
- """Internal function.
684
-
685
- Delete all Tcl commands created for
686
- this widget in the Tcl interpreter."""
687
- if self._tclCommands is not None:
688
- for name in self._tclCommands:
689
- self.tk.deletecommand(name)
690
- self._tclCommands = None
691
-
692
- def deletecommand(self, name):
693
- """Internal function.
694
-
695
- Delete the Tcl command provided in NAME."""
696
- self.tk.deletecommand(name)
697
- try:
698
- self._tclCommands.remove(name)
699
- except ValueError:
700
- pass
701
-
702
- def tk_strictMotif(self, boolean=None):
703
- """Set Tcl internal variable, whether the look and feel
704
- should adhere to Motif.
705
-
706
- A parameter of 1 means adhere to Motif (e.g. no color
707
- change if mouse passes over slider).
708
- Returns the set value."""
709
- return self.tk.getboolean(self.tk.call(
710
- 'set', 'tk_strictMotif', boolean))
711
-
712
- def tk_bisque(self):
713
- """Change the color scheme to light brown as used in Tk 3.6 and before."""
714
- self.tk.call('tk_bisque')
715
-
716
- def tk_setPalette(self, *args, **kw):
717
- """Set a new color scheme for all widget elements.
718
-
719
- A single color as argument will cause that all colors of Tk
720
- widget elements are derived from this.
721
- Alternatively several keyword parameters and its associated
722
- colors can be given. The following keywords are valid:
723
- activeBackground, foreground, selectColor,
724
- activeForeground, highlightBackground, selectBackground,
725
- background, highlightColor, selectForeground,
726
- disabledForeground, insertBackground, troughColor."""
727
- self.tk.call(('tk_setPalette',)
728
- + _flatten(args) + _flatten(list(kw.items())))
729
-
730
- def wait_variable(self, name='PY_VAR'):
731
- """Wait until the variable is modified.
732
-
733
- A parameter of type IntVar, StringVar, DoubleVar or
734
- BooleanVar must be given."""
735
- self.tk.call('tkwait', 'variable', name)
736
- waitvar = wait_variable # XXX b/w compat
737
-
738
- def wait_window(self, window=None):
739
- """Wait until a WIDGET is destroyed.
740
-
741
- If no parameter is given self is used."""
742
- if window is None:
743
- window = self
744
- self.tk.call('tkwait', 'window', window._w)
745
-
746
- def wait_visibility(self, window=None):
747
- """Wait until the visibility of a WIDGET changes
748
- (e.g. it appears).
749
-
750
- If no parameter is given self is used."""
751
- if window is None:
752
- window = self
753
- self.tk.call('tkwait', 'visibility', window._w)
754
-
755
- def setvar(self, name='PY_VAR', value='1'):
756
- """Set Tcl variable NAME to VALUE."""
757
- self.tk.setvar(name, value)
758
-
759
- def getvar(self, name='PY_VAR'):
760
- """Return value of Tcl variable NAME."""
761
- return self.tk.getvar(name)
762
-
763
- def getint(self, s):
764
- try:
765
- return self.tk.getint(s)
766
- except TclError as exc:
767
- raise ValueError(str(exc))
768
-
769
- def getdouble(self, s):
770
- try:
771
- return self.tk.getdouble(s)
772
- except TclError as exc:
773
- raise ValueError(str(exc))
774
-
775
- def getboolean(self, s):
776
- """Return a boolean value for Tcl boolean values true and false given as parameter."""
777
- try:
778
- return self.tk.getboolean(s)
779
- except TclError:
780
- raise ValueError("invalid literal for getboolean()")
781
-
782
- def focus_set(self):
783
- """Direct input focus to this widget.
784
-
785
- If the application currently does not have the focus
786
- this widget will get the focus if the application gets
787
- the focus through the window manager."""
788
- self.tk.call('focus', self._w)
789
- focus = focus_set # XXX b/w compat?
790
-
791
- def focus_force(self):
792
- """Direct input focus to this widget even if the
793
- application does not have the focus. Use with
794
- caution!"""
795
- self.tk.call('focus', '-force', self._w)
796
-
797
- def focus_get(self):
798
- """Return the widget which has currently the focus in the
799
- application.
800
-
801
- Use focus_displayof to allow working with several
802
- displays. Return None if application does not have
803
- the focus."""
804
- name = self.tk.call('focus')
805
- if name == 'none' or not name: return None
806
- return self._nametowidget(name)
807
-
808
- def focus_displayof(self):
809
- """Return the widget which has currently the focus on the
810
- display where this widget is located.
811
-
812
- Return None if the application does not have the focus."""
813
- name = self.tk.call('focus', '-displayof', self._w)
814
- if name == 'none' or not name: return None
815
- return self._nametowidget(name)
816
-
817
- def focus_lastfor(self):
818
- """Return the widget which would have the focus if top level
819
- for this widget gets the focus from the window manager."""
820
- name = self.tk.call('focus', '-lastfor', self._w)
821
- if name == 'none' or not name: return None
822
- return self._nametowidget(name)
823
-
824
- def tk_focusFollowsMouse(self):
825
- """The widget under mouse will get automatically focus. Can not
826
- be disabled easily."""
827
- self.tk.call('tk_focusFollowsMouse')
828
-
829
- def tk_focusNext(self):
830
- """Return the next widget in the focus order which follows
831
- widget which has currently the focus.
832
-
833
- The focus order first goes to the next child, then to
834
- the children of the child recursively and then to the
835
- next sibling which is higher in the stacking order. A
836
- widget is omitted if it has the takefocus resource set
837
- to 0."""
838
- name = self.tk.call('tk_focusNext', self._w)
839
- if not name: return None
840
- return self._nametowidget(name)
841
-
842
- def tk_focusPrev(self):
843
- """Return previous widget in the focus order. See tk_focusNext for details."""
844
- name = self.tk.call('tk_focusPrev', self._w)
845
- if not name: return None
846
- return self._nametowidget(name)
847
-
848
- def after(self, ms, func=None, *args):
849
- """Call function once after given time.
850
-
851
- MS specifies the time in milliseconds. FUNC gives the
852
- function which shall be called. Additional parameters
853
- are given as parameters to the function call. Return
854
- identifier to cancel scheduling with after_cancel."""
855
- if func is None:
856
- # I'd rather use time.sleep(ms*0.001)
857
- self.tk.call('after', ms)
858
- return None
859
- else:
860
- def callit():
861
- try:
862
- func(*args)
863
- finally:
864
- try:
865
- self.deletecommand(name)
866
- except TclError:
867
- pass
868
- try:
869
- callit.__name__ = func.__name__
870
- except AttributeError:
871
- # Required for callable classes (bpo-44404)
872
- callit.__name__ = type(func).__name__
873
- name = self._register(callit)
874
- return self.tk.call('after', ms, name)
875
-
876
- def after_idle(self, func, *args):
877
- """Call FUNC once if the Tcl main loop has no event to
878
- process.
879
-
880
- Return an identifier to cancel the scheduling with
881
- after_cancel."""
882
- return self.after('idle', func, *args)
883
-
884
- def after_cancel(self, id):
885
- """Cancel scheduling of function identified with ID.
886
-
887
- Identifier returned by after or after_idle must be
888
- given as first parameter.
889
- """
890
- if not id:
891
- raise ValueError('id must be a valid identifier returned from '
892
- 'after or after_idle')
893
- try:
894
- data = self.tk.call('after', 'info', id)
895
- script = self.tk.splitlist(data)[0]
896
- self.deletecommand(script)
897
- except TclError:
898
- pass
899
- self.tk.call('after', 'cancel', id)
900
-
901
- def bell(self, displayof=0):
902
- """Ring a display's bell."""
903
- self.tk.call(('bell',) + self._displayof(displayof))
904
-
905
- # Clipboard handling:
906
- def clipboard_get(self, **kw):
907
- """Retrieve data from the clipboard on window's display.
908
-
909
- The window keyword defaults to the root window of the Tkinter
910
- application.
911
-
912
- The type keyword specifies the form in which the data is
913
- to be returned and should be an atom name such as STRING
914
- or FILE_NAME. Type defaults to STRING, except on X11, where the default
915
- is to try UTF8_STRING and fall back to STRING.
916
-
917
- This command is equivalent to:
918
-
919
- selection_get(CLIPBOARD)
920
- """
921
- if 'type' not in kw and self._windowingsystem == 'x11':
922
- try:
923
- kw['type'] = 'UTF8_STRING'
924
- return self.tk.call(('clipboard', 'get') + self._options(kw))
925
- except TclError:
926
- del kw['type']
927
- return self.tk.call(('clipboard', 'get') + self._options(kw))
928
-
929
- def clipboard_clear(self, **kw):
930
- """Clear the data in the Tk clipboard.
931
-
932
- A widget specified for the optional displayof keyword
933
- argument specifies the target display."""
934
- if 'displayof' not in kw: kw['displayof'] = self._w
935
- self.tk.call(('clipboard', 'clear') + self._options(kw))
936
-
937
- def clipboard_append(self, string, **kw):
938
- """Append STRING to the Tk clipboard.
939
-
940
- A widget specified at the optional displayof keyword
941
- argument specifies the target display. The clipboard
942
- can be retrieved with selection_get."""
943
- if 'displayof' not in kw: kw['displayof'] = self._w
944
- self.tk.call(('clipboard', 'append') + self._options(kw)
945
- + ('--', string))
946
- # XXX grab current w/o window argument
947
-
948
- def grab_current(self):
949
- """Return widget which has currently the grab in this application
950
- or None."""
951
- name = self.tk.call('grab', 'current', self._w)
952
- if not name: return None
953
- return self._nametowidget(name)
954
-
955
- def grab_release(self):
956
- """Release grab for this widget if currently set."""
957
- self.tk.call('grab', 'release', self._w)
958
-
959
- def grab_set(self):
960
- """Set grab for this widget.
961
-
962
- A grab directs all events to this and descendant
963
- widgets in the application."""
964
- self.tk.call('grab', 'set', self._w)
965
-
966
- def grab_set_global(self):
967
- """Set global grab for this widget.
968
-
969
- A global grab directs all events to this and
970
- descendant widgets on the display. Use with caution -
971
- other applications do not get events anymore."""
972
- self.tk.call('grab', 'set', '-global', self._w)
973
-
974
- def grab_status(self):
975
- """Return None, "local" or "global" if this widget has
976
- no, a local or a global grab."""
977
- status = self.tk.call('grab', 'status', self._w)
978
- if status == 'none': status = None
979
- return status
980
-
981
- def option_add(self, pattern, value, priority = None):
982
- """Set a VALUE (second parameter) for an option
983
- PATTERN (first parameter).
984
-
985
- An optional third parameter gives the numeric priority
986
- (defaults to 80)."""
987
- self.tk.call('option', 'add', pattern, value, priority)
988
-
989
- def option_clear(self):
990
- """Clear the option database.
991
-
992
- It will be reloaded if option_add is called."""
993
- self.tk.call('option', 'clear')
994
-
995
- def option_get(self, name, className):
996
- """Return the value for an option NAME for this widget
997
- with CLASSNAME.
998
-
999
- Values with higher priority override lower values."""
1000
- return self.tk.call('option', 'get', self._w, name, className)
1001
-
1002
- def option_readfile(self, fileName, priority = None):
1003
- """Read file FILENAME into the option database.
1004
-
1005
- An optional second parameter gives the numeric
1006
- priority."""
1007
- self.tk.call('option', 'readfile', fileName, priority)
1008
-
1009
- def selection_clear(self, **kw):
1010
- """Clear the current X selection."""
1011
- if 'displayof' not in kw: kw['displayof'] = self._w
1012
- self.tk.call(('selection', 'clear') + self._options(kw))
1013
-
1014
- def selection_get(self, **kw):
1015
- """Return the contents of the current X selection.
1016
-
1017
- A keyword parameter selection specifies the name of
1018
- the selection and defaults to PRIMARY. A keyword
1019
- parameter displayof specifies a widget on the display
1020
- to use. A keyword parameter type specifies the form of data to be
1021
- fetched, defaulting to STRING except on X11, where UTF8_STRING is tried
1022
- before STRING."""
1023
- if 'displayof' not in kw: kw['displayof'] = self._w
1024
- if 'type' not in kw and self._windowingsystem == 'x11':
1025
- try:
1026
- kw['type'] = 'UTF8_STRING'
1027
- return self.tk.call(('selection', 'get') + self._options(kw))
1028
- except TclError:
1029
- del kw['type']
1030
- return self.tk.call(('selection', 'get') + self._options(kw))
1031
-
1032
- def selection_handle(self, command, **kw):
1033
- """Specify a function COMMAND to call if the X
1034
- selection owned by this widget is queried by another
1035
- application.
1036
-
1037
- This function must return the contents of the
1038
- selection. The function will be called with the
1039
- arguments OFFSET and LENGTH which allows the chunking
1040
- of very long selections. The following keyword
1041
- parameters can be provided:
1042
- selection - name of the selection (default PRIMARY),
1043
- type - type of the selection (e.g. STRING, FILE_NAME)."""
1044
- name = self._register(command)
1045
- self.tk.call(('selection', 'handle') + self._options(kw)
1046
- + (self._w, name))
1047
-
1048
- def selection_own(self, **kw):
1049
- """Become owner of X selection.
1050
-
1051
- A keyword parameter selection specifies the name of
1052
- the selection (default PRIMARY)."""
1053
- self.tk.call(('selection', 'own') +
1054
- self._options(kw) + (self._w,))
1055
-
1056
- def selection_own_get(self, **kw):
1057
- """Return owner of X selection.
1058
-
1059
- The following keyword parameter can
1060
- be provided:
1061
- selection - name of the selection (default PRIMARY),
1062
- type - type of the selection (e.g. STRING, FILE_NAME)."""
1063
- if 'displayof' not in kw: kw['displayof'] = self._w
1064
- name = self.tk.call(('selection', 'own') + self._options(kw))
1065
- if not name: return None
1066
- return self._nametowidget(name)
1067
-
1068
- def send(self, interp, cmd, *args):
1069
- """Send Tcl command CMD to different interpreter INTERP to be executed."""
1070
- return self.tk.call(('send', interp, cmd) + args)
1071
-
1072
- def lower(self, belowThis=None):
1073
- """Lower this widget in the stacking order."""
1074
- self.tk.call('lower', self._w, belowThis)
1075
-
1076
- def tkraise(self, aboveThis=None):
1077
- """Raise this widget in the stacking order."""
1078
- self.tk.call('raise', self._w, aboveThis)
1079
-
1080
- lift = tkraise
1081
-
1082
- def info_patchlevel(self):
1083
- """Returns the exact version of the Tcl library."""
1084
- patchlevel = self.tk.call('info', 'patchlevel')
1085
- return _parse_version(patchlevel)
1086
-
1087
- def winfo_atom(self, name, displayof=0):
1088
- """Return integer which represents atom NAME."""
1089
- args = ('winfo', 'atom') + self._displayof(displayof) + (name,)
1090
- return self.tk.getint(self.tk.call(args))
1091
-
1092
- def winfo_atomname(self, id, displayof=0):
1093
- """Return name of atom with identifier ID."""
1094
- args = ('winfo', 'atomname') \
1095
- + self._displayof(displayof) + (id,)
1096
- return self.tk.call(args)
1097
-
1098
- def winfo_cells(self):
1099
- """Return number of cells in the colormap for this widget."""
1100
- return self.tk.getint(
1101
- self.tk.call('winfo', 'cells', self._w))
1102
-
1103
- def winfo_children(self):
1104
- """Return a list of all widgets which are children of this widget."""
1105
- result = []
1106
- for child in self.tk.splitlist(
1107
- self.tk.call('winfo', 'children', self._w)):
1108
- try:
1109
- # Tcl sometimes returns extra windows, e.g. for
1110
- # menus; those need to be skipped
1111
- result.append(self._nametowidget(child))
1112
- except KeyError:
1113
- pass
1114
- return result
1115
-
1116
- def winfo_class(self):
1117
- """Return window class name of this widget."""
1118
- return self.tk.call('winfo', 'class', self._w)
1119
-
1120
- def winfo_colormapfull(self):
1121
- """Return True if at the last color request the colormap was full."""
1122
- return self.tk.getboolean(
1123
- self.tk.call('winfo', 'colormapfull', self._w))
1124
-
1125
- def winfo_containing(self, rootX, rootY, displayof=0):
1126
- """Return the widget which is at the root coordinates ROOTX, ROOTY."""
1127
- args = ('winfo', 'containing') \
1128
- + self._displayof(displayof) + (rootX, rootY)
1129
- name = self.tk.call(args)
1130
- if not name: return None
1131
- return self._nametowidget(name)
1132
-
1133
- def winfo_depth(self):
1134
- """Return the number of bits per pixel."""
1135
- return self.tk.getint(self.tk.call('winfo', 'depth', self._w))
1136
-
1137
- def winfo_exists(self):
1138
- """Return true if this widget exists."""
1139
- return self.tk.getint(
1140
- self.tk.call('winfo', 'exists', self._w))
1141
-
1142
- def winfo_fpixels(self, number):
1143
- """Return the number of pixels for the given distance NUMBER
1144
- (e.g. "3c") as float."""
1145
- return self.tk.getdouble(self.tk.call(
1146
- 'winfo', 'fpixels', self._w, number))
1147
-
1148
- def winfo_geometry(self):
1149
- """Return geometry string for this widget in the form "widthxheight+X+Y"."""
1150
- return self.tk.call('winfo', 'geometry', self._w)
1151
-
1152
- def winfo_height(self):
1153
- """Return height of this widget."""
1154
- return self.tk.getint(
1155
- self.tk.call('winfo', 'height', self._w))
1156
-
1157
- def winfo_id(self):
1158
- """Return identifier ID for this widget."""
1159
- return int(self.tk.call('winfo', 'id', self._w), 0)
1160
-
1161
- def winfo_interps(self, displayof=0):
1162
- """Return the name of all Tcl interpreters for this display."""
1163
- args = ('winfo', 'interps') + self._displayof(displayof)
1164
- return self.tk.splitlist(self.tk.call(args))
1165
-
1166
- def winfo_ismapped(self):
1167
- """Return true if this widget is mapped."""
1168
- return self.tk.getint(
1169
- self.tk.call('winfo', 'ismapped', self._w))
1170
-
1171
- def winfo_manager(self):
1172
- """Return the window manager name for this widget."""
1173
- return self.tk.call('winfo', 'manager', self._w)
1174
-
1175
- def winfo_name(self):
1176
- """Return the name of this widget."""
1177
- return self.tk.call('winfo', 'name', self._w)
1178
-
1179
- def winfo_parent(self):
1180
- """Return the name of the parent of this widget."""
1181
- return self.tk.call('winfo', 'parent', self._w)
1182
-
1183
- def winfo_pathname(self, id, displayof=0):
1184
- """Return the pathname of the widget given by ID."""
1185
- if isinstance(id, int):
1186
- id = hex(id)
1187
- args = ('winfo', 'pathname') \
1188
- + self._displayof(displayof) + (id,)
1189
- return self.tk.call(args)
1190
-
1191
- def winfo_pixels(self, number):
1192
- """Rounded integer value of winfo_fpixels."""
1193
- return self.tk.getint(
1194
- self.tk.call('winfo', 'pixels', self._w, number))
1195
-
1196
- def winfo_pointerx(self):
1197
- """Return the x coordinate of the pointer on the root window."""
1198
- return self.tk.getint(
1199
- self.tk.call('winfo', 'pointerx', self._w))
1200
-
1201
- def winfo_pointerxy(self):
1202
- """Return a tuple of x and y coordinates of the pointer on the root window."""
1203
- return self._getints(
1204
- self.tk.call('winfo', 'pointerxy', self._w))
1205
-
1206
- def winfo_pointery(self):
1207
- """Return the y coordinate of the pointer on the root window."""
1208
- return self.tk.getint(
1209
- self.tk.call('winfo', 'pointery', self._w))
1210
-
1211
- def winfo_reqheight(self):
1212
- """Return requested height of this widget."""
1213
- return self.tk.getint(
1214
- self.tk.call('winfo', 'reqheight', self._w))
1215
-
1216
- def winfo_reqwidth(self):
1217
- """Return requested width of this widget."""
1218
- return self.tk.getint(
1219
- self.tk.call('winfo', 'reqwidth', self._w))
1220
-
1221
- def winfo_rgb(self, color):
1222
- """Return a tuple of integer RGB values in range(65536) for color in this widget."""
1223
- return self._getints(
1224
- self.tk.call('winfo', 'rgb', self._w, color))
1225
-
1226
- def winfo_rootx(self):
1227
- """Return x coordinate of upper left corner of this widget on the
1228
- root window."""
1229
- return self.tk.getint(
1230
- self.tk.call('winfo', 'rootx', self._w))
1231
-
1232
- def winfo_rooty(self):
1233
- """Return y coordinate of upper left corner of this widget on the
1234
- root window."""
1235
- return self.tk.getint(
1236
- self.tk.call('winfo', 'rooty', self._w))
1237
-
1238
- def winfo_screen(self):
1239
- """Return the screen name of this widget."""
1240
- return self.tk.call('winfo', 'screen', self._w)
1241
-
1242
- def winfo_screencells(self):
1243
- """Return the number of the cells in the colormap of the screen
1244
- of this widget."""
1245
- return self.tk.getint(
1246
- self.tk.call('winfo', 'screencells', self._w))
1247
-
1248
- def winfo_screendepth(self):
1249
- """Return the number of bits per pixel of the root window of the
1250
- screen of this widget."""
1251
- return self.tk.getint(
1252
- self.tk.call('winfo', 'screendepth', self._w))
1253
-
1254
- def winfo_screenheight(self):
1255
- """Return the number of pixels of the height of the screen of this widget
1256
- in pixel."""
1257
- return self.tk.getint(
1258
- self.tk.call('winfo', 'screenheight', self._w))
1259
-
1260
- def winfo_screenmmheight(self):
1261
- """Return the number of pixels of the height of the screen of
1262
- this widget in mm."""
1263
- return self.tk.getint(
1264
- self.tk.call('winfo', 'screenmmheight', self._w))
1265
-
1266
- def winfo_screenmmwidth(self):
1267
- """Return the number of pixels of the width of the screen of
1268
- this widget in mm."""
1269
- return self.tk.getint(
1270
- self.tk.call('winfo', 'screenmmwidth', self._w))
1271
-
1272
- def winfo_screenvisual(self):
1273
- """Return one of the strings directcolor, grayscale, pseudocolor,
1274
- staticcolor, staticgray, or truecolor for the default
1275
- colormodel of this screen."""
1276
- return self.tk.call('winfo', 'screenvisual', self._w)
1277
-
1278
- def winfo_screenwidth(self):
1279
- """Return the number of pixels of the width of the screen of
1280
- this widget in pixel."""
1281
- return self.tk.getint(
1282
- self.tk.call('winfo', 'screenwidth', self._w))
1283
-
1284
- def winfo_server(self):
1285
- """Return information of the X-Server of the screen of this widget in
1286
- the form "XmajorRminor vendor vendorVersion"."""
1287
- return self.tk.call('winfo', 'server', self._w)
1288
-
1289
- def winfo_toplevel(self):
1290
- """Return the toplevel widget of this widget."""
1291
- return self._nametowidget(self.tk.call(
1292
- 'winfo', 'toplevel', self._w))
1293
-
1294
- def winfo_viewable(self):
1295
- """Return true if the widget and all its higher ancestors are mapped."""
1296
- return self.tk.getint(
1297
- self.tk.call('winfo', 'viewable', self._w))
1298
-
1299
- def winfo_visual(self):
1300
- """Return one of the strings directcolor, grayscale, pseudocolor,
1301
- staticcolor, staticgray, or truecolor for the
1302
- colormodel of this widget."""
1303
- return self.tk.call('winfo', 'visual', self._w)
1304
-
1305
- def winfo_visualid(self):
1306
- """Return the X identifier for the visual for this widget."""
1307
- return self.tk.call('winfo', 'visualid', self._w)
1308
-
1309
- def winfo_visualsavailable(self, includeids=False):
1310
- """Return a list of all visuals available for the screen
1311
- of this widget.
1312
-
1313
- Each item in the list consists of a visual name (see winfo_visual), a
1314
- depth and if includeids is true is given also the X identifier."""
1315
- data = self.tk.call('winfo', 'visualsavailable', self._w,
1316
- 'includeids' if includeids else None)
1317
- data = [self.tk.splitlist(x) for x in self.tk.splitlist(data)]
1318
- return [self.__winfo_parseitem(x) for x in data]
1319
-
1320
- def __winfo_parseitem(self, t):
1321
- """Internal function."""
1322
- return t[:1] + tuple(map(self.__winfo_getint, t[1:]))
1323
-
1324
- def __winfo_getint(self, x):
1325
- """Internal function."""
1326
- return int(x, 0)
1327
-
1328
- def winfo_vrootheight(self):
1329
- """Return the height of the virtual root window associated with this
1330
- widget in pixels. If there is no virtual root window return the
1331
- height of the screen."""
1332
- return self.tk.getint(
1333
- self.tk.call('winfo', 'vrootheight', self._w))
1334
-
1335
- def winfo_vrootwidth(self):
1336
- """Return the width of the virtual root window associated with this
1337
- widget in pixel. If there is no virtual root window return the
1338
- width of the screen."""
1339
- return self.tk.getint(
1340
- self.tk.call('winfo', 'vrootwidth', self._w))
1341
-
1342
- def winfo_vrootx(self):
1343
- """Return the x offset of the virtual root relative to the root
1344
- window of the screen of this widget."""
1345
- return self.tk.getint(
1346
- self.tk.call('winfo', 'vrootx', self._w))
1347
-
1348
- def winfo_vrooty(self):
1349
- """Return the y offset of the virtual root relative to the root
1350
- window of the screen of this widget."""
1351
- return self.tk.getint(
1352
- self.tk.call('winfo', 'vrooty', self._w))
1353
-
1354
- def winfo_width(self):
1355
- """Return the width of this widget."""
1356
- return self.tk.getint(
1357
- self.tk.call('winfo', 'width', self._w))
1358
-
1359
- def winfo_x(self):
1360
- """Return the x coordinate of the upper left corner of this widget
1361
- in the parent."""
1362
- return self.tk.getint(
1363
- self.tk.call('winfo', 'x', self._w))
1364
-
1365
- def winfo_y(self):
1366
- """Return the y coordinate of the upper left corner of this widget
1367
- in the parent."""
1368
- return self.tk.getint(
1369
- self.tk.call('winfo', 'y', self._w))
1370
-
1371
- def update(self):
1372
- """Enter event loop until all pending events have been processed by Tcl."""
1373
- self.tk.call('update')
1374
-
1375
- def update_idletasks(self):
1376
- """Enter event loop until all idle callbacks have been called. This
1377
- will update the display of windows but not process events caused by
1378
- the user."""
1379
- self.tk.call('update', 'idletasks')
1380
-
1381
- def bindtags(self, tagList=None):
1382
- """Set or get the list of bindtags for this widget.
1383
-
1384
- With no argument return the list of all bindtags associated with
1385
- this widget. With a list of strings as argument the bindtags are
1386
- set to this list. The bindtags determine in which order events are
1387
- processed (see bind)."""
1388
- if tagList is None:
1389
- return self.tk.splitlist(
1390
- self.tk.call('bindtags', self._w))
1391
- else:
1392
- self.tk.call('bindtags', self._w, tagList)
1393
-
1394
- def _bind(self, what, sequence, func, add, needcleanup=1):
1395
- """Internal function."""
1396
- if isinstance(func, str):
1397
- self.tk.call(what + (sequence, func))
1398
- elif func:
1399
- funcid = self._register(func, self._substitute,
1400
- needcleanup)
1401
- cmd = ('%sif {"[%s %s]" == "break"} break\n'
1402
- %
1403
- (add and '+' or '',
1404
- funcid, self._subst_format_str))
1405
- self.tk.call(what + (sequence, cmd))
1406
- return funcid
1407
- elif sequence:
1408
- return self.tk.call(what + (sequence,))
1409
- else:
1410
- return self.tk.splitlist(self.tk.call(what))
1411
-
1412
- def bind(self, sequence=None, func=None, add=None):
1413
- """Bind to this widget at event SEQUENCE a call to function FUNC.
1414
-
1415
- SEQUENCE is a string of concatenated event
1416
- patterns. An event pattern is of the form
1417
- <MODIFIER-MODIFIER-TYPE-DETAIL> where MODIFIER is one
1418
- of Control, Mod2, M2, Shift, Mod3, M3, Lock, Mod4, M4,
1419
- Button1, B1, Mod5, M5 Button2, B2, Meta, M, Button3,
1420
- B3, Alt, Button4, B4, Double, Button5, B5 Triple,
1421
- Mod1, M1. TYPE is one of Activate, Enter, Map,
1422
- ButtonPress, Button, Expose, Motion, ButtonRelease
1423
- FocusIn, MouseWheel, Circulate, FocusOut, Property,
1424
- Colormap, Gravity Reparent, Configure, KeyPress, Key,
1425
- Unmap, Deactivate, KeyRelease Visibility, Destroy,
1426
- Leave and DETAIL is the button number for ButtonPress,
1427
- ButtonRelease and DETAIL is the Keysym for KeyPress and
1428
- KeyRelease. Examples are
1429
- <Control-Button-1> for pressing Control and mouse button 1 or
1430
- <Alt-A> for pressing A and the Alt key (KeyPress can be omitted).
1431
- An event pattern can also be a virtual event of the form
1432
- <<AString>> where AString can be arbitrary. This
1433
- event can be generated by event_generate.
1434
- If events are concatenated they must appear shortly
1435
- after each other.
1436
-
1437
- FUNC will be called if the event sequence occurs with an
1438
- instance of Event as argument. If the return value of FUNC is
1439
- "break" no further bound function is invoked.
1440
-
1441
- An additional boolean parameter ADD specifies whether FUNC will
1442
- be called additionally to the other bound function or whether
1443
- it will replace the previous function.
1444
-
1445
- Bind will return an identifier to allow deletion of the bound function with
1446
- unbind without memory leak.
1447
-
1448
- If FUNC or SEQUENCE is omitted the bound function or list
1449
- of bound events are returned."""
1450
-
1451
- return self._bind(('bind', self._w), sequence, func, add)
1452
-
1453
- def unbind(self, sequence, funcid=None):
1454
- """Unbind for this widget the event SEQUENCE.
1455
-
1456
- If FUNCID is given, only unbind the function identified with FUNCID
1457
- and also delete the corresponding Tcl command.
1458
-
1459
- Otherwise destroy the current binding for SEQUENCE, leaving SEQUENCE
1460
- unbound.
1461
- """
1462
- self._unbind(('bind', self._w, sequence), funcid)
1463
-
1464
- def _unbind(self, what, funcid=None):
1465
- if funcid is None:
1466
- self.tk.call(*what, '')
1467
- else:
1468
- lines = self.tk.call(what).split('\n')
1469
- prefix = f'if {{"[{funcid} '
1470
- keep = '\n'.join(line for line in lines
1471
- if not line.startswith(prefix))
1472
- if not keep.strip():
1473
- keep = ''
1474
- self.tk.call(*what, keep)
1475
- self.deletecommand(funcid)
1476
-
1477
- def bind_all(self, sequence=None, func=None, add=None):
1478
- """Bind to all widgets at an event SEQUENCE a call to function FUNC.
1479
- An additional boolean parameter ADD specifies whether FUNC will
1480
- be called additionally to the other bound function or whether
1481
- it will replace the previous function. See bind for the return value."""
1482
- return self._root()._bind(('bind', 'all'), sequence, func, add, True)
1483
-
1484
- def unbind_all(self, sequence):
1485
- """Unbind for all widgets for event SEQUENCE all functions."""
1486
- self._root()._unbind(('bind', 'all', sequence))
1487
-
1488
- def bind_class(self, className, sequence=None, func=None, add=None):
1489
- """Bind to widgets with bindtag CLASSNAME at event
1490
- SEQUENCE a call of function FUNC. An additional
1491
- boolean parameter ADD specifies whether FUNC will be
1492
- called additionally to the other bound function or
1493
- whether it will replace the previous function. See bind for
1494
- the return value."""
1495
-
1496
- return self._root()._bind(('bind', className), sequence, func, add, True)
1497
-
1498
- def unbind_class(self, className, sequence):
1499
- """Unbind for all widgets with bindtag CLASSNAME for event SEQUENCE
1500
- all functions."""
1501
- self._root()._unbind(('bind', className, sequence))
1502
-
1503
- def mainloop(self, n=0):
1504
- """Call the mainloop of Tk."""
1505
- self.tk.mainloop(n)
1506
-
1507
- def quit(self):
1508
- """Quit the Tcl interpreter. All widgets will be destroyed."""
1509
- self.tk.quit()
1510
-
1511
- def _getints(self, string):
1512
- """Internal function."""
1513
- if string:
1514
- return tuple(map(self.tk.getint, self.tk.splitlist(string)))
1515
-
1516
- def _getdoubles(self, string):
1517
- """Internal function."""
1518
- if string:
1519
- return tuple(map(self.tk.getdouble, self.tk.splitlist(string)))
1520
-
1521
- def _getboolean(self, string):
1522
- """Internal function."""
1523
- if string:
1524
- return self.tk.getboolean(string)
1525
-
1526
- def _displayof(self, displayof):
1527
- """Internal function."""
1528
- if displayof:
1529
- return ('-displayof', displayof)
1530
- if displayof is None:
1531
- return ('-displayof', self._w)
1532
- return ()
1533
-
1534
- @property
1535
- def _windowingsystem(self):
1536
- """Internal function."""
1537
- try:
1538
- return self._root()._windowingsystem_cached
1539
- except AttributeError:
1540
- ws = self._root()._windowingsystem_cached = \
1541
- self.tk.call('tk', 'windowingsystem')
1542
- return ws
1543
-
1544
- def _options(self, cnf, kw = None):
1545
- """Internal function."""
1546
- if kw:
1547
- cnf = _cnfmerge((cnf, kw))
1548
- else:
1549
- cnf = _cnfmerge(cnf)
1550
- res = ()
1551
- for k, v in cnf.items():
1552
- if v is not None:
1553
- if k[-1] == '_': k = k[:-1]
1554
- if callable(v):
1555
- v = self._register(v)
1556
- elif isinstance(v, (tuple, list)):
1557
- nv = []
1558
- for item in v:
1559
- if isinstance(item, int):
1560
- nv.append(str(item))
1561
- elif isinstance(item, str):
1562
- nv.append(_stringify(item))
1563
- else:
1564
- break
1565
- else:
1566
- v = ' '.join(nv)
1567
- res = res + ('-'+k, v)
1568
- return res
1569
-
1570
- def nametowidget(self, name):
1571
- """Return the Tkinter instance of a widget identified by
1572
- its Tcl name NAME."""
1573
- name = str(name).split('.')
1574
- w = self
1575
-
1576
- if not name[0]:
1577
- w = w._root()
1578
- name = name[1:]
1579
-
1580
- for n in name:
1581
- if not n:
1582
- break
1583
- w = w.children[n]
1584
-
1585
- return w
1586
-
1587
- _nametowidget = nametowidget
1588
-
1589
- def _register(self, func, subst=None, needcleanup=1):
1590
- """Return a newly created Tcl function. If this
1591
- function is called, the Python function FUNC will
1592
- be executed. An optional function SUBST can
1593
- be given which will be executed before FUNC."""
1594
- f = CallWrapper(func, subst, self).__call__
1595
- name = repr(id(f))
1596
- try:
1597
- func = func.__func__
1598
- except AttributeError:
1599
- pass
1600
- try:
1601
- name = name + func.__name__
1602
- except AttributeError:
1603
- pass
1604
- self.tk.createcommand(name, f)
1605
- if needcleanup:
1606
- if self._tclCommands is None:
1607
- self._tclCommands = []
1608
- self._tclCommands.append(name)
1609
- return name
1610
-
1611
- register = _register
1612
-
1613
- def _root(self):
1614
- """Internal function."""
1615
- w = self
1616
- while w.master is not None: w = w.master
1617
- return w
1618
- _subst_format = ('%#', '%b', '%f', '%h', '%k',
1619
- '%s', '%t', '%w', '%x', '%y',
1620
- '%A', '%E', '%K', '%N', '%W', '%T', '%X', '%Y', '%D')
1621
- _subst_format_str = " ".join(_subst_format)
1622
-
1623
- def _substitute(self, *args):
1624
- """Internal function."""
1625
- if len(args) != len(self._subst_format): return args
1626
- getboolean = self.tk.getboolean
1627
-
1628
- getint = self.tk.getint
1629
- def getint_event(s):
1630
- """Tk changed behavior in 8.4.2, returning "??" rather more often."""
1631
- try:
1632
- return getint(s)
1633
- except (ValueError, TclError):
1634
- return s
1635
-
1636
- nsign, b, f, h, k, s, t, w, x, y, A, E, K, N, W, T, X, Y, D = args
1637
- # Missing: (a, c, d, m, o, v, B, R)
1638
- e = Event()
1639
- # serial field: valid for all events
1640
- # number of button: ButtonPress and ButtonRelease events only
1641
- # height field: Configure, ConfigureRequest, Create,
1642
- # ResizeRequest, and Expose events only
1643
- # keycode field: KeyPress and KeyRelease events only
1644
- # time field: "valid for events that contain a time field"
1645
- # width field: Configure, ConfigureRequest, Create, ResizeRequest,
1646
- # and Expose events only
1647
- # x field: "valid for events that contain an x field"
1648
- # y field: "valid for events that contain a y field"
1649
- # keysym as decimal: KeyPress and KeyRelease events only
1650
- # x_root, y_root fields: ButtonPress, ButtonRelease, KeyPress,
1651
- # KeyRelease, and Motion events
1652
- e.serial = getint(nsign)
1653
- e.num = getint_event(b)
1654
- try: e.focus = getboolean(f)
1655
- except TclError: pass
1656
- e.height = getint_event(h)
1657
- e.keycode = getint_event(k)
1658
- e.state = getint_event(s)
1659
- e.time = getint_event(t)
1660
- e.width = getint_event(w)
1661
- e.x = getint_event(x)
1662
- e.y = getint_event(y)
1663
- e.char = A
1664
- try: e.send_event = getboolean(E)
1665
- except TclError: pass
1666
- e.keysym = K
1667
- e.keysym_num = getint_event(N)
1668
- try:
1669
- e.type = EventType(T)
1670
- except ValueError:
1671
- e.type = T
1672
- try:
1673
- e.widget = self._nametowidget(W)
1674
- except KeyError:
1675
- e.widget = W
1676
- e.x_root = getint_event(X)
1677
- e.y_root = getint_event(Y)
1678
- try:
1679
- e.delta = getint(D)
1680
- except (ValueError, TclError):
1681
- e.delta = 0
1682
- return (e,)
1683
-
1684
- def _report_exception(self):
1685
- """Internal function."""
1686
- exc, val, tb = sys.exc_info()
1687
- root = self._root()
1688
- root.report_callback_exception(exc, val, tb)
1689
-
1690
- def _getconfigure(self, *args):
1691
- """Call Tcl configure command and return the result as a dict."""
1692
- cnf = {}
1693
- for x in self.tk.splitlist(self.tk.call(*args)):
1694
- x = self.tk.splitlist(x)
1695
- cnf[x[0][1:]] = (x[0][1:],) + x[1:]
1696
- return cnf
1697
-
1698
- def _getconfigure1(self, *args):
1699
- x = self.tk.splitlist(self.tk.call(*args))
1700
- return (x[0][1:],) + x[1:]
1701
-
1702
- def _configure(self, cmd, cnf, kw):
1703
- """Internal function."""
1704
- if kw:
1705
- cnf = _cnfmerge((cnf, kw))
1706
- elif cnf:
1707
- cnf = _cnfmerge(cnf)
1708
- if cnf is None:
1709
- return self._getconfigure(_flatten((self._w, cmd)))
1710
- if isinstance(cnf, str):
1711
- return self._getconfigure1(_flatten((self._w, cmd, '-'+cnf)))
1712
- self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
1713
- # These used to be defined in Widget:
1714
-
1715
- def configure(self, cnf=None, **kw):
1716
- """Configure resources of a widget.
1717
-
1718
- The values for resources are specified as keyword
1719
- arguments. To get an overview about
1720
- the allowed keyword arguments call the method keys.
1721
- """
1722
- return self._configure('configure', cnf, kw)
1723
-
1724
- config = configure
1725
-
1726
- def cget(self, key):
1727
- """Return the resource value for a KEY given as string."""
1728
- return self.tk.call(self._w, 'cget', '-' + key)
1729
-
1730
- __getitem__ = cget
1731
-
1732
- def __setitem__(self, key, value):
1733
- self.configure({key: value})
1734
-
1735
- def keys(self):
1736
- """Return a list of all resource names of this widget."""
1737
- splitlist = self.tk.splitlist
1738
- return [splitlist(x)[0][1:] for x in
1739
- splitlist(self.tk.call(self._w, 'configure'))]
1740
-
1741
- def __str__(self):
1742
- """Return the window path name of this widget."""
1743
- return self._w
1744
-
1745
- def __repr__(self):
1746
- return '<%s.%s object %s>' % (
1747
- self.__class__.__module__, self.__class__.__qualname__, self._w)
1748
-
1749
- # Pack methods that apply to the master
1750
- _noarg_ = ['_noarg_']
1751
-
1752
- def pack_propagate(self, flag=_noarg_):
1753
- """Set or get the status for propagation of geometry information.
1754
-
1755
- A boolean argument specifies whether the geometry information
1756
- of the slaves will determine the size of this widget. If no argument
1757
- is given the current setting will be returned.
1758
- """
1759
- if flag is Misc._noarg_:
1760
- return self._getboolean(self.tk.call(
1761
- 'pack', 'propagate', self._w))
1762
- else:
1763
- self.tk.call('pack', 'propagate', self._w, flag)
1764
-
1765
- propagate = pack_propagate
1766
-
1767
- def pack_slaves(self):
1768
- """Return a list of all slaves of this widget
1769
- in its packing order."""
1770
- return [self._nametowidget(x) for x in
1771
- self.tk.splitlist(
1772
- self.tk.call('pack', 'slaves', self._w))]
1773
-
1774
- slaves = pack_slaves
1775
-
1776
- # Place method that applies to the master
1777
- def place_slaves(self):
1778
- """Return a list of all slaves of this widget
1779
- in its packing order."""
1780
- return [self._nametowidget(x) for x in
1781
- self.tk.splitlist(
1782
- self.tk.call(
1783
- 'place', 'slaves', self._w))]
1784
-
1785
- # Grid methods that apply to the master
1786
-
1787
- def grid_anchor(self, anchor=None): # new in Tk 8.5
1788
- """The anchor value controls how to place the grid within the
1789
- master when no row/column has any weight.
1790
-
1791
- The default anchor is nw."""
1792
- self.tk.call('grid', 'anchor', self._w, anchor)
1793
-
1794
- anchor = grid_anchor
1795
-
1796
- def grid_bbox(self, column=None, row=None, col2=None, row2=None):
1797
- """Return a tuple of integer coordinates for the bounding
1798
- box of this widget controlled by the geometry manager grid.
1799
-
1800
- If COLUMN, ROW is given the bounding box applies from
1801
- the cell with row and column 0 to the specified
1802
- cell. If COL2 and ROW2 are given the bounding box
1803
- starts at that cell.
1804
-
1805
- The returned integers specify the offset of the upper left
1806
- corner in the master widget and the width and height.
1807
- """
1808
- args = ('grid', 'bbox', self._w)
1809
- if column is not None and row is not None:
1810
- args = args + (column, row)
1811
- if col2 is not None and row2 is not None:
1812
- args = args + (col2, row2)
1813
- return self._getints(self.tk.call(*args)) or None
1814
-
1815
- bbox = grid_bbox
1816
-
1817
- def _gridconvvalue(self, value):
1818
- if isinstance(value, (str, _tkinter.Tcl_Obj)):
1819
- try:
1820
- svalue = str(value)
1821
- if not svalue:
1822
- return None
1823
- elif '.' in svalue:
1824
- return self.tk.getdouble(svalue)
1825
- else:
1826
- return self.tk.getint(svalue)
1827
- except (ValueError, TclError):
1828
- pass
1829
- return value
1830
-
1831
- def _grid_configure(self, command, index, cnf, kw):
1832
- """Internal function."""
1833
- if isinstance(cnf, str) and not kw:
1834
- if cnf[-1:] == '_':
1835
- cnf = cnf[:-1]
1836
- if cnf[:1] != '-':
1837
- cnf = '-'+cnf
1838
- options = (cnf,)
1839
- else:
1840
- options = self._options(cnf, kw)
1841
- if not options:
1842
- return _splitdict(
1843
- self.tk,
1844
- self.tk.call('grid', command, self._w, index),
1845
- conv=self._gridconvvalue)
1846
- res = self.tk.call(
1847
- ('grid', command, self._w, index)
1848
- + options)
1849
- if len(options) == 1:
1850
- return self._gridconvvalue(res)
1851
-
1852
- def grid_columnconfigure(self, index, cnf={}, **kw):
1853
- """Configure column INDEX of a grid.
1854
-
1855
- Valid resources are minsize (minimum size of the column),
1856
- weight (how much does additional space propagate to this column)
1857
- and pad (how much space to let additionally)."""
1858
- return self._grid_configure('columnconfigure', index, cnf, kw)
1859
-
1860
- columnconfigure = grid_columnconfigure
1861
-
1862
- def grid_location(self, x, y):
1863
- """Return a tuple of column and row which identify the cell
1864
- at which the pixel at position X and Y inside the master
1865
- widget is located."""
1866
- return self._getints(
1867
- self.tk.call(
1868
- 'grid', 'location', self._w, x, y)) or None
1869
-
1870
- def grid_propagate(self, flag=_noarg_):
1871
- """Set or get the status for propagation of geometry information.
1872
-
1873
- A boolean argument specifies whether the geometry information
1874
- of the slaves will determine the size of this widget. If no argument
1875
- is given, the current setting will be returned.
1876
- """
1877
- if flag is Misc._noarg_:
1878
- return self._getboolean(self.tk.call(
1879
- 'grid', 'propagate', self._w))
1880
- else:
1881
- self.tk.call('grid', 'propagate', self._w, flag)
1882
-
1883
- def grid_rowconfigure(self, index, cnf={}, **kw):
1884
- """Configure row INDEX of a grid.
1885
-
1886
- Valid resources are minsize (minimum size of the row),
1887
- weight (how much does additional space propagate to this row)
1888
- and pad (how much space to let additionally)."""
1889
- return self._grid_configure('rowconfigure', index, cnf, kw)
1890
-
1891
- rowconfigure = grid_rowconfigure
1892
-
1893
- def grid_size(self):
1894
- """Return a tuple of the number of column and rows in the grid."""
1895
- return self._getints(
1896
- self.tk.call('grid', 'size', self._w)) or None
1897
-
1898
- size = grid_size
1899
-
1900
- def grid_slaves(self, row=None, column=None):
1901
- """Return a list of all slaves of this widget
1902
- in its packing order."""
1903
- args = ()
1904
- if row is not None:
1905
- args = args + ('-row', row)
1906
- if column is not None:
1907
- args = args + ('-column', column)
1908
- return [self._nametowidget(x) for x in
1909
- self.tk.splitlist(self.tk.call(
1910
- ('grid', 'slaves', self._w) + args))]
1911
-
1912
- # Support for the "event" command, new in Tk 4.2.
1913
- # By Case Roole.
1914
-
1915
- def event_add(self, virtual, *sequences):
1916
- """Bind a virtual event VIRTUAL (of the form <<Name>>)
1917
- to an event SEQUENCE such that the virtual event is triggered
1918
- whenever SEQUENCE occurs."""
1919
- args = ('event', 'add', virtual) + sequences
1920
- self.tk.call(args)
1921
-
1922
- def event_delete(self, virtual, *sequences):
1923
- """Unbind a virtual event VIRTUAL from SEQUENCE."""
1924
- args = ('event', 'delete', virtual) + sequences
1925
- self.tk.call(args)
1926
-
1927
- def event_generate(self, sequence, **kw):
1928
- """Generate an event SEQUENCE. Additional
1929
- keyword arguments specify parameter of the event
1930
- (e.g. x, y, rootx, rooty)."""
1931
- args = ('event', 'generate', self._w, sequence)
1932
- for k, v in kw.items():
1933
- args = args + ('-%s' % k, str(v))
1934
- self.tk.call(args)
1935
-
1936
- def event_info(self, virtual=None):
1937
- """Return a list of all virtual events or the information
1938
- about the SEQUENCE bound to the virtual event VIRTUAL."""
1939
- return self.tk.splitlist(
1940
- self.tk.call('event', 'info', virtual))
1941
-
1942
- # Image related commands
1943
-
1944
- def image_names(self):
1945
- """Return a list of all existing image names."""
1946
- return self.tk.splitlist(self.tk.call('image', 'names'))
1947
-
1948
- def image_types(self):
1949
- """Return a list of all available image types (e.g. photo bitmap)."""
1950
- return self.tk.splitlist(self.tk.call('image', 'types'))
1951
-
1952
-
1953
- class CallWrapper:
1954
- """Internal class. Stores function to call when some user
1955
- defined Tcl function is called e.g. after an event occurred."""
1956
-
1957
- def __init__(self, func, subst, widget):
1958
- """Store FUNC, SUBST and WIDGET as members."""
1959
- self.func = func
1960
- self.subst = subst
1961
- self.widget = widget
1962
-
1963
- def __call__(self, *args):
1964
- """Apply first function SUBST to arguments, than FUNC."""
1965
- try:
1966
- if self.subst:
1967
- args = self.subst(*args)
1968
- return self.func(*args)
1969
- except SystemExit:
1970
- raise
1971
- except:
1972
- self.widget._report_exception()
1973
-
1974
-
1975
- class XView:
1976
- """Mix-in class for querying and changing the horizontal position
1977
- of a widget's window."""
1978
-
1979
- def xview(self, *args):
1980
- """Query and change the horizontal position of the view."""
1981
- res = self.tk.call(self._w, 'xview', *args)
1982
- if not args:
1983
- return self._getdoubles(res)
1984
-
1985
- def xview_moveto(self, fraction):
1986
- """Adjusts the view in the window so that FRACTION of the
1987
- total width of the canvas is off-screen to the left."""
1988
- self.tk.call(self._w, 'xview', 'moveto', fraction)
1989
-
1990
- def xview_scroll(self, number, what):
1991
- """Shift the x-view according to NUMBER which is measured in "units"
1992
- or "pages" (WHAT)."""
1993
- self.tk.call(self._w, 'xview', 'scroll', number, what)
1994
-
1995
-
1996
- class YView:
1997
- """Mix-in class for querying and changing the vertical position
1998
- of a widget's window."""
1999
-
2000
- def yview(self, *args):
2001
- """Query and change the vertical position of the view."""
2002
- res = self.tk.call(self._w, 'yview', *args)
2003
- if not args:
2004
- return self._getdoubles(res)
2005
-
2006
- def yview_moveto(self, fraction):
2007
- """Adjusts the view in the window so that FRACTION of the
2008
- total height of the canvas is off-screen to the top."""
2009
- self.tk.call(self._w, 'yview', 'moveto', fraction)
2010
-
2011
- def yview_scroll(self, number, what):
2012
- """Shift the y-view according to NUMBER which is measured in
2013
- "units" or "pages" (WHAT)."""
2014
- self.tk.call(self._w, 'yview', 'scroll', number, what)
2015
-
2016
-
2017
- class Wm:
2018
- """Provides functions for the communication with the window manager."""
2019
-
2020
- def wm_aspect(self,
2021
- minNumer=None, minDenom=None,
2022
- maxNumer=None, maxDenom=None):
2023
- """Instruct the window manager to set the aspect ratio (width/height)
2024
- of this widget to be between MINNUMER/MINDENOM and MAXNUMER/MAXDENOM. Return a tuple
2025
- of the actual values if no argument is given."""
2026
- return self._getints(
2027
- self.tk.call('wm', 'aspect', self._w,
2028
- minNumer, minDenom,
2029
- maxNumer, maxDenom))
2030
-
2031
- aspect = wm_aspect
2032
-
2033
- def wm_attributes(self, *args):
2034
- """This subcommand returns or sets platform specific attributes
2035
-
2036
- The first form returns a list of the platform specific flags and
2037
- their values. The second form returns the value for the specific
2038
- option. The third form sets one or more of the values. The values
2039
- are as follows:
2040
-
2041
- On Windows, -disabled gets or sets whether the window is in a
2042
- disabled state. -toolwindow gets or sets the style of the window
2043
- to toolwindow (as defined in the MSDN). -topmost gets or sets
2044
- whether this is a topmost window (displays above all other
2045
- windows).
2046
-
2047
- On Macintosh, XXXXX
2048
-
2049
- On Unix, there are currently no special attribute values.
2050
- """
2051
- args = ('wm', 'attributes', self._w) + args
2052
- return self.tk.call(args)
2053
-
2054
- attributes = wm_attributes
2055
-
2056
- def wm_client(self, name=None):
2057
- """Store NAME in WM_CLIENT_MACHINE property of this widget. Return
2058
- current value."""
2059
- return self.tk.call('wm', 'client', self._w, name)
2060
-
2061
- client = wm_client
2062
-
2063
- def wm_colormapwindows(self, *wlist):
2064
- """Store list of window names (WLIST) into WM_COLORMAPWINDOWS property
2065
- of this widget. This list contains windows whose colormaps differ from their
2066
- parents. Return current list of widgets if WLIST is empty."""
2067
- if len(wlist) > 1:
2068
- wlist = (wlist,) # Tk needs a list of windows here
2069
- args = ('wm', 'colormapwindows', self._w) + wlist
2070
- if wlist:
2071
- self.tk.call(args)
2072
- else:
2073
- return [self._nametowidget(x)
2074
- for x in self.tk.splitlist(self.tk.call(args))]
2075
-
2076
- colormapwindows = wm_colormapwindows
2077
-
2078
- def wm_command(self, value=None):
2079
- """Store VALUE in WM_COMMAND property. It is the command
2080
- which shall be used to invoke the application. Return current
2081
- command if VALUE is None."""
2082
- return self.tk.call('wm', 'command', self._w, value)
2083
-
2084
- command = wm_command
2085
-
2086
- def wm_deiconify(self):
2087
- """Deiconify this widget. If it was never mapped it will not be mapped.
2088
- On Windows it will raise this widget and give it the focus."""
2089
- return self.tk.call('wm', 'deiconify', self._w)
2090
-
2091
- deiconify = wm_deiconify
2092
-
2093
- def wm_focusmodel(self, model=None):
2094
- """Set focus model to MODEL. "active" means that this widget will claim
2095
- the focus itself, "passive" means that the window manager shall give
2096
- the focus. Return current focus model if MODEL is None."""
2097
- return self.tk.call('wm', 'focusmodel', self._w, model)
2098
-
2099
- focusmodel = wm_focusmodel
2100
-
2101
- def wm_forget(self, window): # new in Tk 8.5
2102
- """The window will be unmapped from the screen and will no longer
2103
- be managed by wm. toplevel windows will be treated like frame
2104
- windows once they are no longer managed by wm, however, the menu
2105
- option configuration will be remembered and the menus will return
2106
- once the widget is managed again."""
2107
- self.tk.call('wm', 'forget', window)
2108
-
2109
- forget = wm_forget
2110
-
2111
- def wm_frame(self):
2112
- """Return identifier for decorative frame of this widget if present."""
2113
- return self.tk.call('wm', 'frame', self._w)
2114
-
2115
- frame = wm_frame
2116
-
2117
- def wm_geometry(self, newGeometry=None):
2118
- """Set geometry to NEWGEOMETRY of the form =widthxheight+x+y. Return
2119
- current value if None is given."""
2120
- return self.tk.call('wm', 'geometry', self._w, newGeometry)
2121
-
2122
- geometry = wm_geometry
2123
-
2124
- def wm_grid(self,
2125
- baseWidth=None, baseHeight=None,
2126
- widthInc=None, heightInc=None):
2127
- """Instruct the window manager that this widget shall only be
2128
- resized on grid boundaries. WIDTHINC and HEIGHTINC are the width and
2129
- height of a grid unit in pixels. BASEWIDTH and BASEHEIGHT are the
2130
- number of grid units requested in Tk_GeometryRequest."""
2131
- return self._getints(self.tk.call(
2132
- 'wm', 'grid', self._w,
2133
- baseWidth, baseHeight, widthInc, heightInc))
2134
-
2135
- grid = wm_grid
2136
-
2137
- def wm_group(self, pathName=None):
2138
- """Set the group leader widgets for related widgets to PATHNAME. Return
2139
- the group leader of this widget if None is given."""
2140
- return self.tk.call('wm', 'group', self._w, pathName)
2141
-
2142
- group = wm_group
2143
-
2144
- def wm_iconbitmap(self, bitmap=None, default=None):
2145
- """Set bitmap for the iconified widget to BITMAP. Return
2146
- the bitmap if None is given.
2147
-
2148
- Under Windows, the DEFAULT parameter can be used to set the icon
2149
- for the widget and any descendants that don't have an icon set
2150
- explicitly. DEFAULT can be the relative path to a .ico file
2151
- (example: root.iconbitmap(default='myicon.ico') ). See Tk
2152
- documentation for more information."""
2153
- if default is not None:
2154
- return self.tk.call('wm', 'iconbitmap', self._w, '-default', default)
2155
- else:
2156
- return self.tk.call('wm', 'iconbitmap', self._w, bitmap)
2157
-
2158
- iconbitmap = wm_iconbitmap
2159
-
2160
- def wm_iconify(self):
2161
- """Display widget as icon."""
2162
- return self.tk.call('wm', 'iconify', self._w)
2163
-
2164
- iconify = wm_iconify
2165
-
2166
- def wm_iconmask(self, bitmap=None):
2167
- """Set mask for the icon bitmap of this widget. Return the
2168
- mask if None is given."""
2169
- return self.tk.call('wm', 'iconmask', self._w, bitmap)
2170
-
2171
- iconmask = wm_iconmask
2172
-
2173
- def wm_iconname(self, newName=None):
2174
- """Set the name of the icon for this widget. Return the name if
2175
- None is given."""
2176
- return self.tk.call('wm', 'iconname', self._w, newName)
2177
-
2178
- iconname = wm_iconname
2179
-
2180
- def wm_iconphoto(self, default=False, *args): # new in Tk 8.5
2181
- """Sets the titlebar icon for this window based on the named photo
2182
- images passed through args. If default is True, this is applied to
2183
- all future created toplevels as well.
2184
-
2185
- The data in the images is taken as a snapshot at the time of
2186
- invocation. If the images are later changed, this is not reflected
2187
- to the titlebar icons. Multiple images are accepted to allow
2188
- different images sizes to be provided. The window manager may scale
2189
- provided icons to an appropriate size.
2190
-
2191
- On Windows, the images are packed into a Windows icon structure.
2192
- This will override an icon specified to wm_iconbitmap, and vice
2193
- versa.
2194
-
2195
- On X, the images are arranged into the _NET_WM_ICON X property,
2196
- which most modern window managers support. An icon specified by
2197
- wm_iconbitmap may exist simultaneously.
2198
-
2199
- On Macintosh, this currently does nothing."""
2200
- if default:
2201
- self.tk.call('wm', 'iconphoto', self._w, "-default", *args)
2202
- else:
2203
- self.tk.call('wm', 'iconphoto', self._w, *args)
2204
-
2205
- iconphoto = wm_iconphoto
2206
-
2207
- def wm_iconposition(self, x=None, y=None):
2208
- """Set the position of the icon of this widget to X and Y. Return
2209
- a tuple of the current values of X and X if None is given."""
2210
- return self._getints(self.tk.call(
2211
- 'wm', 'iconposition', self._w, x, y))
2212
-
2213
- iconposition = wm_iconposition
2214
-
2215
- def wm_iconwindow(self, pathName=None):
2216
- """Set widget PATHNAME to be displayed instead of icon. Return the current
2217
- value if None is given."""
2218
- return self.tk.call('wm', 'iconwindow', self._w, pathName)
2219
-
2220
- iconwindow = wm_iconwindow
2221
-
2222
- def wm_manage(self, widget): # new in Tk 8.5
2223
- """The widget specified will become a stand alone top-level window.
2224
- The window will be decorated with the window managers title bar,
2225
- etc."""
2226
- self.tk.call('wm', 'manage', widget)
2227
-
2228
- manage = wm_manage
2229
-
2230
- def wm_maxsize(self, width=None, height=None):
2231
- """Set max WIDTH and HEIGHT for this widget. If the window is gridded
2232
- the values are given in grid units. Return the current values if None
2233
- is given."""
2234
- return self._getints(self.tk.call(
2235
- 'wm', 'maxsize', self._w, width, height))
2236
-
2237
- maxsize = wm_maxsize
2238
-
2239
- def wm_minsize(self, width=None, height=None):
2240
- """Set min WIDTH and HEIGHT for this widget. If the window is gridded
2241
- the values are given in grid units. Return the current values if None
2242
- is given."""
2243
- return self._getints(self.tk.call(
2244
- 'wm', 'minsize', self._w, width, height))
2245
-
2246
- minsize = wm_minsize
2247
-
2248
- def wm_overrideredirect(self, boolean=None):
2249
- """Instruct the window manager to ignore this widget
2250
- if BOOLEAN is given with 1. Return the current value if None
2251
- is given."""
2252
- return self._getboolean(self.tk.call(
2253
- 'wm', 'overrideredirect', self._w, boolean))
2254
-
2255
- overrideredirect = wm_overrideredirect
2256
-
2257
- def wm_positionfrom(self, who=None):
2258
- """Instruct the window manager that the position of this widget shall
2259
- be defined by the user if WHO is "user", and by its own policy if WHO is
2260
- "program"."""
2261
- return self.tk.call('wm', 'positionfrom', self._w, who)
2262
-
2263
- positionfrom = wm_positionfrom
2264
-
2265
- def wm_protocol(self, name=None, func=None):
2266
- """Bind function FUNC to command NAME for this widget.
2267
- Return the function bound to NAME if None is given. NAME could be
2268
- e.g. "WM_SAVE_YOURSELF" or "WM_DELETE_WINDOW"."""
2269
- if callable(func):
2270
- command = self._register(func)
2271
- else:
2272
- command = func
2273
- return self.tk.call(
2274
- 'wm', 'protocol', self._w, name, command)
2275
-
2276
- protocol = wm_protocol
2277
-
2278
- def wm_resizable(self, width=None, height=None):
2279
- """Instruct the window manager whether this width can be resized
2280
- in WIDTH or HEIGHT. Both values are boolean values."""
2281
- return self.tk.call('wm', 'resizable', self._w, width, height)
2282
-
2283
- resizable = wm_resizable
2284
-
2285
- def wm_sizefrom(self, who=None):
2286
- """Instruct the window manager that the size of this widget shall
2287
- be defined by the user if WHO is "user", and by its own policy if WHO is
2288
- "program"."""
2289
- return self.tk.call('wm', 'sizefrom', self._w, who)
2290
-
2291
- sizefrom = wm_sizefrom
2292
-
2293
- def wm_state(self, newstate=None):
2294
- """Query or set the state of this widget as one of normal, icon,
2295
- iconic (see wm_iconwindow), withdrawn, or zoomed (Windows only)."""
2296
- return self.tk.call('wm', 'state', self._w, newstate)
2297
-
2298
- state = wm_state
2299
-
2300
- def wm_title(self, string=None):
2301
- """Set the title of this widget."""
2302
- return self.tk.call('wm', 'title', self._w, string)
2303
-
2304
- title = wm_title
2305
-
2306
- def wm_transient(self, master=None):
2307
- """Instruct the window manager that this widget is transient
2308
- with regard to widget MASTER."""
2309
- return self.tk.call('wm', 'transient', self._w, master)
2310
-
2311
- transient = wm_transient
2312
-
2313
- def wm_withdraw(self):
2314
- """Withdraw this widget from the screen such that it is unmapped
2315
- and forgotten by the window manager. Re-draw it with wm_deiconify."""
2316
- return self.tk.call('wm', 'withdraw', self._w)
2317
-
2318
- withdraw = wm_withdraw
2319
-
2320
-
2321
- class Tk(Misc, Wm):
2322
- """Toplevel widget of Tk which represents mostly the main window
2323
- of an application. It has an associated Tcl interpreter."""
2324
- _w = '.'
2325
-
2326
- def __init__(self, screenName=None, baseName=None, className='Tk',
2327
- useTk=True, sync=False, use=None):
2328
- """Return a new top level widget on screen SCREENNAME. A new Tcl interpreter will
2329
- be created. BASENAME will be used for the identification of the profile file (see
2330
- readprofile).
2331
- It is constructed from sys.argv[0] without extensions if None is given. CLASSNAME
2332
- is the name of the widget class."""
2333
- self.master = None
2334
- self.children = {}
2335
- self._tkloaded = False
2336
- # to avoid recursions in the getattr code in case of failure, we
2337
- # ensure that self.tk is always _something_.
2338
- self.tk = None
2339
- if baseName is None:
2340
- import os
2341
- baseName = os.path.basename(sys.argv[0])
2342
- baseName, ext = os.path.splitext(baseName)
2343
- if ext not in ('.py', '.pyc'):
2344
- baseName = baseName + ext
2345
- interactive = False
2346
- self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
2347
- if _debug:
2348
- self.tk.settrace(_print_command)
2349
- if useTk:
2350
- self._loadtk()
2351
- if not sys.flags.ignore_environment:
2352
- # Issue #16248: Honor the -E flag to avoid code injection.
2353
- self.readprofile(baseName, className)
2354
-
2355
- def loadtk(self):
2356
- if not self._tkloaded:
2357
- self.tk.loadtk()
2358
- self._loadtk()
2359
-
2360
- def _loadtk(self):
2361
- self._tkloaded = True
2362
- global _default_root
2363
- # Version sanity checks
2364
- tk_version = self.tk.getvar('tk_version')
2365
- if tk_version != _tkinter.TK_VERSION:
2366
- raise RuntimeError("tk.h version (%s) doesn't match libtk.a version (%s)"
2367
- % (_tkinter.TK_VERSION, tk_version))
2368
- # Under unknown circumstances, tcl_version gets coerced to float
2369
- tcl_version = str(self.tk.getvar('tcl_version'))
2370
- if tcl_version != _tkinter.TCL_VERSION:
2371
- raise RuntimeError("tcl.h version (%s) doesn't match libtcl.a version (%s)" \
2372
- % (_tkinter.TCL_VERSION, tcl_version))
2373
- # Create and register the tkerror and exit commands
2374
- # We need to inline parts of _register here, _ register
2375
- # would register differently-named commands.
2376
- if self._tclCommands is None:
2377
- self._tclCommands = []
2378
- self.tk.createcommand('tkerror', _tkerror)
2379
- self.tk.createcommand('exit', _exit)
2380
- self._tclCommands.append('tkerror')
2381
- self._tclCommands.append('exit')
2382
- if _support_default_root and _default_root is None:
2383
- _default_root = self
2384
- self.protocol("WM_DELETE_WINDOW", self.destroy)
2385
-
2386
- def destroy(self):
2387
- """Destroy this and all descendants widgets. This will
2388
- end the application of this Tcl interpreter."""
2389
- for c in list(self.children.values()): c.destroy()
2390
- self.tk.call('destroy', self._w)
2391
- Misc.destroy(self)
2392
- global _default_root
2393
- if _support_default_root and _default_root is self:
2394
- _default_root = None
2395
-
2396
- def readprofile(self, baseName, className):
2397
- """Internal function. It reads .BASENAME.tcl and .CLASSNAME.tcl into
2398
- the Tcl Interpreter and calls exec on the contents of .BASENAME.py and
2399
- .CLASSNAME.py if such a file exists in the home directory."""
2400
- import os
2401
- if 'HOME' in os.environ: home = os.environ['HOME']
2402
- else: home = os.curdir
2403
- class_tcl = os.path.join(home, '.%s.tcl' % className)
2404
- class_py = os.path.join(home, '.%s.py' % className)
2405
- base_tcl = os.path.join(home, '.%s.tcl' % baseName)
2406
- base_py = os.path.join(home, '.%s.py' % baseName)
2407
- dir = {'self': self}
2408
- exec('from tkinter import *', dir)
2409
- if os.path.isfile(class_tcl):
2410
- self.tk.call('source', class_tcl)
2411
- if os.path.isfile(class_py):
2412
- exec(open(class_py).read(), dir)
2413
- if os.path.isfile(base_tcl):
2414
- self.tk.call('source', base_tcl)
2415
- if os.path.isfile(base_py):
2416
- exec(open(base_py).read(), dir)
2417
-
2418
- def report_callback_exception(self, exc, val, tb):
2419
- """Report callback exception on sys.stderr.
2420
-
2421
- Applications may want to override this internal function, and
2422
- should when sys.stderr is None."""
2423
- import traceback
2424
- print("Exception in Tkinter callback", file=sys.stderr)
2425
- sys.last_exc = val
2426
- sys.last_type = exc
2427
- sys.last_value = val
2428
- sys.last_traceback = tb
2429
- traceback.print_exception(exc, val, tb)
2430
-
2431
- def __getattr__(self, attr):
2432
- "Delegate attribute access to the interpreter object"
2433
- return getattr(self.tk, attr)
2434
-
2435
-
2436
- def _print_command(cmd, *, file=sys.stderr):
2437
- # Print executed Tcl/Tk commands.
2438
- assert isinstance(cmd, tuple)
2439
- cmd = _join(cmd)
2440
- print(cmd, file=file)
2441
-
2442
-
2443
- # Ideally, the classes Pack, Place and Grid disappear, the
2444
- # pack/place/grid methods are defined on the Widget class, and
2445
- # everybody uses w.pack_whatever(...) instead of Pack.whatever(w,
2446
- # ...), with pack(), place() and grid() being short for
2447
- # pack_configure(), place_configure() and grid_columnconfigure(), and
2448
- # forget() being short for pack_forget(). As a practical matter, I'm
2449
- # afraid that there is too much code out there that may be using the
2450
- # Pack, Place or Grid class, so I leave them intact -- but only as
2451
- # backwards compatibility features. Also note that those methods that
2452
- # take a master as argument (e.g. pack_propagate) have been moved to
2453
- # the Misc class (which now incorporates all methods common between
2454
- # toplevel and interior widgets). Again, for compatibility, these are
2455
- # copied into the Pack, Place or Grid class.
2456
-
2457
-
2458
- def Tcl(screenName=None, baseName=None, className='Tk', useTk=False):
2459
- return Tk(screenName, baseName, className, useTk)
2460
-
2461
-
2462
- class Pack:
2463
- """Geometry manager Pack.
2464
-
2465
- Base class to use the methods pack_* in every widget."""
2466
-
2467
- def pack_configure(self, cnf={}, **kw):
2468
- """Pack a widget in the parent widget. Use as options:
2469
- after=widget - pack it after you have packed widget
2470
- anchor=NSEW (or subset) - position widget according to
2471
- given direction
2472
- before=widget - pack it before you will pack widget
2473
- expand=bool - expand widget if parent size grows
2474
- fill=NONE or X or Y or BOTH - fill widget if widget grows
2475
- in=master - use master to contain this widget
2476
- in_=master - see 'in' option description
2477
- ipadx=amount - add internal padding in x direction
2478
- ipady=amount - add internal padding in y direction
2479
- padx=amount - add padding in x direction
2480
- pady=amount - add padding in y direction
2481
- side=TOP or BOTTOM or LEFT or RIGHT - where to add this widget.
2482
- """
2483
- self.tk.call(
2484
- ('pack', 'configure', self._w)
2485
- + self._options(cnf, kw))
2486
-
2487
- pack = configure = config = pack_configure
2488
-
2489
- def pack_forget(self):
2490
- """Unmap this widget and do not use it for the packing order."""
2491
- self.tk.call('pack', 'forget', self._w)
2492
-
2493
- forget = pack_forget
2494
-
2495
- def pack_info(self):
2496
- """Return information about the packing options
2497
- for this widget."""
2498
- d = _splitdict(self.tk, self.tk.call('pack', 'info', self._w))
2499
- if 'in' in d:
2500
- d['in'] = self.nametowidget(d['in'])
2501
- return d
2502
-
2503
- info = pack_info
2504
- propagate = pack_propagate = Misc.pack_propagate
2505
- slaves = pack_slaves = Misc.pack_slaves
2506
-
2507
-
2508
- class Place:
2509
- """Geometry manager Place.
2510
-
2511
- Base class to use the methods place_* in every widget."""
2512
-
2513
- def place_configure(self, cnf={}, **kw):
2514
- """Place a widget in the parent widget. Use as options:
2515
- in=master - master relative to which the widget is placed
2516
- in_=master - see 'in' option description
2517
- x=amount - locate anchor of this widget at position x of master
2518
- y=amount - locate anchor of this widget at position y of master
2519
- relx=amount - locate anchor of this widget between 0.0 and 1.0
2520
- relative to width of master (1.0 is right edge)
2521
- rely=amount - locate anchor of this widget between 0.0 and 1.0
2522
- relative to height of master (1.0 is bottom edge)
2523
- anchor=NSEW (or subset) - position anchor according to given direction
2524
- width=amount - width of this widget in pixel
2525
- height=amount - height of this widget in pixel
2526
- relwidth=amount - width of this widget between 0.0 and 1.0
2527
- relative to width of master (1.0 is the same width
2528
- as the master)
2529
- relheight=amount - height of this widget between 0.0 and 1.0
2530
- relative to height of master (1.0 is the same
2531
- height as the master)
2532
- bordermode="inside" or "outside" - whether to take border width of
2533
- master widget into account
2534
- """
2535
- self.tk.call(
2536
- ('place', 'configure', self._w)
2537
- + self._options(cnf, kw))
2538
-
2539
- place = configure = config = place_configure
2540
-
2541
- def place_forget(self):
2542
- """Unmap this widget."""
2543
- self.tk.call('place', 'forget', self._w)
2544
-
2545
- forget = place_forget
2546
-
2547
- def place_info(self):
2548
- """Return information about the placing options
2549
- for this widget."""
2550
- d = _splitdict(self.tk, self.tk.call('place', 'info', self._w))
2551
- if 'in' in d:
2552
- d['in'] = self.nametowidget(d['in'])
2553
- return d
2554
-
2555
- info = place_info
2556
- slaves = place_slaves = Misc.place_slaves
2557
-
2558
-
2559
- class Grid:
2560
- """Geometry manager Grid.
2561
-
2562
- Base class to use the methods grid_* in every widget."""
2563
- # Thanks to Masazumi Yoshikawa (yosikawa@isi.edu)
2564
-
2565
- def grid_configure(self, cnf={}, **kw):
2566
- """Position a widget in the parent widget in a grid. Use as options:
2567
- column=number - use cell identified with given column (starting with 0)
2568
- columnspan=number - this widget will span several columns
2569
- in=master - use master to contain this widget
2570
- in_=master - see 'in' option description
2571
- ipadx=amount - add internal padding in x direction
2572
- ipady=amount - add internal padding in y direction
2573
- padx=amount - add padding in x direction
2574
- pady=amount - add padding in y direction
2575
- row=number - use cell identified with given row (starting with 0)
2576
- rowspan=number - this widget will span several rows
2577
- sticky=NSEW - if cell is larger on which sides will this
2578
- widget stick to the cell boundary
2579
- """
2580
- self.tk.call(
2581
- ('grid', 'configure', self._w)
2582
- + self._options(cnf, kw))
2583
-
2584
- grid = configure = config = grid_configure
2585
- bbox = grid_bbox = Misc.grid_bbox
2586
- columnconfigure = grid_columnconfigure = Misc.grid_columnconfigure
2587
-
2588
- def grid_forget(self):
2589
- """Unmap this widget."""
2590
- self.tk.call('grid', 'forget', self._w)
2591
-
2592
- forget = grid_forget
2593
-
2594
- def grid_remove(self):
2595
- """Unmap this widget but remember the grid options."""
2596
- self.tk.call('grid', 'remove', self._w)
2597
-
2598
- def grid_info(self):
2599
- """Return information about the options
2600
- for positioning this widget in a grid."""
2601
- d = _splitdict(self.tk, self.tk.call('grid', 'info', self._w))
2602
- if 'in' in d:
2603
- d['in'] = self.nametowidget(d['in'])
2604
- return d
2605
-
2606
- info = grid_info
2607
- location = grid_location = Misc.grid_location
2608
- propagate = grid_propagate = Misc.grid_propagate
2609
- rowconfigure = grid_rowconfigure = Misc.grid_rowconfigure
2610
- size = grid_size = Misc.grid_size
2611
- slaves = grid_slaves = Misc.grid_slaves
2612
-
2613
-
2614
- class BaseWidget(Misc):
2615
- """Internal class."""
2616
-
2617
- def _setup(self, master, cnf):
2618
- """Internal function. Sets up information about children."""
2619
- if master is None:
2620
- master = _get_default_root()
2621
- self.master = master
2622
- self.tk = master.tk
2623
- name = None
2624
- if 'name' in cnf:
2625
- name = cnf['name']
2626
- del cnf['name']
2627
- if not name:
2628
- name = self.__class__.__name__.lower()
2629
- if name[-1].isdigit():
2630
- name += "!" # Avoid duplication when calculating names below
2631
- if master._last_child_ids is None:
2632
- master._last_child_ids = {}
2633
- count = master._last_child_ids.get(name, 0) + 1
2634
- master._last_child_ids[name] = count
2635
- if count == 1:
2636
- name = '!%s' % (name,)
2637
- else:
2638
- name = '!%s%d' % (name, count)
2639
- self._name = name
2640
- if master._w=='.':
2641
- self._w = '.' + name
2642
- else:
2643
- self._w = master._w + '.' + name
2644
- self.children = {}
2645
- if self._name in self.master.children:
2646
- self.master.children[self._name].destroy()
2647
- self.master.children[self._name] = self
2648
-
2649
- def __init__(self, master, widgetName, cnf={}, kw={}, extra=()):
2650
- """Construct a widget with the parent widget MASTER, a name WIDGETNAME
2651
- and appropriate options."""
2652
- if kw:
2653
- cnf = _cnfmerge((cnf, kw))
2654
- self.widgetName = widgetName
2655
- self._setup(master, cnf)
2656
- if self._tclCommands is None:
2657
- self._tclCommands = []
2658
- classes = [(k, v) for k, v in cnf.items() if isinstance(k, type)]
2659
- for k, v in classes:
2660
- del cnf[k]
2661
- self.tk.call(
2662
- (widgetName, self._w) + extra + self._options(cnf))
2663
- for k, v in classes:
2664
- k.configure(self, v)
2665
-
2666
- def destroy(self):
2667
- """Destroy this and all descendants widgets."""
2668
- for c in list(self.children.values()): c.destroy()
2669
- self.tk.call('destroy', self._w)
2670
- if self._name in self.master.children:
2671
- del self.master.children[self._name]
2672
- Misc.destroy(self)
2673
-
2674
- def _do(self, name, args=()):
2675
- # XXX Obsolete -- better use self.tk.call directly!
2676
- return self.tk.call((self._w, name) + args)
2677
-
2678
-
2679
- class Widget(BaseWidget, Pack, Place, Grid):
2680
- """Internal class.
2681
-
2682
- Base class for a widget which can be positioned with the geometry managers
2683
- Pack, Place or Grid."""
2684
- pass
2685
-
2686
-
2687
- class Toplevel(BaseWidget, Wm):
2688
- """Toplevel widget, e.g. for dialogs."""
2689
-
2690
- def __init__(self, master=None, cnf={}, **kw):
2691
- """Construct a toplevel widget with the parent MASTER.
2692
-
2693
- Valid resource names: background, bd, bg, borderwidth, class,
2694
- colormap, container, cursor, height, highlightbackground,
2695
- highlightcolor, highlightthickness, menu, relief, screen, takefocus,
2696
- use, visual, width."""
2697
- if kw:
2698
- cnf = _cnfmerge((cnf, kw))
2699
- extra = ()
2700
- for wmkey in ['screen', 'class_', 'class', 'visual',
2701
- 'colormap']:
2702
- if wmkey in cnf:
2703
- val = cnf[wmkey]
2704
- # TBD: a hack needed because some keys
2705
- # are not valid as keyword arguments
2706
- if wmkey[-1] == '_': opt = '-'+wmkey[:-1]
2707
- else: opt = '-'+wmkey
2708
- extra = extra + (opt, val)
2709
- del cnf[wmkey]
2710
- BaseWidget.__init__(self, master, 'toplevel', cnf, {}, extra)
2711
- root = self._root()
2712
- self.iconname(root.iconname())
2713
- self.title(root.title())
2714
- self.protocol("WM_DELETE_WINDOW", self.destroy)
2715
-
2716
-
2717
- class Button(Widget):
2718
- """Button widget."""
2719
-
2720
- def __init__(self, master=None, cnf={}, **kw):
2721
- """Construct a button widget with the parent MASTER.
2722
-
2723
- STANDARD OPTIONS
2724
-
2725
- activebackground, activeforeground, anchor,
2726
- background, bitmap, borderwidth, cursor,
2727
- disabledforeground, font, foreground
2728
- highlightbackground, highlightcolor,
2729
- highlightthickness, image, justify,
2730
- padx, pady, relief, repeatdelay,
2731
- repeatinterval, takefocus, text,
2732
- textvariable, underline, wraplength
2733
-
2734
- WIDGET-SPECIFIC OPTIONS
2735
-
2736
- command, compound, default, height,
2737
- overrelief, state, width
2738
- """
2739
- Widget.__init__(self, master, 'button', cnf, kw)
2740
-
2741
- def flash(self):
2742
- """Flash the button.
2743
-
2744
- This is accomplished by redisplaying
2745
- the button several times, alternating between active and
2746
- normal colors. At the end of the flash the button is left
2747
- in the same normal/active state as when the command was
2748
- invoked. This command is ignored if the button's state is
2749
- disabled.
2750
- """
2751
- self.tk.call(self._w, 'flash')
2752
-
2753
- def invoke(self):
2754
- """Invoke the command associated with the button.
2755
-
2756
- The return value is the return value from the command,
2757
- or an empty string if there is no command associated with
2758
- the button. This command is ignored if the button's state
2759
- is disabled.
2760
- """
2761
- return self.tk.call(self._w, 'invoke')
2762
-
2763
-
2764
- class Canvas(Widget, XView, YView):
2765
- """Canvas widget to display graphical elements like lines or text."""
2766
-
2767
- def __init__(self, master=None, cnf={}, **kw):
2768
- """Construct a canvas widget with the parent MASTER.
2769
-
2770
- Valid resource names: background, bd, bg, borderwidth, closeenough,
2771
- confine, cursor, height, highlightbackground, highlightcolor,
2772
- highlightthickness, insertbackground, insertborderwidth,
2773
- insertofftime, insertontime, insertwidth, offset, relief,
2774
- scrollregion, selectbackground, selectborderwidth, selectforeground,
2775
- state, takefocus, width, xscrollcommand, xscrollincrement,
2776
- yscrollcommand, yscrollincrement."""
2777
- Widget.__init__(self, master, 'canvas', cnf, kw)
2778
-
2779
- def addtag(self, *args):
2780
- """Internal function."""
2781
- self.tk.call((self._w, 'addtag') + args)
2782
-
2783
- def addtag_above(self, newtag, tagOrId):
2784
- """Add tag NEWTAG to all items above TAGORID."""
2785
- self.addtag(newtag, 'above', tagOrId)
2786
-
2787
- def addtag_all(self, newtag):
2788
- """Add tag NEWTAG to all items."""
2789
- self.addtag(newtag, 'all')
2790
-
2791
- def addtag_below(self, newtag, tagOrId):
2792
- """Add tag NEWTAG to all items below TAGORID."""
2793
- self.addtag(newtag, 'below', tagOrId)
2794
-
2795
- def addtag_closest(self, newtag, x, y, halo=None, start=None):
2796
- """Add tag NEWTAG to item which is closest to pixel at X, Y.
2797
- If several match take the top-most.
2798
- All items closer than HALO are considered overlapping (all are
2799
- closest). If START is specified the next below this tag is taken."""
2800
- self.addtag(newtag, 'closest', x, y, halo, start)
2801
-
2802
- def addtag_enclosed(self, newtag, x1, y1, x2, y2):
2803
- """Add tag NEWTAG to all items in the rectangle defined
2804
- by X1,Y1,X2,Y2."""
2805
- self.addtag(newtag, 'enclosed', x1, y1, x2, y2)
2806
-
2807
- def addtag_overlapping(self, newtag, x1, y1, x2, y2):
2808
- """Add tag NEWTAG to all items which overlap the rectangle
2809
- defined by X1,Y1,X2,Y2."""
2810
- self.addtag(newtag, 'overlapping', x1, y1, x2, y2)
2811
-
2812
- def addtag_withtag(self, newtag, tagOrId):
2813
- """Add tag NEWTAG to all items with TAGORID."""
2814
- self.addtag(newtag, 'withtag', tagOrId)
2815
-
2816
- def bbox(self, *args):
2817
- """Return a tuple of X1,Y1,X2,Y2 coordinates for a rectangle
2818
- which encloses all items with tags specified as arguments."""
2819
- return self._getints(
2820
- self.tk.call((self._w, 'bbox') + args)) or None
2821
-
2822
- def tag_unbind(self, tagOrId, sequence, funcid=None):
2823
- """Unbind for all items with TAGORID for event SEQUENCE the
2824
- function identified with FUNCID."""
2825
- self._unbind((self._w, 'bind', tagOrId, sequence), funcid)
2826
-
2827
- def tag_bind(self, tagOrId, sequence=None, func=None, add=None):
2828
- """Bind to all items with TAGORID at event SEQUENCE a call to function FUNC.
2829
-
2830
- An additional boolean parameter ADD specifies whether FUNC will be
2831
- called additionally to the other bound function or whether it will
2832
- replace the previous function. See bind for the return value."""
2833
- return self._bind((self._w, 'bind', tagOrId),
2834
- sequence, func, add)
2835
-
2836
- def canvasx(self, screenx, gridspacing=None):
2837
- """Return the canvas x coordinate of pixel position SCREENX rounded
2838
- to nearest multiple of GRIDSPACING units."""
2839
- return self.tk.getdouble(self.tk.call(
2840
- self._w, 'canvasx', screenx, gridspacing))
2841
-
2842
- def canvasy(self, screeny, gridspacing=None):
2843
- """Return the canvas y coordinate of pixel position SCREENY rounded
2844
- to nearest multiple of GRIDSPACING units."""
2845
- return self.tk.getdouble(self.tk.call(
2846
- self._w, 'canvasy', screeny, gridspacing))
2847
-
2848
- def coords(self, *args):
2849
- """Return a list of coordinates for the item given in ARGS."""
2850
- args = _flatten(args)
2851
- return [self.tk.getdouble(x) for x in
2852
- self.tk.splitlist(
2853
- self.tk.call((self._w, 'coords') + args))]
2854
-
2855
- def _create(self, itemType, args, kw): # Args: (val, val, ..., cnf={})
2856
- """Internal function."""
2857
- args = _flatten(args)
2858
- cnf = args[-1]
2859
- if isinstance(cnf, (dict, tuple)):
2860
- args = args[:-1]
2861
- else:
2862
- cnf = {}
2863
- return self.tk.getint(self.tk.call(
2864
- self._w, 'create', itemType,
2865
- *(args + self._options(cnf, kw))))
2866
-
2867
- def create_arc(self, *args, **kw):
2868
- """Create arc shaped region with coordinates x1,y1,x2,y2."""
2869
- return self._create('arc', args, kw)
2870
-
2871
- def create_bitmap(self, *args, **kw):
2872
- """Create bitmap with coordinates x1,y1."""
2873
- return self._create('bitmap', args, kw)
2874
-
2875
- def create_image(self, *args, **kw):
2876
- """Create image item with coordinates x1,y1."""
2877
- return self._create('image', args, kw)
2878
-
2879
- def create_line(self, *args, **kw):
2880
- """Create line with coordinates x1,y1,...,xn,yn."""
2881
- return self._create('line', args, kw)
2882
-
2883
- def create_oval(self, *args, **kw):
2884
- """Create oval with coordinates x1,y1,x2,y2."""
2885
- return self._create('oval', args, kw)
2886
-
2887
- def create_polygon(self, *args, **kw):
2888
- """Create polygon with coordinates x1,y1,...,xn,yn."""
2889
- return self._create('polygon', args, kw)
2890
-
2891
- def create_rectangle(self, *args, **kw):
2892
- """Create rectangle with coordinates x1,y1,x2,y2."""
2893
- return self._create('rectangle', args, kw)
2894
-
2895
- def create_text(self, *args, **kw):
2896
- """Create text with coordinates x1,y1."""
2897
- return self._create('text', args, kw)
2898
-
2899
- def create_window(self, *args, **kw):
2900
- """Create window with coordinates x1,y1,x2,y2."""
2901
- return self._create('window', args, kw)
2902
-
2903
- def dchars(self, *args):
2904
- """Delete characters of text items identified by tag or id in ARGS (possibly
2905
- several times) from FIRST to LAST character (including)."""
2906
- self.tk.call((self._w, 'dchars') + args)
2907
-
2908
- def delete(self, *args):
2909
- """Delete items identified by all tag or ids contained in ARGS."""
2910
- self.tk.call((self._w, 'delete') + args)
2911
-
2912
- def dtag(self, *args):
2913
- """Delete tag or id given as last arguments in ARGS from items
2914
- identified by first argument in ARGS."""
2915
- self.tk.call((self._w, 'dtag') + args)
2916
-
2917
- def find(self, *args):
2918
- """Internal function."""
2919
- return self._getints(
2920
- self.tk.call((self._w, 'find') + args)) or ()
2921
-
2922
- def find_above(self, tagOrId):
2923
- """Return items above TAGORID."""
2924
- return self.find('above', tagOrId)
2925
-
2926
- def find_all(self):
2927
- """Return all items."""
2928
- return self.find('all')
2929
-
2930
- def find_below(self, tagOrId):
2931
- """Return all items below TAGORID."""
2932
- return self.find('below', tagOrId)
2933
-
2934
- def find_closest(self, x, y, halo=None, start=None):
2935
- """Return item which is closest to pixel at X, Y.
2936
- If several match take the top-most.
2937
- All items closer than HALO are considered overlapping (all are
2938
- closest). If START is specified the next below this tag is taken."""
2939
- return self.find('closest', x, y, halo, start)
2940
-
2941
- def find_enclosed(self, x1, y1, x2, y2):
2942
- """Return all items in rectangle defined
2943
- by X1,Y1,X2,Y2."""
2944
- return self.find('enclosed', x1, y1, x2, y2)
2945
-
2946
- def find_overlapping(self, x1, y1, x2, y2):
2947
- """Return all items which overlap the rectangle
2948
- defined by X1,Y1,X2,Y2."""
2949
- return self.find('overlapping', x1, y1, x2, y2)
2950
-
2951
- def find_withtag(self, tagOrId):
2952
- """Return all items with TAGORID."""
2953
- return self.find('withtag', tagOrId)
2954
-
2955
- def focus(self, *args):
2956
- """Set focus to the first item specified in ARGS."""
2957
- return self.tk.call((self._w, 'focus') + args)
2958
-
2959
- def gettags(self, *args):
2960
- """Return tags associated with the first item specified in ARGS."""
2961
- return self.tk.splitlist(
2962
- self.tk.call((self._w, 'gettags') + args))
2963
-
2964
- def icursor(self, *args):
2965
- """Set cursor at position POS in the item identified by TAGORID.
2966
- In ARGS TAGORID must be first."""
2967
- self.tk.call((self._w, 'icursor') + args)
2968
-
2969
- def index(self, *args):
2970
- """Return position of cursor as integer in item specified in ARGS."""
2971
- return self.tk.getint(self.tk.call((self._w, 'index') + args))
2972
-
2973
- def insert(self, *args):
2974
- """Insert TEXT in item TAGORID at position POS. ARGS must
2975
- be TAGORID POS TEXT."""
2976
- self.tk.call((self._w, 'insert') + args)
2977
-
2978
- def itemcget(self, tagOrId, option):
2979
- """Return the resource value for an OPTION for item TAGORID."""
2980
- return self.tk.call(
2981
- (self._w, 'itemcget') + (tagOrId, '-'+option))
2982
-
2983
- def itemconfigure(self, tagOrId, cnf=None, **kw):
2984
- """Configure resources of an item TAGORID.
2985
-
2986
- The values for resources are specified as keyword
2987
- arguments. To get an overview about
2988
- the allowed keyword arguments call the method without arguments.
2989
- """
2990
- return self._configure(('itemconfigure', tagOrId), cnf, kw)
2991
-
2992
- itemconfig = itemconfigure
2993
-
2994
- # lower, tkraise/lift hide Misc.lower, Misc.tkraise/lift,
2995
- # so the preferred name for them is tag_lower, tag_raise
2996
- # (similar to tag_bind, and similar to the Text widget);
2997
- # unfortunately can't delete the old ones yet (maybe in 1.6)
2998
- def tag_lower(self, *args):
2999
- """Lower an item TAGORID given in ARGS
3000
- (optional below another item)."""
3001
- self.tk.call((self._w, 'lower') + args)
3002
-
3003
- lower = tag_lower
3004
-
3005
- def move(self, *args):
3006
- """Move an item TAGORID given in ARGS."""
3007
- self.tk.call((self._w, 'move') + args)
3008
-
3009
- def moveto(self, tagOrId, x='', y=''):
3010
- """Move the items given by TAGORID in the canvas coordinate
3011
- space so that the first coordinate pair of the bottommost
3012
- item with tag TAGORID is located at position (X,Y).
3013
- X and Y may be the empty string, in which case the
3014
- corresponding coordinate will be unchanged. All items matching
3015
- TAGORID remain in the same positions relative to each other."""
3016
- self.tk.call(self._w, 'moveto', tagOrId, x, y)
3017
-
3018
- def postscript(self, cnf={}, **kw):
3019
- """Print the contents of the canvas to a postscript
3020
- file. Valid options: colormap, colormode, file, fontmap,
3021
- height, pageanchor, pageheight, pagewidth, pagex, pagey,
3022
- rotate, width, x, y."""
3023
- return self.tk.call((self._w, 'postscript') +
3024
- self._options(cnf, kw))
3025
-
3026
- def tag_raise(self, *args):
3027
- """Raise an item TAGORID given in ARGS
3028
- (optional above another item)."""
3029
- self.tk.call((self._w, 'raise') + args)
3030
-
3031
- lift = tkraise = tag_raise
3032
-
3033
- def scale(self, *args):
3034
- """Scale item TAGORID with XORIGIN, YORIGIN, XSCALE, YSCALE."""
3035
- self.tk.call((self._w, 'scale') + args)
3036
-
3037
- def scan_mark(self, x, y):
3038
- """Remember the current X, Y coordinates."""
3039
- self.tk.call(self._w, 'scan', 'mark', x, y)
3040
-
3041
- def scan_dragto(self, x, y, gain=10):
3042
- """Adjust the view of the canvas to GAIN times the
3043
- difference between X and Y and the coordinates given in
3044
- scan_mark."""
3045
- self.tk.call(self._w, 'scan', 'dragto', x, y, gain)
3046
-
3047
- def select_adjust(self, tagOrId, index):
3048
- """Adjust the end of the selection near the cursor of an item TAGORID to index."""
3049
- self.tk.call(self._w, 'select', 'adjust', tagOrId, index)
3050
-
3051
- def select_clear(self):
3052
- """Clear the selection if it is in this widget."""
3053
- self.tk.call(self._w, 'select', 'clear')
3054
-
3055
- def select_from(self, tagOrId, index):
3056
- """Set the fixed end of a selection in item TAGORID to INDEX."""
3057
- self.tk.call(self._w, 'select', 'from', tagOrId, index)
3058
-
3059
- def select_item(self):
3060
- """Return the item which has the selection."""
3061
- return self.tk.call(self._w, 'select', 'item') or None
3062
-
3063
- def select_to(self, tagOrId, index):
3064
- """Set the variable end of a selection in item TAGORID to INDEX."""
3065
- self.tk.call(self._w, 'select', 'to', tagOrId, index)
3066
-
3067
- def type(self, tagOrId):
3068
- """Return the type of the item TAGORID."""
3069
- return self.tk.call(self._w, 'type', tagOrId) or None
3070
-
3071
-
3072
- _checkbutton_count = 0
3073
-
3074
- class Checkbutton(Widget):
3075
- """Checkbutton widget which is either in on- or off-state."""
3076
-
3077
- def __init__(self, master=None, cnf={}, **kw):
3078
- """Construct a checkbutton widget with the parent MASTER.
3079
-
3080
- Valid resource names: activebackground, activeforeground, anchor,
3081
- background, bd, bg, bitmap, borderwidth, command, cursor,
3082
- disabledforeground, fg, font, foreground, height,
3083
- highlightbackground, highlightcolor, highlightthickness, image,
3084
- indicatoron, justify, offvalue, onvalue, padx, pady, relief,
3085
- selectcolor, selectimage, state, takefocus, text, textvariable,
3086
- underline, variable, width, wraplength."""
3087
- Widget.__init__(self, master, 'checkbutton', cnf, kw)
3088
-
3089
- def _setup(self, master, cnf):
3090
- # Because Checkbutton defaults to a variable with the same name as
3091
- # the widget, Checkbutton default names must be globally unique,
3092
- # not just unique within the parent widget.
3093
- if not cnf.get('name'):
3094
- global _checkbutton_count
3095
- name = self.__class__.__name__.lower()
3096
- _checkbutton_count += 1
3097
- # To avoid collisions with ttk.Checkbutton, use the different
3098
- # name template.
3099
- cnf['name'] = f'!{name}-{_checkbutton_count}'
3100
- super()._setup(master, cnf)
3101
-
3102
- def deselect(self):
3103
- """Put the button in off-state."""
3104
- self.tk.call(self._w, 'deselect')
3105
-
3106
- def flash(self):
3107
- """Flash the button."""
3108
- self.tk.call(self._w, 'flash')
3109
-
3110
- def invoke(self):
3111
- """Toggle the button and invoke a command if given as resource."""
3112
- return self.tk.call(self._w, 'invoke')
3113
-
3114
- def select(self):
3115
- """Put the button in on-state."""
3116
- self.tk.call(self._w, 'select')
3117
-
3118
- def toggle(self):
3119
- """Toggle the button."""
3120
- self.tk.call(self._w, 'toggle')
3121
-
3122
-
3123
- class Entry(Widget, XView):
3124
- """Entry widget which allows displaying simple text."""
3125
-
3126
- def __init__(self, master=None, cnf={}, **kw):
3127
- """Construct an entry widget with the parent MASTER.
3128
-
3129
- Valid resource names: background, bd, bg, borderwidth, cursor,
3130
- exportselection, fg, font, foreground, highlightbackground,
3131
- highlightcolor, highlightthickness, insertbackground,
3132
- insertborderwidth, insertofftime, insertontime, insertwidth,
3133
- invalidcommand, invcmd, justify, relief, selectbackground,
3134
- selectborderwidth, selectforeground, show, state, takefocus,
3135
- textvariable, validate, validatecommand, vcmd, width,
3136
- xscrollcommand."""
3137
- Widget.__init__(self, master, 'entry', cnf, kw)
3138
-
3139
- def delete(self, first, last=None):
3140
- """Delete text from FIRST to LAST (not included)."""
3141
- self.tk.call(self._w, 'delete', first, last)
3142
-
3143
- def get(self):
3144
- """Return the text."""
3145
- return self.tk.call(self._w, 'get')
3146
-
3147
- def icursor(self, index):
3148
- """Insert cursor at INDEX."""
3149
- self.tk.call(self._w, 'icursor', index)
3150
-
3151
- def index(self, index):
3152
- """Return position of cursor."""
3153
- return self.tk.getint(self.tk.call(
3154
- self._w, 'index', index))
3155
-
3156
- def insert(self, index, string):
3157
- """Insert STRING at INDEX."""
3158
- self.tk.call(self._w, 'insert', index, string)
3159
-
3160
- def scan_mark(self, x):
3161
- """Remember the current X, Y coordinates."""
3162
- self.tk.call(self._w, 'scan', 'mark', x)
3163
-
3164
- def scan_dragto(self, x):
3165
- """Adjust the view of the canvas to 10 times the
3166
- difference between X and Y and the coordinates given in
3167
- scan_mark."""
3168
- self.tk.call(self._w, 'scan', 'dragto', x)
3169
-
3170
- def selection_adjust(self, index):
3171
- """Adjust the end of the selection near the cursor to INDEX."""
3172
- self.tk.call(self._w, 'selection', 'adjust', index)
3173
-
3174
- select_adjust = selection_adjust
3175
-
3176
- def selection_clear(self):
3177
- """Clear the selection if it is in this widget."""
3178
- self.tk.call(self._w, 'selection', 'clear')
3179
-
3180
- select_clear = selection_clear
3181
-
3182
- def selection_from(self, index):
3183
- """Set the fixed end of a selection to INDEX."""
3184
- self.tk.call(self._w, 'selection', 'from', index)
3185
-
3186
- select_from = selection_from
3187
-
3188
- def selection_present(self):
3189
- """Return True if there are characters selected in the entry, False
3190
- otherwise."""
3191
- return self.tk.getboolean(
3192
- self.tk.call(self._w, 'selection', 'present'))
3193
-
3194
- select_present = selection_present
3195
-
3196
- def selection_range(self, start, end):
3197
- """Set the selection from START to END (not included)."""
3198
- self.tk.call(self._w, 'selection', 'range', start, end)
3199
-
3200
- select_range = selection_range
3201
-
3202
- def selection_to(self, index):
3203
- """Set the variable end of a selection to INDEX."""
3204
- self.tk.call(self._w, 'selection', 'to', index)
3205
-
3206
- select_to = selection_to
3207
-
3208
-
3209
- class Frame(Widget):
3210
- """Frame widget which may contain other widgets and can have a 3D border."""
3211
-
3212
- def __init__(self, master=None, cnf={}, **kw):
3213
- """Construct a frame widget with the parent MASTER.
3214
-
3215
- Valid resource names: background, bd, bg, borderwidth, class,
3216
- colormap, container, cursor, height, highlightbackground,
3217
- highlightcolor, highlightthickness, relief, takefocus, visual, width."""
3218
- cnf = _cnfmerge((cnf, kw))
3219
- extra = ()
3220
- if 'class_' in cnf:
3221
- extra = ('-class', cnf['class_'])
3222
- del cnf['class_']
3223
- elif 'class' in cnf:
3224
- extra = ('-class', cnf['class'])
3225
- del cnf['class']
3226
- Widget.__init__(self, master, 'frame', cnf, {}, extra)
3227
-
3228
-
3229
- class Label(Widget):
3230
- """Label widget which can display text and bitmaps."""
3231
-
3232
- def __init__(self, master=None, cnf={}, **kw):
3233
- """Construct a label widget with the parent MASTER.
3234
-
3235
- STANDARD OPTIONS
3236
-
3237
- activebackground, activeforeground, anchor,
3238
- background, bitmap, borderwidth, cursor,
3239
- disabledforeground, font, foreground,
3240
- highlightbackground, highlightcolor,
3241
- highlightthickness, image, justify,
3242
- padx, pady, relief, takefocus, text,
3243
- textvariable, underline, wraplength
3244
-
3245
- WIDGET-SPECIFIC OPTIONS
3246
-
3247
- height, state, width
3248
-
3249
- """
3250
- Widget.__init__(self, master, 'label', cnf, kw)
3251
-
3252
-
3253
- class Listbox(Widget, XView, YView):
3254
- """Listbox widget which can display a list of strings."""
3255
-
3256
- def __init__(self, master=None, cnf={}, **kw):
3257
- """Construct a listbox widget with the parent MASTER.
3258
-
3259
- Valid resource names: background, bd, bg, borderwidth, cursor,
3260
- exportselection, fg, font, foreground, height, highlightbackground,
3261
- highlightcolor, highlightthickness, relief, selectbackground,
3262
- selectborderwidth, selectforeground, selectmode, setgrid, takefocus,
3263
- width, xscrollcommand, yscrollcommand, listvariable."""
3264
- Widget.__init__(self, master, 'listbox', cnf, kw)
3265
-
3266
- def activate(self, index):
3267
- """Activate item identified by INDEX."""
3268
- self.tk.call(self._w, 'activate', index)
3269
-
3270
- def bbox(self, index):
3271
- """Return a tuple of X1,Y1,X2,Y2 coordinates for a rectangle
3272
- which encloses the item identified by the given index."""
3273
- return self._getints(self.tk.call(self._w, 'bbox', index)) or None
3274
-
3275
- def curselection(self):
3276
- """Return the indices of currently selected item."""
3277
- return self._getints(self.tk.call(self._w, 'curselection')) or ()
3278
-
3279
- def delete(self, first, last=None):
3280
- """Delete items from FIRST to LAST (included)."""
3281
- self.tk.call(self._w, 'delete', first, last)
3282
-
3283
- def get(self, first, last=None):
3284
- """Get list of items from FIRST to LAST (included)."""
3285
- if last is not None:
3286
- return self.tk.splitlist(self.tk.call(
3287
- self._w, 'get', first, last))
3288
- else:
3289
- return self.tk.call(self._w, 'get', first)
3290
-
3291
- def index(self, index):
3292
- """Return index of item identified with INDEX."""
3293
- i = self.tk.call(self._w, 'index', index)
3294
- if i == 'none': return None
3295
- return self.tk.getint(i)
3296
-
3297
- def insert(self, index, *elements):
3298
- """Insert ELEMENTS at INDEX."""
3299
- self.tk.call((self._w, 'insert', index) + elements)
3300
-
3301
- def nearest(self, y):
3302
- """Get index of item which is nearest to y coordinate Y."""
3303
- return self.tk.getint(self.tk.call(
3304
- self._w, 'nearest', y))
3305
-
3306
- def scan_mark(self, x, y):
3307
- """Remember the current X, Y coordinates."""
3308
- self.tk.call(self._w, 'scan', 'mark', x, y)
3309
-
3310
- def scan_dragto(self, x, y):
3311
- """Adjust the view of the listbox to 10 times the
3312
- difference between X and Y and the coordinates given in
3313
- scan_mark."""
3314
- self.tk.call(self._w, 'scan', 'dragto', x, y)
3315
-
3316
- def see(self, index):
3317
- """Scroll such that INDEX is visible."""
3318
- self.tk.call(self._w, 'see', index)
3319
-
3320
- def selection_anchor(self, index):
3321
- """Set the fixed end oft the selection to INDEX."""
3322
- self.tk.call(self._w, 'selection', 'anchor', index)
3323
-
3324
- select_anchor = selection_anchor
3325
-
3326
- def selection_clear(self, first, last=None):
3327
- """Clear the selection from FIRST to LAST (included)."""
3328
- self.tk.call(self._w,
3329
- 'selection', 'clear', first, last)
3330
-
3331
- select_clear = selection_clear
3332
-
3333
- def selection_includes(self, index):
3334
- """Return True if INDEX is part of the selection."""
3335
- return self.tk.getboolean(self.tk.call(
3336
- self._w, 'selection', 'includes', index))
3337
-
3338
- select_includes = selection_includes
3339
-
3340
- def selection_set(self, first, last=None):
3341
- """Set the selection from FIRST to LAST (included) without
3342
- changing the currently selected elements."""
3343
- self.tk.call(self._w, 'selection', 'set', first, last)
3344
-
3345
- select_set = selection_set
3346
-
3347
- def size(self):
3348
- """Return the number of elements in the listbox."""
3349
- return self.tk.getint(self.tk.call(self._w, 'size'))
3350
-
3351
- def itemcget(self, index, option):
3352
- """Return the resource value for an ITEM and an OPTION."""
3353
- return self.tk.call(
3354
- (self._w, 'itemcget') + (index, '-'+option))
3355
-
3356
- def itemconfigure(self, index, cnf=None, **kw):
3357
- """Configure resources of an ITEM.
3358
-
3359
- The values for resources are specified as keyword arguments.
3360
- To get an overview about the allowed keyword arguments
3361
- call the method without arguments.
3362
- Valid resource names: background, bg, foreground, fg,
3363
- selectbackground, selectforeground."""
3364
- return self._configure(('itemconfigure', index), cnf, kw)
3365
-
3366
- itemconfig = itemconfigure
3367
-
3368
-
3369
- class Menu(Widget):
3370
- """Menu widget which allows displaying menu bars, pull-down menus and pop-up menus."""
3371
-
3372
- def __init__(self, master=None, cnf={}, **kw):
3373
- """Construct menu widget with the parent MASTER.
3374
-
3375
- Valid resource names: activebackground, activeborderwidth,
3376
- activeforeground, background, bd, bg, borderwidth, cursor,
3377
- disabledforeground, fg, font, foreground, postcommand, relief,
3378
- selectcolor, takefocus, tearoff, tearoffcommand, title, type."""
3379
- Widget.__init__(self, master, 'menu', cnf, kw)
3380
-
3381
- def tk_popup(self, x, y, entry=""):
3382
- """Post the menu at position X,Y with entry ENTRY."""
3383
- self.tk.call('tk_popup', self._w, x, y, entry)
3384
-
3385
- def activate(self, index):
3386
- """Activate entry at INDEX."""
3387
- self.tk.call(self._w, 'activate', index)
3388
-
3389
- def add(self, itemType, cnf={}, **kw):
3390
- """Internal function."""
3391
- self.tk.call((self._w, 'add', itemType) +
3392
- self._options(cnf, kw))
3393
-
3394
- def add_cascade(self, cnf={}, **kw):
3395
- """Add hierarchical menu item."""
3396
- self.add('cascade', cnf or kw)
3397
-
3398
- def add_checkbutton(self, cnf={}, **kw):
3399
- """Add checkbutton menu item."""
3400
- self.add('checkbutton', cnf or kw)
3401
-
3402
- def add_command(self, cnf={}, **kw):
3403
- """Add command menu item."""
3404
- self.add('command', cnf or kw)
3405
-
3406
- def add_radiobutton(self, cnf={}, **kw):
3407
- """Add radio menu item."""
3408
- self.add('radiobutton', cnf or kw)
3409
-
3410
- def add_separator(self, cnf={}, **kw):
3411
- """Add separator."""
3412
- self.add('separator', cnf or kw)
3413
-
3414
- def insert(self, index, itemType, cnf={}, **kw):
3415
- """Internal function."""
3416
- self.tk.call((self._w, 'insert', index, itemType) +
3417
- self._options(cnf, kw))
3418
-
3419
- def insert_cascade(self, index, cnf={}, **kw):
3420
- """Add hierarchical menu item at INDEX."""
3421
- self.insert(index, 'cascade', cnf or kw)
3422
-
3423
- def insert_checkbutton(self, index, cnf={}, **kw):
3424
- """Add checkbutton menu item at INDEX."""
3425
- self.insert(index, 'checkbutton', cnf or kw)
3426
-
3427
- def insert_command(self, index, cnf={}, **kw):
3428
- """Add command menu item at INDEX."""
3429
- self.insert(index, 'command', cnf or kw)
3430
-
3431
- def insert_radiobutton(self, index, cnf={}, **kw):
3432
- """Add radio menu item at INDEX."""
3433
- self.insert(index, 'radiobutton', cnf or kw)
3434
-
3435
- def insert_separator(self, index, cnf={}, **kw):
3436
- """Add separator at INDEX."""
3437
- self.insert(index, 'separator', cnf or kw)
3438
-
3439
- def delete(self, index1, index2=None):
3440
- """Delete menu items between INDEX1 and INDEX2 (included)."""
3441
- if index2 is None:
3442
- index2 = index1
3443
-
3444
- num_index1, num_index2 = self.index(index1), self.index(index2)
3445
- if (num_index1 is None) or (num_index2 is None):
3446
- num_index1, num_index2 = 0, -1
3447
-
3448
- for i in range(num_index1, num_index2 + 1):
3449
- if 'command' in self.entryconfig(i):
3450
- c = str(self.entrycget(i, 'command'))
3451
- if c:
3452
- self.deletecommand(c)
3453
- self.tk.call(self._w, 'delete', index1, index2)
3454
-
3455
- def entrycget(self, index, option):
3456
- """Return the resource value of a menu item for OPTION at INDEX."""
3457
- return self.tk.call(self._w, 'entrycget', index, '-' + option)
3458
-
3459
- def entryconfigure(self, index, cnf=None, **kw):
3460
- """Configure a menu item at INDEX."""
3461
- return self._configure(('entryconfigure', index), cnf, kw)
3462
-
3463
- entryconfig = entryconfigure
3464
-
3465
- def index(self, index):
3466
- """Return the index of a menu item identified by INDEX."""
3467
- i = self.tk.call(self._w, 'index', index)
3468
- return None if i in ('', 'none') else self.tk.getint(i) # GH-103685.
3469
-
3470
- def invoke(self, index):
3471
- """Invoke a menu item identified by INDEX and execute
3472
- the associated command."""
3473
- return self.tk.call(self._w, 'invoke', index)
3474
-
3475
- def post(self, x, y):
3476
- """Display a menu at position X,Y."""
3477
- self.tk.call(self._w, 'post', x, y)
3478
-
3479
- def type(self, index):
3480
- """Return the type of the menu item at INDEX."""
3481
- return self.tk.call(self._w, 'type', index)
3482
-
3483
- def unpost(self):
3484
- """Unmap a menu."""
3485
- self.tk.call(self._w, 'unpost')
3486
-
3487
- def xposition(self, index): # new in Tk 8.5
3488
- """Return the x-position of the leftmost pixel of the menu item
3489
- at INDEX."""
3490
- return self.tk.getint(self.tk.call(self._w, 'xposition', index))
3491
-
3492
- def yposition(self, index):
3493
- """Return the y-position of the topmost pixel of the menu item at INDEX."""
3494
- return self.tk.getint(self.tk.call(
3495
- self._w, 'yposition', index))
3496
-
3497
-
3498
- class Menubutton(Widget):
3499
- """Menubutton widget, obsolete since Tk8.0."""
3500
-
3501
- def __init__(self, master=None, cnf={}, **kw):
3502
- Widget.__init__(self, master, 'menubutton', cnf, kw)
3503
-
3504
-
3505
- class Message(Widget):
3506
- """Message widget to display multiline text. Obsolete since Label does it too."""
3507
-
3508
- def __init__(self, master=None, cnf={}, **kw):
3509
- Widget.__init__(self, master, 'message', cnf, kw)
3510
-
3511
-
3512
- class Radiobutton(Widget):
3513
- """Radiobutton widget which shows only one of several buttons in on-state."""
3514
-
3515
- def __init__(self, master=None, cnf={}, **kw):
3516
- """Construct a radiobutton widget with the parent MASTER.
3517
-
3518
- Valid resource names: activebackground, activeforeground, anchor,
3519
- background, bd, bg, bitmap, borderwidth, command, cursor,
3520
- disabledforeground, fg, font, foreground, height,
3521
- highlightbackground, highlightcolor, highlightthickness, image,
3522
- indicatoron, justify, padx, pady, relief, selectcolor, selectimage,
3523
- state, takefocus, text, textvariable, underline, value, variable,
3524
- width, wraplength."""
3525
- Widget.__init__(self, master, 'radiobutton', cnf, kw)
3526
-
3527
- def deselect(self):
3528
- """Put the button in off-state."""
3529
-
3530
- self.tk.call(self._w, 'deselect')
3531
-
3532
- def flash(self):
3533
- """Flash the button."""
3534
- self.tk.call(self._w, 'flash')
3535
-
3536
- def invoke(self):
3537
- """Toggle the button and invoke a command if given as resource."""
3538
- return self.tk.call(self._w, 'invoke')
3539
-
3540
- def select(self):
3541
- """Put the button in on-state."""
3542
- self.tk.call(self._w, 'select')
3543
-
3544
-
3545
- class Scale(Widget):
3546
- """Scale widget which can display a numerical scale."""
3547
-
3548
- def __init__(self, master=None, cnf={}, **kw):
3549
- """Construct a scale widget with the parent MASTER.
3550
-
3551
- Valid resource names: activebackground, background, bigincrement, bd,
3552
- bg, borderwidth, command, cursor, digits, fg, font, foreground, from,
3553
- highlightbackground, highlightcolor, highlightthickness, label,
3554
- length, orient, relief, repeatdelay, repeatinterval, resolution,
3555
- showvalue, sliderlength, sliderrelief, state, takefocus,
3556
- tickinterval, to, troughcolor, variable, width."""
3557
- Widget.__init__(self, master, 'scale', cnf, kw)
3558
-
3559
- def get(self):
3560
- """Get the current value as integer or float."""
3561
- value = self.tk.call(self._w, 'get')
3562
- try:
3563
- return self.tk.getint(value)
3564
- except (ValueError, TypeError, TclError):
3565
- return self.tk.getdouble(value)
3566
-
3567
- def set(self, value):
3568
- """Set the value to VALUE."""
3569
- self.tk.call(self._w, 'set', value)
3570
-
3571
- def coords(self, value=None):
3572
- """Return a tuple (X,Y) of the point along the centerline of the
3573
- trough that corresponds to VALUE or the current value if None is
3574
- given."""
3575
-
3576
- return self._getints(self.tk.call(self._w, 'coords', value))
3577
-
3578
- def identify(self, x, y):
3579
- """Return where the point X,Y lies. Valid return values are "slider",
3580
- "though1" and "though2"."""
3581
- return self.tk.call(self._w, 'identify', x, y)
3582
-
3583
-
3584
- class Scrollbar(Widget):
3585
- """Scrollbar widget which displays a slider at a certain position."""
3586
-
3587
- def __init__(self, master=None, cnf={}, **kw):
3588
- """Construct a scrollbar widget with the parent MASTER.
3589
-
3590
- Valid resource names: activebackground, activerelief,
3591
- background, bd, bg, borderwidth, command, cursor,
3592
- elementborderwidth, highlightbackground,
3593
- highlightcolor, highlightthickness, jump, orient,
3594
- relief, repeatdelay, repeatinterval, takefocus,
3595
- troughcolor, width."""
3596
- Widget.__init__(self, master, 'scrollbar', cnf, kw)
3597
-
3598
- def activate(self, index=None):
3599
- """Marks the element indicated by index as active.
3600
- The only index values understood by this method are "arrow1",
3601
- "slider", or "arrow2". If any other value is specified then no
3602
- element of the scrollbar will be active. If index is not specified,
3603
- the method returns the name of the element that is currently active,
3604
- or None if no element is active."""
3605
- return self.tk.call(self._w, 'activate', index) or None
3606
-
3607
- def delta(self, deltax, deltay):
3608
- """Return the fractional change of the scrollbar setting if it
3609
- would be moved by DELTAX or DELTAY pixels."""
3610
- return self.tk.getdouble(
3611
- self.tk.call(self._w, 'delta', deltax, deltay))
3612
-
3613
- def fraction(self, x, y):
3614
- """Return the fractional value which corresponds to a slider
3615
- position of X,Y."""
3616
- return self.tk.getdouble(self.tk.call(self._w, 'fraction', x, y))
3617
-
3618
- def identify(self, x, y):
3619
- """Return the element under position X,Y as one of
3620
- "arrow1","slider","arrow2" or ""."""
3621
- return self.tk.call(self._w, 'identify', x, y)
3622
-
3623
- def get(self):
3624
- """Return the current fractional values (upper and lower end)
3625
- of the slider position."""
3626
- return self._getdoubles(self.tk.call(self._w, 'get'))
3627
-
3628
- def set(self, first, last):
3629
- """Set the fractional values of the slider position (upper and
3630
- lower ends as value between 0 and 1)."""
3631
- self.tk.call(self._w, 'set', first, last)
3632
-
3633
-
3634
- class Text(Widget, XView, YView):
3635
- """Text widget which can display text in various forms."""
3636
-
3637
- def __init__(self, master=None, cnf={}, **kw):
3638
- """Construct a text widget with the parent MASTER.
3639
-
3640
- STANDARD OPTIONS
3641
-
3642
- background, borderwidth, cursor,
3643
- exportselection, font, foreground,
3644
- highlightbackground, highlightcolor,
3645
- highlightthickness, insertbackground,
3646
- insertborderwidth, insertofftime,
3647
- insertontime, insertwidth, padx, pady,
3648
- relief, selectbackground,
3649
- selectborderwidth, selectforeground,
3650
- setgrid, takefocus,
3651
- xscrollcommand, yscrollcommand,
3652
-
3653
- WIDGET-SPECIFIC OPTIONS
3654
-
3655
- autoseparators, height, maxundo,
3656
- spacing1, spacing2, spacing3,
3657
- state, tabs, undo, width, wrap,
3658
-
3659
- """
3660
- Widget.__init__(self, master, 'text', cnf, kw)
3661
-
3662
- def bbox(self, index):
3663
- """Return a tuple of (x,y,width,height) which gives the bounding
3664
- box of the visible part of the character at the given index."""
3665
- return self._getints(
3666
- self.tk.call(self._w, 'bbox', index)) or None
3667
-
3668
- def compare(self, index1, op, index2):
3669
- """Return whether between index INDEX1 and index INDEX2 the
3670
- relation OP is satisfied. OP is one of <, <=, ==, >=, >, or !=."""
3671
- return self.tk.getboolean(self.tk.call(
3672
- self._w, 'compare', index1, op, index2))
3673
-
3674
- def count(self, index1, index2, *args): # new in Tk 8.5
3675
- """Counts the number of relevant things between the two indices.
3676
- If index1 is after index2, the result will be a negative number
3677
- (and this holds for each of the possible options).
3678
-
3679
- The actual items which are counted depends on the options given by
3680
- args. The result is a list of integers, one for the result of each
3681
- counting option given. Valid counting options are "chars",
3682
- "displaychars", "displayindices", "displaylines", "indices",
3683
- "lines", "xpixels" and "ypixels". There is an additional possible
3684
- option "update", which if given then all subsequent options ensure
3685
- that any possible out of date information is recalculated."""
3686
- args = ['-%s' % arg for arg in args]
3687
- args += [index1, index2]
3688
- res = self.tk.call(self._w, 'count', *args) or None
3689
- if res is not None and len(args) <= 3:
3690
- return (res, )
3691
- else:
3692
- return res
3693
-
3694
- def debug(self, boolean=None):
3695
- """Turn on the internal consistency checks of the B-Tree inside the text
3696
- widget according to BOOLEAN."""
3697
- if boolean is None:
3698
- return self.tk.getboolean(self.tk.call(self._w, 'debug'))
3699
- self.tk.call(self._w, 'debug', boolean)
3700
-
3701
- def delete(self, index1, index2=None):
3702
- """Delete the characters between INDEX1 and INDEX2 (not included)."""
3703
- self.tk.call(self._w, 'delete', index1, index2)
3704
-
3705
- def dlineinfo(self, index):
3706
- """Return tuple (x,y,width,height,baseline) giving the bounding box
3707
- and baseline position of the visible part of the line containing
3708
- the character at INDEX."""
3709
- return self._getints(self.tk.call(self._w, 'dlineinfo', index))
3710
-
3711
- def dump(self, index1, index2=None, command=None, **kw):
3712
- """Return the contents of the widget between index1 and index2.
3713
-
3714
- The type of contents returned in filtered based on the keyword
3715
- parameters; if 'all', 'image', 'mark', 'tag', 'text', or 'window' are
3716
- given and true, then the corresponding items are returned. The result
3717
- is a list of triples of the form (key, value, index). If none of the
3718
- keywords are true then 'all' is used by default.
3719
-
3720
- If the 'command' argument is given, it is called once for each element
3721
- of the list of triples, with the values of each triple serving as the
3722
- arguments to the function. In this case the list is not returned."""
3723
- args = []
3724
- func_name = None
3725
- result = None
3726
- if not command:
3727
- # Never call the dump command without the -command flag, since the
3728
- # output could involve Tcl quoting and would be a pain to parse
3729
- # right. Instead just set the command to build a list of triples
3730
- # as if we had done the parsing.
3731
- result = []
3732
- def append_triple(key, value, index, result=result):
3733
- result.append((key, value, index))
3734
- command = append_triple
3735
- try:
3736
- if not isinstance(command, str):
3737
- func_name = command = self._register(command)
3738
- args += ["-command", command]
3739
- for key in kw:
3740
- if kw[key]: args.append("-" + key)
3741
- args.append(index1)
3742
- if index2:
3743
- args.append(index2)
3744
- self.tk.call(self._w, "dump", *args)
3745
- return result
3746
- finally:
3747
- if func_name:
3748
- self.deletecommand(func_name)
3749
-
3750
- ## new in tk8.4
3751
- def edit(self, *args):
3752
- """Internal method
3753
-
3754
- This method controls the undo mechanism and
3755
- the modified flag. The exact behavior of the
3756
- command depends on the option argument that
3757
- follows the edit argument. The following forms
3758
- of the command are currently supported:
3759
-
3760
- edit_modified, edit_redo, edit_reset, edit_separator
3761
- and edit_undo
3762
-
3763
- """
3764
- return self.tk.call(self._w, 'edit', *args)
3765
-
3766
- def edit_modified(self, arg=None):
3767
- """Get or Set the modified flag
3768
-
3769
- If arg is not specified, returns the modified
3770
- flag of the widget. The insert, delete, edit undo and
3771
- edit redo commands or the user can set or clear the
3772
- modified flag. If boolean is specified, sets the
3773
- modified flag of the widget to arg.
3774
- """
3775
- return self.edit("modified", arg)
3776
-
3777
- def edit_redo(self):
3778
- """Redo the last undone edit
3779
-
3780
- When the undo option is true, reapplies the last
3781
- undone edits provided no other edits were done since
3782
- then. Generates an error when the redo stack is empty.
3783
- Does nothing when the undo option is false.
3784
- """
3785
- return self.edit("redo")
3786
-
3787
- def edit_reset(self):
3788
- """Clears the undo and redo stacks
3789
- """
3790
- return self.edit("reset")
3791
-
3792
- def edit_separator(self):
3793
- """Inserts a separator (boundary) on the undo stack.
3794
-
3795
- Does nothing when the undo option is false
3796
- """
3797
- return self.edit("separator")
3798
-
3799
- def edit_undo(self):
3800
- """Undoes the last edit action
3801
-
3802
- If the undo option is true. An edit action is defined
3803
- as all the insert and delete commands that are recorded
3804
- on the undo stack in between two separators. Generates
3805
- an error when the undo stack is empty. Does nothing
3806
- when the undo option is false
3807
- """
3808
- return self.edit("undo")
3809
-
3810
- def get(self, index1, index2=None):
3811
- """Return the text from INDEX1 to INDEX2 (not included)."""
3812
- return self.tk.call(self._w, 'get', index1, index2)
3813
- # (Image commands are new in 8.0)
3814
-
3815
- def image_cget(self, index, option):
3816
- """Return the value of OPTION of an embedded image at INDEX."""
3817
- if option[:1] != "-":
3818
- option = "-" + option
3819
- if option[-1:] == "_":
3820
- option = option[:-1]
3821
- return self.tk.call(self._w, "image", "cget", index, option)
3822
-
3823
- def image_configure(self, index, cnf=None, **kw):
3824
- """Configure an embedded image at INDEX."""
3825
- return self._configure(('image', 'configure', index), cnf, kw)
3826
-
3827
- def image_create(self, index, cnf={}, **kw):
3828
- """Create an embedded image at INDEX."""
3829
- return self.tk.call(
3830
- self._w, "image", "create", index,
3831
- *self._options(cnf, kw))
3832
-
3833
- def image_names(self):
3834
- """Return all names of embedded images in this widget."""
3835
- return self.tk.call(self._w, "image", "names")
3836
-
3837
- def index(self, index):
3838
- """Return the index in the form line.char for INDEX."""
3839
- return str(self.tk.call(self._w, 'index', index))
3840
-
3841
- def insert(self, index, chars, *args):
3842
- """Insert CHARS before the characters at INDEX. An additional
3843
- tag can be given in ARGS. Additional CHARS and tags can follow in ARGS."""
3844
- self.tk.call((self._w, 'insert', index, chars) + args)
3845
-
3846
- def mark_gravity(self, markName, direction=None):
3847
- """Change the gravity of a mark MARKNAME to DIRECTION (LEFT or RIGHT).
3848
- Return the current value if None is given for DIRECTION."""
3849
- return self.tk.call(
3850
- (self._w, 'mark', 'gravity', markName, direction))
3851
-
3852
- def mark_names(self):
3853
- """Return all mark names."""
3854
- return self.tk.splitlist(self.tk.call(
3855
- self._w, 'mark', 'names'))
3856
-
3857
- def mark_set(self, markName, index):
3858
- """Set mark MARKNAME before the character at INDEX."""
3859
- self.tk.call(self._w, 'mark', 'set', markName, index)
3860
-
3861
- def mark_unset(self, *markNames):
3862
- """Delete all marks in MARKNAMES."""
3863
- self.tk.call((self._w, 'mark', 'unset') + markNames)
3864
-
3865
- def mark_next(self, index):
3866
- """Return the name of the next mark after INDEX."""
3867
- return self.tk.call(self._w, 'mark', 'next', index) or None
3868
-
3869
- def mark_previous(self, index):
3870
- """Return the name of the previous mark before INDEX."""
3871
- return self.tk.call(self._w, 'mark', 'previous', index) or None
3872
-
3873
- def peer_create(self, newPathName, cnf={}, **kw): # new in Tk 8.5
3874
- """Creates a peer text widget with the given newPathName, and any
3875
- optional standard configuration options. By default the peer will
3876
- have the same start and end line as the parent widget, but
3877
- these can be overridden with the standard configuration options."""
3878
- self.tk.call(self._w, 'peer', 'create', newPathName,
3879
- *self._options(cnf, kw))
3880
-
3881
- def peer_names(self): # new in Tk 8.5
3882
- """Returns a list of peers of this widget (this does not include
3883
- the widget itself)."""
3884
- return self.tk.splitlist(self.tk.call(self._w, 'peer', 'names'))
3885
-
3886
- def replace(self, index1, index2, chars, *args): # new in Tk 8.5
3887
- """Replaces the range of characters between index1 and index2 with
3888
- the given characters and tags specified by args.
3889
-
3890
- See the method insert for some more information about args, and the
3891
- method delete for information about the indices."""
3892
- self.tk.call(self._w, 'replace', index1, index2, chars, *args)
3893
-
3894
- def scan_mark(self, x, y):
3895
- """Remember the current X, Y coordinates."""
3896
- self.tk.call(self._w, 'scan', 'mark', x, y)
3897
-
3898
- def scan_dragto(self, x, y):
3899
- """Adjust the view of the text to 10 times the
3900
- difference between X and Y and the coordinates given in
3901
- scan_mark."""
3902
- self.tk.call(self._w, 'scan', 'dragto', x, y)
3903
-
3904
- def search(self, pattern, index, stopindex=None,
3905
- forwards=None, backwards=None, exact=None,
3906
- regexp=None, nocase=None, count=None, elide=None):
3907
- """Search PATTERN beginning from INDEX until STOPINDEX.
3908
- Return the index of the first character of a match or an
3909
- empty string."""
3910
- args = [self._w, 'search']
3911
- if forwards: args.append('-forwards')
3912
- if backwards: args.append('-backwards')
3913
- if exact: args.append('-exact')
3914
- if regexp: args.append('-regexp')
3915
- if nocase: args.append('-nocase')
3916
- if elide: args.append('-elide')
3917
- if count: args.append('-count'); args.append(count)
3918
- if pattern and pattern[0] == '-': args.append('--')
3919
- args.append(pattern)
3920
- args.append(index)
3921
- if stopindex: args.append(stopindex)
3922
- return str(self.tk.call(tuple(args)))
3923
-
3924
- def see(self, index):
3925
- """Scroll such that the character at INDEX is visible."""
3926
- self.tk.call(self._w, 'see', index)
3927
-
3928
- def tag_add(self, tagName, index1, *args):
3929
- """Add tag TAGNAME to all characters between INDEX1 and index2 in ARGS.
3930
- Additional pairs of indices may follow in ARGS."""
3931
- self.tk.call(
3932
- (self._w, 'tag', 'add', tagName, index1) + args)
3933
-
3934
- def tag_unbind(self, tagName, sequence, funcid=None):
3935
- """Unbind for all characters with TAGNAME for event SEQUENCE the
3936
- function identified with FUNCID."""
3937
- return self._unbind((self._w, 'tag', 'bind', tagName, sequence), funcid)
3938
-
3939
- def tag_bind(self, tagName, sequence, func, add=None):
3940
- """Bind to all characters with TAGNAME at event SEQUENCE a call to function FUNC.
3941
-
3942
- An additional boolean parameter ADD specifies whether FUNC will be
3943
- called additionally to the other bound function or whether it will
3944
- replace the previous function. See bind for the return value."""
3945
- return self._bind((self._w, 'tag', 'bind', tagName),
3946
- sequence, func, add)
3947
-
3948
- def _tag_bind(self, tagName, sequence=None, func=None, add=None):
3949
- # For tests only
3950
- return self._bind((self._w, 'tag', 'bind', tagName),
3951
- sequence, func, add)
3952
-
3953
- def tag_cget(self, tagName, option):
3954
- """Return the value of OPTION for tag TAGNAME."""
3955
- if option[:1] != '-':
3956
- option = '-' + option
3957
- if option[-1:] == '_':
3958
- option = option[:-1]
3959
- return self.tk.call(self._w, 'tag', 'cget', tagName, option)
3960
-
3961
- def tag_configure(self, tagName, cnf=None, **kw):
3962
- """Configure a tag TAGNAME."""
3963
- return self._configure(('tag', 'configure', tagName), cnf, kw)
3964
-
3965
- tag_config = tag_configure
3966
-
3967
- def tag_delete(self, *tagNames):
3968
- """Delete all tags in TAGNAMES."""
3969
- self.tk.call((self._w, 'tag', 'delete') + tagNames)
3970
-
3971
- def tag_lower(self, tagName, belowThis=None):
3972
- """Change the priority of tag TAGNAME such that it is lower
3973
- than the priority of BELOWTHIS."""
3974
- self.tk.call(self._w, 'tag', 'lower', tagName, belowThis)
3975
-
3976
- def tag_names(self, index=None):
3977
- """Return a list of all tag names."""
3978
- return self.tk.splitlist(
3979
- self.tk.call(self._w, 'tag', 'names', index))
3980
-
3981
- def tag_nextrange(self, tagName, index1, index2=None):
3982
- """Return a list of start and end index for the first sequence of
3983
- characters between INDEX1 and INDEX2 which all have tag TAGNAME.
3984
- The text is searched forward from INDEX1."""
3985
- return self.tk.splitlist(self.tk.call(
3986
- self._w, 'tag', 'nextrange', tagName, index1, index2))
3987
-
3988
- def tag_prevrange(self, tagName, index1, index2=None):
3989
- """Return a list of start and end index for the first sequence of
3990
- characters between INDEX1 and INDEX2 which all have tag TAGNAME.
3991
- The text is searched backwards from INDEX1."""
3992
- return self.tk.splitlist(self.tk.call(
3993
- self._w, 'tag', 'prevrange', tagName, index1, index2))
3994
-
3995
- def tag_raise(self, tagName, aboveThis=None):
3996
- """Change the priority of tag TAGNAME such that it is higher
3997
- than the priority of ABOVETHIS."""
3998
- self.tk.call(
3999
- self._w, 'tag', 'raise', tagName, aboveThis)
4000
-
4001
- def tag_ranges(self, tagName):
4002
- """Return a list of ranges of text which have tag TAGNAME."""
4003
- return self.tk.splitlist(self.tk.call(
4004
- self._w, 'tag', 'ranges', tagName))
4005
-
4006
- def tag_remove(self, tagName, index1, index2=None):
4007
- """Remove tag TAGNAME from all characters between INDEX1 and INDEX2."""
4008
- self.tk.call(
4009
- self._w, 'tag', 'remove', tagName, index1, index2)
4010
-
4011
- def window_cget(self, index, option):
4012
- """Return the value of OPTION of an embedded window at INDEX."""
4013
- if option[:1] != '-':
4014
- option = '-' + option
4015
- if option[-1:] == '_':
4016
- option = option[:-1]
4017
- return self.tk.call(self._w, 'window', 'cget', index, option)
4018
-
4019
- def window_configure(self, index, cnf=None, **kw):
4020
- """Configure an embedded window at INDEX."""
4021
- return self._configure(('window', 'configure', index), cnf, kw)
4022
-
4023
- window_config = window_configure
4024
-
4025
- def window_create(self, index, cnf={}, **kw):
4026
- """Create a window at INDEX."""
4027
- self.tk.call(
4028
- (self._w, 'window', 'create', index)
4029
- + self._options(cnf, kw))
4030
-
4031
- def window_names(self):
4032
- """Return all names of embedded windows in this widget."""
4033
- return self.tk.splitlist(
4034
- self.tk.call(self._w, 'window', 'names'))
4035
-
4036
- def yview_pickplace(self, *what):
4037
- """Obsolete function, use see."""
4038
- self.tk.call((self._w, 'yview', '-pickplace') + what)
4039
-
4040
-
4041
- class _setit:
4042
- """Internal class. It wraps the command in the widget OptionMenu."""
4043
-
4044
- def __init__(self, var, value, callback=None):
4045
- self.__value = value
4046
- self.__var = var
4047
- self.__callback = callback
4048
-
4049
- def __call__(self, *args):
4050
- self.__var.set(self.__value)
4051
- if self.__callback is not None:
4052
- self.__callback(self.__value, *args)
4053
-
4054
-
4055
- class OptionMenu(Menubutton):
4056
- """OptionMenu which allows the user to select a value from a menu."""
4057
-
4058
- def __init__(self, master, variable, value, *values, **kwargs):
4059
- """Construct an optionmenu widget with the parent MASTER, with
4060
- the resource textvariable set to VARIABLE, the initially selected
4061
- value VALUE, the other menu values VALUES and an additional
4062
- keyword argument command."""
4063
- kw = {"borderwidth": 2, "textvariable": variable,
4064
- "indicatoron": 1, "relief": RAISED, "anchor": "c",
4065
- "highlightthickness": 2}
4066
- Widget.__init__(self, master, "menubutton", kw)
4067
- self.widgetName = 'tk_optionMenu'
4068
- menu = self.__menu = Menu(self, name="menu", tearoff=0)
4069
- self.menuname = menu._w
4070
- # 'command' is the only supported keyword
4071
- callback = kwargs.get('command')
4072
- if 'command' in kwargs:
4073
- del kwargs['command']
4074
- if kwargs:
4075
- raise TclError('unknown option -'+next(iter(kwargs)))
4076
- menu.add_command(label=value,
4077
- command=_setit(variable, value, callback))
4078
- for v in values:
4079
- menu.add_command(label=v,
4080
- command=_setit(variable, v, callback))
4081
- self["menu"] = menu
4082
-
4083
- def __getitem__(self, name):
4084
- if name == 'menu':
4085
- return self.__menu
4086
- return Widget.__getitem__(self, name)
4087
-
4088
- def destroy(self):
4089
- """Destroy this widget and the associated menu."""
4090
- Menubutton.destroy(self)
4091
- self.__menu = None
4092
-
4093
-
4094
- class Image:
4095
- """Base class for images."""
4096
- _last_id = 0
4097
-
4098
- def __init__(self, imgtype, name=None, cnf={}, master=None, **kw):
4099
- self.name = None
4100
- if master is None:
4101
- master = _get_default_root('create image')
4102
- self.tk = getattr(master, 'tk', master)
4103
- if not name:
4104
- Image._last_id += 1
4105
- name = "pyimage%r" % (Image._last_id,) # tk itself would use image<x>
4106
- if kw and cnf: cnf = _cnfmerge((cnf, kw))
4107
- elif kw: cnf = kw
4108
- options = ()
4109
- for k, v in cnf.items():
4110
- options = options + ('-'+k, v)
4111
- self.tk.call(('image', 'create', imgtype, name,) + options)
4112
- self.name = name
4113
-
4114
- def __str__(self): return self.name
4115
-
4116
- def __del__(self):
4117
- if self.name:
4118
- try:
4119
- self.tk.call('image', 'delete', self.name)
4120
- except TclError:
4121
- # May happen if the root was destroyed
4122
- pass
4123
-
4124
- def __setitem__(self, key, value):
4125
- self.tk.call(self.name, 'configure', '-'+key, value)
4126
-
4127
- def __getitem__(self, key):
4128
- return self.tk.call(self.name, 'configure', '-'+key)
4129
-
4130
- def configure(self, **kw):
4131
- """Configure the image."""
4132
- res = ()
4133
- for k, v in _cnfmerge(kw).items():
4134
- if v is not None:
4135
- if k[-1] == '_': k = k[:-1]
4136
- res = res + ('-'+k, v)
4137
- self.tk.call((self.name, 'config') + res)
4138
-
4139
- config = configure
4140
-
4141
- def height(self):
4142
- """Return the height of the image."""
4143
- return self.tk.getint(
4144
- self.tk.call('image', 'height', self.name))
4145
-
4146
- def type(self):
4147
- """Return the type of the image, e.g. "photo" or "bitmap"."""
4148
- return self.tk.call('image', 'type', self.name)
4149
-
4150
- def width(self):
4151
- """Return the width of the image."""
4152
- return self.tk.getint(
4153
- self.tk.call('image', 'width', self.name))
4154
-
4155
-
4156
- class PhotoImage(Image):
4157
- """Widget which can display images in PGM, PPM, GIF, PNG format."""
4158
-
4159
- def __init__(self, name=None, cnf={}, master=None, **kw):
4160
- """Create an image with NAME.
4161
-
4162
- Valid resource names: data, format, file, gamma, height, palette,
4163
- width."""
4164
- Image.__init__(self, 'photo', name, cnf, master, **kw)
4165
-
4166
- def blank(self):
4167
- """Display a transparent image."""
4168
- self.tk.call(self.name, 'blank')
4169
-
4170
- def cget(self, option):
4171
- """Return the value of OPTION."""
4172
- return self.tk.call(self.name, 'cget', '-' + option)
4173
- # XXX config
4174
-
4175
- def __getitem__(self, key):
4176
- return self.tk.call(self.name, 'cget', '-' + key)
4177
- # XXX copy -from, -to, ...?
4178
-
4179
- def copy(self):
4180
- """Return a new PhotoImage with the same image as this widget."""
4181
- destImage = PhotoImage(master=self.tk)
4182
- self.tk.call(destImage, 'copy', self.name)
4183
- return destImage
4184
-
4185
- def zoom(self, x, y=''):
4186
- """Return a new PhotoImage with the same image as this widget
4187
- but zoom it with a factor of x in the X direction and y in the Y
4188
- direction. If y is not given, the default value is the same as x.
4189
- """
4190
- destImage = PhotoImage(master=self.tk)
4191
- if y=='': y=x
4192
- self.tk.call(destImage, 'copy', self.name, '-zoom',x,y)
4193
- return destImage
4194
-
4195
- def subsample(self, x, y=''):
4196
- """Return a new PhotoImage based on the same image as this widget
4197
- but use only every Xth or Yth pixel. If y is not given, the
4198
- default value is the same as x.
4199
- """
4200
- destImage = PhotoImage(master=self.tk)
4201
- if y=='': y=x
4202
- self.tk.call(destImage, 'copy', self.name, '-subsample',x,y)
4203
- return destImage
4204
-
4205
- def get(self, x, y):
4206
- """Return the color (red, green, blue) of the pixel at X,Y."""
4207
- return self.tk.call(self.name, 'get', x, y)
4208
-
4209
- def put(self, data, to=None):
4210
- """Put row formatted colors to image starting from
4211
- position TO, e.g. image.put("{red green} {blue yellow}", to=(4,6))"""
4212
- args = (self.name, 'put', data)
4213
- if to:
4214
- if to[0] == '-to':
4215
- to = to[1:]
4216
- args = args + ('-to',) + tuple(to)
4217
- self.tk.call(args)
4218
- # XXX read
4219
-
4220
- def write(self, filename, format=None, from_coords=None):
4221
- """Write image to file FILENAME in FORMAT starting from
4222
- position FROM_COORDS."""
4223
- args = (self.name, 'write', filename)
4224
- if format:
4225
- args = args + ('-format', format)
4226
- if from_coords:
4227
- args = args + ('-from',) + tuple(from_coords)
4228
- self.tk.call(args)
4229
-
4230
- def transparency_get(self, x, y):
4231
- """Return True if the pixel at x,y is transparent."""
4232
- return self.tk.getboolean(self.tk.call(
4233
- self.name, 'transparency', 'get', x, y))
4234
-
4235
- def transparency_set(self, x, y, boolean):
4236
- """Set the transparency of the pixel at x,y."""
4237
- self.tk.call(self.name, 'transparency', 'set', x, y, boolean)
4238
-
4239
-
4240
- class BitmapImage(Image):
4241
- """Widget which can display images in XBM format."""
4242
-
4243
- def __init__(self, name=None, cnf={}, master=None, **kw):
4244
- """Create a bitmap with NAME.
4245
-
4246
- Valid resource names: background, data, file, foreground, maskdata, maskfile."""
4247
- Image.__init__(self, 'bitmap', name, cnf, master, **kw)
4248
-
4249
-
4250
- def image_names():
4251
- tk = _get_default_root('use image_names()').tk
4252
- return tk.splitlist(tk.call('image', 'names'))
4253
-
4254
-
4255
- def image_types():
4256
- tk = _get_default_root('use image_types()').tk
4257
- return tk.splitlist(tk.call('image', 'types'))
4258
-
4259
-
4260
- class Spinbox(Widget, XView):
4261
- """spinbox widget."""
4262
-
4263
- def __init__(self, master=None, cnf={}, **kw):
4264
- """Construct a spinbox widget with the parent MASTER.
4265
-
4266
- STANDARD OPTIONS
4267
-
4268
- activebackground, background, borderwidth,
4269
- cursor, exportselection, font, foreground,
4270
- highlightbackground, highlightcolor,
4271
- highlightthickness, insertbackground,
4272
- insertborderwidth, insertofftime,
4273
- insertontime, insertwidth, justify, relief,
4274
- repeatdelay, repeatinterval,
4275
- selectbackground, selectborderwidth
4276
- selectforeground, takefocus, textvariable
4277
- xscrollcommand.
4278
-
4279
- WIDGET-SPECIFIC OPTIONS
4280
-
4281
- buttonbackground, buttoncursor,
4282
- buttondownrelief, buttonuprelief,
4283
- command, disabledbackground,
4284
- disabledforeground, format, from,
4285
- invalidcommand, increment,
4286
- readonlybackground, state, to,
4287
- validate, validatecommand values,
4288
- width, wrap,
4289
- """
4290
- Widget.__init__(self, master, 'spinbox', cnf, kw)
4291
-
4292
- def bbox(self, index):
4293
- """Return a tuple of X1,Y1,X2,Y2 coordinates for a
4294
- rectangle which encloses the character given by index.
4295
-
4296
- The first two elements of the list give the x and y
4297
- coordinates of the upper-left corner of the screen
4298
- area covered by the character (in pixels relative
4299
- to the widget) and the last two elements give the
4300
- width and height of the character, in pixels. The
4301
- bounding box may refer to a region outside the
4302
- visible area of the window.
4303
- """
4304
- return self._getints(self.tk.call(self._w, 'bbox', index)) or None
4305
-
4306
- def delete(self, first, last=None):
4307
- """Delete one or more elements of the spinbox.
4308
-
4309
- First is the index of the first character to delete,
4310
- and last is the index of the character just after
4311
- the last one to delete. If last isn't specified it
4312
- defaults to first+1, i.e. a single character is
4313
- deleted. This command returns an empty string.
4314
- """
4315
- return self.tk.call(self._w, 'delete', first, last)
4316
-
4317
- def get(self):
4318
- """Returns the spinbox's string"""
4319
- return self.tk.call(self._w, 'get')
4320
-
4321
- def icursor(self, index):
4322
- """Alter the position of the insertion cursor.
4323
-
4324
- The insertion cursor will be displayed just before
4325
- the character given by index. Returns an empty string
4326
- """
4327
- return self.tk.call(self._w, 'icursor', index)
4328
-
4329
- def identify(self, x, y):
4330
- """Returns the name of the widget at position x, y
4331
-
4332
- Return value is one of: none, buttondown, buttonup, entry
4333
- """
4334
- return self.tk.call(self._w, 'identify', x, y)
4335
-
4336
- def index(self, index):
4337
- """Returns the numerical index corresponding to index
4338
- """
4339
- return self.tk.call(self._w, 'index', index)
4340
-
4341
- def insert(self, index, s):
4342
- """Insert string s at index
4343
-
4344
- Returns an empty string.
4345
- """
4346
- return self.tk.call(self._w, 'insert', index, s)
4347
-
4348
- def invoke(self, element):
4349
- """Causes the specified element to be invoked
4350
-
4351
- The element could be buttondown or buttonup
4352
- triggering the action associated with it.
4353
- """
4354
- return self.tk.call(self._w, 'invoke', element)
4355
-
4356
- def scan(self, *args):
4357
- """Internal function."""
4358
- return self._getints(
4359
- self.tk.call((self._w, 'scan') + args)) or ()
4360
-
4361
- def scan_mark(self, x):
4362
- """Records x and the current view in the spinbox window;
4363
-
4364
- used in conjunction with later scan dragto commands.
4365
- Typically this command is associated with a mouse button
4366
- press in the widget. It returns an empty string.
4367
- """
4368
- return self.scan("mark", x)
4369
-
4370
- def scan_dragto(self, x):
4371
- """Compute the difference between the given x argument
4372
- and the x argument to the last scan mark command
4373
-
4374
- It then adjusts the view left or right by 10 times the
4375
- difference in x-coordinates. This command is typically
4376
- associated with mouse motion events in the widget, to
4377
- produce the effect of dragging the spinbox at high speed
4378
- through the window. The return value is an empty string.
4379
- """
4380
- return self.scan("dragto", x)
4381
-
4382
- def selection(self, *args):
4383
- """Internal function."""
4384
- return self._getints(
4385
- self.tk.call((self._w, 'selection') + args)) or ()
4386
-
4387
- def selection_adjust(self, index):
4388
- """Locate the end of the selection nearest to the character
4389
- given by index,
4390
-
4391
- Then adjust that end of the selection to be at index
4392
- (i.e including but not going beyond index). The other
4393
- end of the selection is made the anchor point for future
4394
- select to commands. If the selection isn't currently in
4395
- the spinbox, then a new selection is created to include
4396
- the characters between index and the most recent selection
4397
- anchor point, inclusive.
4398
- """
4399
- return self.selection("adjust", index)
4400
-
4401
- def selection_clear(self):
4402
- """Clear the selection
4403
-
4404
- If the selection isn't in this widget then the
4405
- command has no effect.
4406
- """
4407
- return self.selection("clear")
4408
-
4409
- def selection_element(self, element=None):
4410
- """Sets or gets the currently selected element.
4411
-
4412
- If a spinbutton element is specified, it will be
4413
- displayed depressed.
4414
- """
4415
- return self.tk.call(self._w, 'selection', 'element', element)
4416
-
4417
- def selection_from(self, index):
4418
- """Set the fixed end of a selection to INDEX."""
4419
- self.selection('from', index)
4420
-
4421
- def selection_present(self):
4422
- """Return True if there are characters selected in the spinbox, False
4423
- otherwise."""
4424
- return self.tk.getboolean(
4425
- self.tk.call(self._w, 'selection', 'present'))
4426
-
4427
- def selection_range(self, start, end):
4428
- """Set the selection from START to END (not included)."""
4429
- self.selection('range', start, end)
4430
-
4431
- def selection_to(self, index):
4432
- """Set the variable end of a selection to INDEX."""
4433
- self.selection('to', index)
4434
-
4435
- ###########################################################################
4436
-
4437
-
4438
- class LabelFrame(Widget):
4439
- """labelframe widget."""
4440
-
4441
- def __init__(self, master=None, cnf={}, **kw):
4442
- """Construct a labelframe widget with the parent MASTER.
4443
-
4444
- STANDARD OPTIONS
4445
-
4446
- borderwidth, cursor, font, foreground,
4447
- highlightbackground, highlightcolor,
4448
- highlightthickness, padx, pady, relief,
4449
- takefocus, text
4450
-
4451
- WIDGET-SPECIFIC OPTIONS
4452
-
4453
- background, class, colormap, container,
4454
- height, labelanchor, labelwidget,
4455
- visual, width
4456
- """
4457
- Widget.__init__(self, master, 'labelframe', cnf, kw)
4458
-
4459
- ########################################################################
4460
-
4461
-
4462
- class PanedWindow(Widget):
4463
- """panedwindow widget."""
4464
-
4465
- def __init__(self, master=None, cnf={}, **kw):
4466
- """Construct a panedwindow widget with the parent MASTER.
4467
-
4468
- STANDARD OPTIONS
4469
-
4470
- background, borderwidth, cursor, height,
4471
- orient, relief, width
4472
-
4473
- WIDGET-SPECIFIC OPTIONS
4474
-
4475
- handlepad, handlesize, opaqueresize,
4476
- sashcursor, sashpad, sashrelief,
4477
- sashwidth, showhandle,
4478
- """
4479
- Widget.__init__(self, master, 'panedwindow', cnf, kw)
4480
-
4481
- def add(self, child, **kw):
4482
- """Add a child widget to the panedwindow in a new pane.
4483
-
4484
- The child argument is the name of the child widget
4485
- followed by pairs of arguments that specify how to
4486
- manage the windows. The possible options and values
4487
- are the ones accepted by the paneconfigure method.
4488
- """
4489
- self.tk.call((self._w, 'add', child) + self._options(kw))
4490
-
4491
- def remove(self, child):
4492
- """Remove the pane containing child from the panedwindow
4493
-
4494
- All geometry management options for child will be forgotten.
4495
- """
4496
- self.tk.call(self._w, 'forget', child)
4497
-
4498
- forget = remove
4499
-
4500
- def identify(self, x, y):
4501
- """Identify the panedwindow component at point x, y
4502
-
4503
- If the point is over a sash or a sash handle, the result
4504
- is a two element list containing the index of the sash or
4505
- handle, and a word indicating whether it is over a sash
4506
- or a handle, such as {0 sash} or {2 handle}. If the point
4507
- is over any other part of the panedwindow, the result is
4508
- an empty list.
4509
- """
4510
- return self.tk.call(self._w, 'identify', x, y)
4511
-
4512
- def proxy(self, *args):
4513
- """Internal function."""
4514
- return self._getints(
4515
- self.tk.call((self._w, 'proxy') + args)) or ()
4516
-
4517
- def proxy_coord(self):
4518
- """Return the x and y pair of the most recent proxy location
4519
- """
4520
- return self.proxy("coord")
4521
-
4522
- def proxy_forget(self):
4523
- """Remove the proxy from the display.
4524
- """
4525
- return self.proxy("forget")
4526
-
4527
- def proxy_place(self, x, y):
4528
- """Place the proxy at the given x and y coordinates.
4529
- """
4530
- return self.proxy("place", x, y)
4531
-
4532
- def sash(self, *args):
4533
- """Internal function."""
4534
- return self._getints(
4535
- self.tk.call((self._w, 'sash') + args)) or ()
4536
-
4537
- def sash_coord(self, index):
4538
- """Return the current x and y pair for the sash given by index.
4539
-
4540
- Index must be an integer between 0 and 1 less than the
4541
- number of panes in the panedwindow. The coordinates given are
4542
- those of the top left corner of the region containing the sash.
4543
- pathName sash dragto index x y This command computes the
4544
- difference between the given coordinates and the coordinates
4545
- given to the last sash coord command for the given sash. It then
4546
- moves that sash the computed difference. The return value is the
4547
- empty string.
4548
- """
4549
- return self.sash("coord", index)
4550
-
4551
- def sash_mark(self, index):
4552
- """Records x and y for the sash given by index;
4553
-
4554
- Used in conjunction with later dragto commands to move the sash.
4555
- """
4556
- return self.sash("mark", index)
4557
-
4558
- def sash_place(self, index, x, y):
4559
- """Place the sash given by index at the given coordinates
4560
- """
4561
- return self.sash("place", index, x, y)
4562
-
4563
- def panecget(self, child, option):
4564
- """Query a management option for window.
4565
-
4566
- Option may be any value allowed by the paneconfigure subcommand
4567
- """
4568
- return self.tk.call(
4569
- (self._w, 'panecget') + (child, '-'+option))
4570
-
4571
- def paneconfigure(self, tagOrId, cnf=None, **kw):
4572
- """Query or modify the management options for window.
4573
-
4574
- If no option is specified, returns a list describing all
4575
- of the available options for pathName. If option is
4576
- specified with no value, then the command returns a list
4577
- describing the one named option (this list will be identical
4578
- to the corresponding sublist of the value returned if no
4579
- option is specified). If one or more option-value pairs are
4580
- specified, then the command modifies the given widget
4581
- option(s) to have the given value(s); in this case the
4582
- command returns an empty string. The following options
4583
- are supported:
4584
-
4585
- after window
4586
- Insert the window after the window specified. window
4587
- should be the name of a window already managed by pathName.
4588
- before window
4589
- Insert the window before the window specified. window
4590
- should be the name of a window already managed by pathName.
4591
- height size
4592
- Specify a height for the window. The height will be the
4593
- outer dimension of the window including its border, if
4594
- any. If size is an empty string, or if -height is not
4595
- specified, then the height requested internally by the
4596
- window will be used initially; the height may later be
4597
- adjusted by the movement of sashes in the panedwindow.
4598
- Size may be any value accepted by Tk_GetPixels.
4599
- minsize n
4600
- Specifies that the size of the window cannot be made
4601
- less than n. This constraint only affects the size of
4602
- the widget in the paned dimension -- the x dimension
4603
- for horizontal panedwindows, the y dimension for
4604
- vertical panedwindows. May be any value accepted by
4605
- Tk_GetPixels.
4606
- padx n
4607
- Specifies a non-negative value indicating how much
4608
- extra space to leave on each side of the window in
4609
- the X-direction. The value may have any of the forms
4610
- accepted by Tk_GetPixels.
4611
- pady n
4612
- Specifies a non-negative value indicating how much
4613
- extra space to leave on each side of the window in
4614
- the Y-direction. The value may have any of the forms
4615
- accepted by Tk_GetPixels.
4616
- sticky style
4617
- If a window's pane is larger than the requested
4618
- dimensions of the window, this option may be used
4619
- to position (or stretch) the window within its pane.
4620
- Style is a string that contains zero or more of the
4621
- characters n, s, e or w. The string can optionally
4622
- contains spaces or commas, but they are ignored. Each
4623
- letter refers to a side (north, south, east, or west)
4624
- that the window will "stick" to. If both n and s
4625
- (or e and w) are specified, the window will be
4626
- stretched to fill the entire height (or width) of
4627
- its cavity.
4628
- width size
4629
- Specify a width for the window. The width will be
4630
- the outer dimension of the window including its
4631
- border, if any. If size is an empty string, or
4632
- if -width is not specified, then the width requested
4633
- internally by the window will be used initially; the
4634
- width may later be adjusted by the movement of sashes
4635
- in the panedwindow. Size may be any value accepted by
4636
- Tk_GetPixels.
4637
-
4638
- """
4639
- if cnf is None and not kw:
4640
- return self._getconfigure(self._w, 'paneconfigure', tagOrId)
4641
- if isinstance(cnf, str) and not kw:
4642
- return self._getconfigure1(
4643
- self._w, 'paneconfigure', tagOrId, '-'+cnf)
4644
- self.tk.call((self._w, 'paneconfigure', tagOrId) +
4645
- self._options(cnf, kw))
4646
-
4647
- paneconfig = paneconfigure
4648
-
4649
- def panes(self):
4650
- """Returns an ordered list of the child panes."""
4651
- return self.tk.splitlist(self.tk.call(self._w, 'panes'))
4652
-
4653
- # Test:
4654
-
4655
-
4656
- def _test():
4657
- root = Tk()
4658
- text = "This is Tcl/Tk %s" % root.globalgetvar('tk_patchLevel')
4659
- text += "\nThis should be a cedilla: \xe7"
4660
- label = Label(root, text=text)
4661
- label.pack()
4662
- test = Button(root, text="Click me!",
4663
- command=lambda root=root: root.test.configure(
4664
- text="[%s]" % root.test['text']))
4665
- test.pack()
4666
- root.test = test
4667
- quit = Button(root, text="QUIT", command=root.destroy)
4668
- quit.pack()
4669
- # The following three commands are needed so the window pops
4670
- # up on top on Windows...
4671
- root.iconify()
4672
- root.update()
4673
- root.deiconify()
4674
- root.mainloop()
4675
-
4676
-
4677
- __all__ = [name for name, obj in globals().items()
4678
- if not name.startswith('_') and not isinstance(obj, types.ModuleType)
4679
- and name not in {'wantobjects'}]
4680
-
4681
- if __name__ == '__main__':
4682
- _test()