cmd2 2.5.2__tar.gz → 2.5.4__tar.gz

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 (354) hide show
  1. {cmd2-2.5.2 → cmd2-2.5.4}/CHANGELOG.md +12 -2
  2. {cmd2-2.5.2 → cmd2-2.5.4}/PKG-INFO +41 -22
  3. {cmd2-2.5.2 → cmd2-2.5.4}/cmd2/cmd2.py +6 -5
  4. {cmd2-2.5.2 → cmd2-2.5.4}/cmd2/command_definition.py +27 -5
  5. {cmd2-2.5.2 → cmd2-2.5.4}/cmd2/constants.py +3 -0
  6. {cmd2-2.5.2 → cmd2-2.5.4}/cmd2/utils.py +2 -1
  7. {cmd2-2.5.2 → cmd2-2.5.4}/cmd2.egg-info/PKG-INFO +41 -22
  8. {cmd2-2.5.2 → cmd2-2.5.4}/cmd2.egg-info/SOURCES.txt +0 -105
  9. {cmd2-2.5.2 → cmd2-2.5.4}/cmd2.egg-info/requires.txt +12 -8
  10. {cmd2-2.5.2 → cmd2-2.5.4}/docs/conf.py +11 -4
  11. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/ext_test/tasks.py +2 -2
  12. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/template/tasks.py +2 -2
  13. {cmd2-2.5.2 → cmd2-2.5.4}/pyproject.toml +105 -0
  14. {cmd2-2.5.2 → cmd2-2.5.4}/tasks.py +35 -46
  15. {cmd2-2.5.2 → cmd2-2.5.4}/tests/test_argparse.py +2 -4
  16. {cmd2-2.5.2 → cmd2-2.5.4}/tests/test_argparse_completer.py +1 -2
  17. {cmd2-2.5.2 → cmd2-2.5.4}/tests/test_completion.py +2 -2
  18. {cmd2-2.5.2 → cmd2-2.5.4}/tests/test_utils.py +6 -9
  19. {cmd2-2.5.2 → cmd2-2.5.4}/tests_isolated/test_commandset/test_argparse_subcommands.py +1 -2
  20. {cmd2-2.5.2 → cmd2-2.5.4}/tests_isolated/test_commandset/test_commandset.py +8 -3
  21. cmd2-2.5.2/examples/.mypy_cache/3.12/@plugins_snapshot.json +0 -1
  22. cmd2-2.5.2/examples/.mypy_cache/3.12/_ast.data.json +0 -1
  23. cmd2-2.5.2/examples/.mypy_cache/3.12/_ast.meta.json +0 -1
  24. cmd2-2.5.2/examples/.mypy_cache/3.12/_codecs.data.json +0 -1
  25. cmd2-2.5.2/examples/.mypy_cache/3.12/_codecs.meta.json +0 -1
  26. cmd2-2.5.2/examples/.mypy_cache/3.12/_collections_abc.data.json +0 -1
  27. cmd2-2.5.2/examples/.mypy_cache/3.12/_collections_abc.meta.json +0 -1
  28. cmd2-2.5.2/examples/.mypy_cache/3.12/_typeshed/__init__.data.json +0 -1
  29. cmd2-2.5.2/examples/.mypy_cache/3.12/_typeshed/__init__.meta.json +0 -1
  30. cmd2-2.5.2/examples/.mypy_cache/3.12/_typeshed/importlib.data.json +0 -1
  31. cmd2-2.5.2/examples/.mypy_cache/3.12/_typeshed/importlib.meta.json +0 -1
  32. cmd2-2.5.2/examples/.mypy_cache/3.12/abc.data.json +0 -1
  33. cmd2-2.5.2/examples/.mypy_cache/3.12/abc.meta.json +0 -1
  34. cmd2-2.5.2/examples/.mypy_cache/3.12/argparse.data.json +0 -1
  35. cmd2-2.5.2/examples/.mypy_cache/3.12/argparse.meta.json +0 -1
  36. cmd2-2.5.2/examples/.mypy_cache/3.12/builtins.data.json +0 -1
  37. cmd2-2.5.2/examples/.mypy_cache/3.12/builtins.meta.json +0 -1
  38. cmd2-2.5.2/examples/.mypy_cache/3.12/codecs.data.json +0 -1
  39. cmd2-2.5.2/examples/.mypy_cache/3.12/codecs.meta.json +0 -1
  40. cmd2-2.5.2/examples/.mypy_cache/3.12/collections/__init__.data.json +0 -1
  41. cmd2-2.5.2/examples/.mypy_cache/3.12/collections/__init__.meta.json +0 -1
  42. cmd2-2.5.2/examples/.mypy_cache/3.12/collections/abc.data.json +0 -1
  43. cmd2-2.5.2/examples/.mypy_cache/3.12/collections/abc.meta.json +0 -1
  44. cmd2-2.5.2/examples/.mypy_cache/3.12/contextlib.data.json +0 -1
  45. cmd2-2.5.2/examples/.mypy_cache/3.12/contextlib.meta.json +0 -1
  46. cmd2-2.5.2/examples/.mypy_cache/3.12/dataclasses.data.json +0 -1
  47. cmd2-2.5.2/examples/.mypy_cache/3.12/dataclasses.meta.json +0 -1
  48. cmd2-2.5.2/examples/.mypy_cache/3.12/email/__init__.data.json +0 -1
  49. cmd2-2.5.2/examples/.mypy_cache/3.12/email/__init__.meta.json +0 -1
  50. cmd2-2.5.2/examples/.mypy_cache/3.12/email/_policybase.data.json +0 -1
  51. cmd2-2.5.2/examples/.mypy_cache/3.12/email/_policybase.meta.json +0 -1
  52. cmd2-2.5.2/examples/.mypy_cache/3.12/email/charset.data.json +0 -1
  53. cmd2-2.5.2/examples/.mypy_cache/3.12/email/charset.meta.json +0 -1
  54. cmd2-2.5.2/examples/.mypy_cache/3.12/email/contentmanager.data.json +0 -1
  55. cmd2-2.5.2/examples/.mypy_cache/3.12/email/contentmanager.meta.json +0 -1
  56. cmd2-2.5.2/examples/.mypy_cache/3.12/email/errors.data.json +0 -1
  57. cmd2-2.5.2/examples/.mypy_cache/3.12/email/errors.meta.json +0 -1
  58. cmd2-2.5.2/examples/.mypy_cache/3.12/email/header.data.json +0 -1
  59. cmd2-2.5.2/examples/.mypy_cache/3.12/email/header.meta.json +0 -1
  60. cmd2-2.5.2/examples/.mypy_cache/3.12/email/message.data.json +0 -1
  61. cmd2-2.5.2/examples/.mypy_cache/3.12/email/message.meta.json +0 -1
  62. cmd2-2.5.2/examples/.mypy_cache/3.12/email/policy.data.json +0 -1
  63. cmd2-2.5.2/examples/.mypy_cache/3.12/email/policy.meta.json +0 -1
  64. cmd2-2.5.2/examples/.mypy_cache/3.12/enum.data.json +0 -1
  65. cmd2-2.5.2/examples/.mypy_cache/3.12/enum.meta.json +0 -1
  66. cmd2-2.5.2/examples/.mypy_cache/3.12/genericpath.data.json +0 -1
  67. cmd2-2.5.2/examples/.mypy_cache/3.12/genericpath.meta.json +0 -1
  68. cmd2-2.5.2/examples/.mypy_cache/3.12/importlib/__init__.data.json +0 -1
  69. cmd2-2.5.2/examples/.mypy_cache/3.12/importlib/__init__.meta.json +0 -1
  70. cmd2-2.5.2/examples/.mypy_cache/3.12/importlib/_abc.data.json +0 -1
  71. cmd2-2.5.2/examples/.mypy_cache/3.12/importlib/_abc.meta.json +0 -1
  72. cmd2-2.5.2/examples/.mypy_cache/3.12/importlib/abc.data.json +0 -1
  73. cmd2-2.5.2/examples/.mypy_cache/3.12/importlib/abc.meta.json +0 -1
  74. cmd2-2.5.2/examples/.mypy_cache/3.12/importlib/machinery.data.json +0 -1
  75. cmd2-2.5.2/examples/.mypy_cache/3.12/importlib/machinery.meta.json +0 -1
  76. cmd2-2.5.2/examples/.mypy_cache/3.12/importlib/metadata/__init__.data.json +0 -1
  77. cmd2-2.5.2/examples/.mypy_cache/3.12/importlib/metadata/__init__.meta.json +0 -1
  78. cmd2-2.5.2/examples/.mypy_cache/3.12/importlib/metadata/_meta.data.json +0 -1
  79. cmd2-2.5.2/examples/.mypy_cache/3.12/importlib/metadata/_meta.meta.json +0 -1
  80. cmd2-2.5.2/examples/.mypy_cache/3.12/importlib/readers.data.json +0 -1
  81. cmd2-2.5.2/examples/.mypy_cache/3.12/importlib/readers.meta.json +0 -1
  82. cmd2-2.5.2/examples/.mypy_cache/3.12/importlib/resources/__init__.data.json +0 -1
  83. cmd2-2.5.2/examples/.mypy_cache/3.12/importlib/resources/__init__.meta.json +0 -1
  84. cmd2-2.5.2/examples/.mypy_cache/3.12/importlib/resources/abc.data.json +0 -1
  85. cmd2-2.5.2/examples/.mypy_cache/3.12/importlib/resources/abc.meta.json +0 -1
  86. cmd2-2.5.2/examples/.mypy_cache/3.12/io.data.json +0 -1
  87. cmd2-2.5.2/examples/.mypy_cache/3.12/io.meta.json +0 -1
  88. cmd2-2.5.2/examples/.mypy_cache/3.12/os/__init__.data.json +0 -1
  89. cmd2-2.5.2/examples/.mypy_cache/3.12/os/__init__.meta.json +0 -1
  90. cmd2-2.5.2/examples/.mypy_cache/3.12/os/path.data.json +0 -1
  91. cmd2-2.5.2/examples/.mypy_cache/3.12/os/path.meta.json +0 -1
  92. cmd2-2.5.2/examples/.mypy_cache/3.12/pathlib.data.json +0 -1
  93. cmd2-2.5.2/examples/.mypy_cache/3.12/pathlib.meta.json +0 -1
  94. cmd2-2.5.2/examples/.mypy_cache/3.12/posixpath.data.json +0 -1
  95. cmd2-2.5.2/examples/.mypy_cache/3.12/posixpath.meta.json +0 -1
  96. cmd2-2.5.2/examples/.mypy_cache/3.12/re.data.json +0 -1
  97. cmd2-2.5.2/examples/.mypy_cache/3.12/re.meta.json +0 -1
  98. cmd2-2.5.2/examples/.mypy_cache/3.12/resource.data.json +0 -1
  99. cmd2-2.5.2/examples/.mypy_cache/3.12/resource.meta.json +0 -1
  100. cmd2-2.5.2/examples/.mypy_cache/3.12/sre_compile.data.json +0 -1
  101. cmd2-2.5.2/examples/.mypy_cache/3.12/sre_compile.meta.json +0 -1
  102. cmd2-2.5.2/examples/.mypy_cache/3.12/sre_constants.data.json +0 -1
  103. cmd2-2.5.2/examples/.mypy_cache/3.12/sre_constants.meta.json +0 -1
  104. cmd2-2.5.2/examples/.mypy_cache/3.12/sre_parse.data.json +0 -1
  105. cmd2-2.5.2/examples/.mypy_cache/3.12/sre_parse.meta.json +0 -1
  106. cmd2-2.5.2/examples/.mypy_cache/3.12/subprocess.data.json +0 -1
  107. cmd2-2.5.2/examples/.mypy_cache/3.12/subprocess.meta.json +0 -1
  108. cmd2-2.5.2/examples/.mypy_cache/3.12/sys/__init__.data.json +0 -1
  109. cmd2-2.5.2/examples/.mypy_cache/3.12/sys/__init__.meta.json +0 -1
  110. cmd2-2.5.2/examples/.mypy_cache/3.12/sys/_monitoring.data.json +0 -1
  111. cmd2-2.5.2/examples/.mypy_cache/3.12/sys/_monitoring.meta.json +0 -1
  112. cmd2-2.5.2/examples/.mypy_cache/3.12/types.data.json +0 -1
  113. cmd2-2.5.2/examples/.mypy_cache/3.12/types.meta.json +0 -1
  114. cmd2-2.5.2/examples/.mypy_cache/3.12/typing.data.json +0 -1
  115. cmd2-2.5.2/examples/.mypy_cache/3.12/typing.meta.json +0 -1
  116. cmd2-2.5.2/examples/.mypy_cache/3.12/typing_extensions.data.json +0 -1
  117. cmd2-2.5.2/examples/.mypy_cache/3.12/typing_extensions.meta.json +0 -1
  118. cmd2-2.5.2/examples/.mypy_cache/3.12/zipfile/__init__.data.json +0 -1
  119. cmd2-2.5.2/examples/.mypy_cache/3.12/zipfile/__init__.meta.json +0 -1
  120. cmd2-2.5.2/examples/.mypy_cache/3.12/zipfile/_path.data.json +0 -1
  121. cmd2-2.5.2/examples/.mypy_cache/3.12/zipfile/_path.meta.json +0 -1
  122. cmd2-2.5.2/examples/.mypy_cache/CACHEDIR.TAG +0 -3
  123. cmd2-2.5.2/examples/cmd2_history.dat +0 -0
  124. cmd2-2.5.2/noxfile.py +0 -41
  125. cmd2-2.5.2/setup.py +0 -117
  126. {cmd2-2.5.2 → cmd2-2.5.4}/.readthedocs.yaml +0 -0
  127. {cmd2-2.5.2 → cmd2-2.5.4}/LICENSE +0 -0
  128. {cmd2-2.5.2 → cmd2-2.5.4}/MANIFEST.in +0 -0
  129. {cmd2-2.5.2 → cmd2-2.5.4}/Pipfile +0 -0
  130. {cmd2-2.5.2 → cmd2-2.5.4}/README.md +0 -0
  131. {cmd2-2.5.2 → cmd2-2.5.4}/cmd2/__init__.py +0 -0
  132. {cmd2-2.5.2 → cmd2-2.5.4}/cmd2/ansi.py +0 -0
  133. {cmd2-2.5.2 → cmd2-2.5.4}/cmd2/argparse_completer.py +0 -0
  134. {cmd2-2.5.2 → cmd2-2.5.4}/cmd2/argparse_custom.py +0 -0
  135. {cmd2-2.5.2 → cmd2-2.5.4}/cmd2/clipboard.py +0 -0
  136. {cmd2-2.5.2 → cmd2-2.5.4}/cmd2/decorators.py +0 -0
  137. {cmd2-2.5.2 → cmd2-2.5.4}/cmd2/exceptions.py +0 -0
  138. {cmd2-2.5.2 → cmd2-2.5.4}/cmd2/history.py +0 -0
  139. {cmd2-2.5.2 → cmd2-2.5.4}/cmd2/parsing.py +0 -0
  140. {cmd2-2.5.2 → cmd2-2.5.4}/cmd2/plugin.py +0 -0
  141. {cmd2-2.5.2 → cmd2-2.5.4}/cmd2/py.typed +0 -0
  142. {cmd2-2.5.2 → cmd2-2.5.4}/cmd2/py_bridge.py +0 -0
  143. {cmd2-2.5.2 → cmd2-2.5.4}/cmd2/rl_utils.py +0 -0
  144. {cmd2-2.5.2 → cmd2-2.5.4}/cmd2/table_creator.py +0 -0
  145. {cmd2-2.5.2 → cmd2-2.5.4}/cmd2/transcript.py +0 -0
  146. {cmd2-2.5.2 → cmd2-2.5.4}/cmd2.egg-info/dependency_links.txt +0 -0
  147. {cmd2-2.5.2 → cmd2-2.5.4}/cmd2.egg-info/top_level.txt +0 -0
  148. {cmd2-2.5.2 → cmd2-2.5.4}/cmd2.png +0 -0
  149. {cmd2-2.5.2 → cmd2-2.5.4}/docs/Makefile +0 -0
  150. {cmd2-2.5.2 → cmd2-2.5.4}/docs/api/ansi.rst +0 -0
  151. {cmd2-2.5.2 → cmd2-2.5.4}/docs/api/argparse_completer.rst +0 -0
  152. {cmd2-2.5.2 → cmd2-2.5.4}/docs/api/argparse_custom.rst +0 -0
  153. {cmd2-2.5.2 → cmd2-2.5.4}/docs/api/cmd.rst +0 -0
  154. {cmd2-2.5.2 → cmd2-2.5.4}/docs/api/command_definition.rst +0 -0
  155. {cmd2-2.5.2 → cmd2-2.5.4}/docs/api/constants.rst +0 -0
  156. {cmd2-2.5.2 → cmd2-2.5.4}/docs/api/decorators.rst +0 -0
  157. {cmd2-2.5.2 → cmd2-2.5.4}/docs/api/exceptions.rst +0 -0
  158. {cmd2-2.5.2 → cmd2-2.5.4}/docs/api/history.rst +0 -0
  159. {cmd2-2.5.2 → cmd2-2.5.4}/docs/api/index.rst +0 -0
  160. {cmd2-2.5.2 → cmd2-2.5.4}/docs/api/parsing.rst +0 -0
  161. {cmd2-2.5.2 → cmd2-2.5.4}/docs/api/plugin.rst +0 -0
  162. {cmd2-2.5.2 → cmd2-2.5.4}/docs/api/plugin_external_test.rst +0 -0
  163. {cmd2-2.5.2 → cmd2-2.5.4}/docs/api/py_bridge.rst +0 -0
  164. {cmd2-2.5.2 → cmd2-2.5.4}/docs/api/table_creator.rst +0 -0
  165. {cmd2-2.5.2 → cmd2-2.5.4}/docs/api/utils.rst +0 -0
  166. {cmd2-2.5.2 → cmd2-2.5.4}/docs/doc_conventions.rst +0 -0
  167. {cmd2-2.5.2 → cmd2-2.5.4}/docs/examples/alternate_event_loops.rst +0 -0
  168. {cmd2-2.5.2 → cmd2-2.5.4}/docs/examples/first_app.rst +0 -0
  169. {cmd2-2.5.2 → cmd2-2.5.4}/docs/examples/index.rst +0 -0
  170. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/argument_processing.rst +0 -0
  171. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/builtin_commands.rst +0 -0
  172. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/clipboard.rst +0 -0
  173. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/commands.rst +0 -0
  174. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/completion.rst +0 -0
  175. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/disable_commands.rst +0 -0
  176. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/embedded_python_shells.rst +0 -0
  177. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/generating_output.rst +0 -0
  178. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/help.rst +0 -0
  179. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/history.rst +0 -0
  180. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/hooks.rst +0 -0
  181. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/index.rst +0 -0
  182. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/initialization.rst +0 -0
  183. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/misc.rst +0 -0
  184. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/modular_commands.rst +0 -0
  185. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/multiline_commands.rst +0 -0
  186. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/os.rst +0 -0
  187. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/packaging.rst +0 -0
  188. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/plugins.rst +0 -0
  189. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/prompt.rst +0 -0
  190. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/redirection.rst +0 -0
  191. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/scripting.rst +0 -0
  192. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/settings.rst +0 -0
  193. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/shortcuts_aliases_macros.rst +0 -0
  194. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/startup_commands.rst +0 -0
  195. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/table_creation.rst +0 -0
  196. {cmd2-2.5.2 → cmd2-2.5.4}/docs/features/transcripts.rst +0 -0
  197. {cmd2-2.5.2 → cmd2-2.5.4}/docs/index.rst +0 -0
  198. {cmd2-2.5.2 → cmd2-2.5.4}/docs/make.bat +0 -0
  199. {cmd2-2.5.2 → cmd2-2.5.4}/docs/migrating/incompatibilities.rst +0 -0
  200. {cmd2-2.5.2 → cmd2-2.5.4}/docs/migrating/index.rst +0 -0
  201. {cmd2-2.5.2 → cmd2-2.5.4}/docs/migrating/minimum.rst +0 -0
  202. {cmd2-2.5.2 → cmd2-2.5.4}/docs/migrating/next_steps.rst +0 -0
  203. {cmd2-2.5.2 → cmd2-2.5.4}/docs/migrating/summary.rst +0 -0
  204. {cmd2-2.5.2 → cmd2-2.5.4}/docs/migrating/why.rst +0 -0
  205. {cmd2-2.5.2 → cmd2-2.5.4}/docs/overview/alternatives.rst +0 -0
  206. {cmd2-2.5.2 → cmd2-2.5.4}/docs/overview/index.rst +0 -0
  207. {cmd2-2.5.2 → cmd2-2.5.4}/docs/overview/installation.rst +0 -0
  208. {cmd2-2.5.2 → cmd2-2.5.4}/docs/overview/integrating.rst +0 -0
  209. {cmd2-2.5.2 → cmd2-2.5.4}/docs/overview/resources.rst +0 -0
  210. {cmd2-2.5.2 → cmd2-2.5.4}/docs/overview/summary.rst +0 -0
  211. {cmd2-2.5.2 → cmd2-2.5.4}/docs/plugins/external_test.rst +0 -0
  212. {cmd2-2.5.2 → cmd2-2.5.4}/docs/plugins/index.rst +0 -0
  213. {cmd2-2.5.2 → cmd2-2.5.4}/docs/requirements.txt +0 -0
  214. {cmd2-2.5.2 → cmd2-2.5.4}/docs/testing.rst +0 -0
  215. {cmd2-2.5.2 → cmd2-2.5.4}/examples/.cmd2rc +0 -0
  216. {cmd2-2.5.2 → cmd2-2.5.4}/examples/alias_startup.py +0 -0
  217. {cmd2-2.5.2 → cmd2-2.5.4}/examples/arg_decorators.py +0 -0
  218. {cmd2-2.5.2 → cmd2-2.5.4}/examples/arg_print.py +0 -0
  219. {cmd2-2.5.2 → cmd2-2.5.4}/examples/argparse_completion.py +0 -0
  220. {cmd2-2.5.2 → cmd2-2.5.4}/examples/async_printing.py +0 -0
  221. {cmd2-2.5.2 → cmd2-2.5.4}/examples/basic.py +0 -0
  222. {cmd2-2.5.2 → cmd2-2.5.4}/examples/basic_completion.py +0 -0
  223. {cmd2-2.5.2 → cmd2-2.5.4}/examples/cmd_as_argument.py +0 -0
  224. {cmd2-2.5.2 → cmd2-2.5.4}/examples/colors.py +0 -0
  225. {cmd2-2.5.2 → cmd2-2.5.4}/examples/custom_parser.py +0 -0
  226. {cmd2-2.5.2 → cmd2-2.5.4}/examples/decorator_example.py +0 -0
  227. {cmd2-2.5.2 → cmd2-2.5.4}/examples/default_categories.py +0 -0
  228. {cmd2-2.5.2 → cmd2-2.5.4}/examples/dynamic_commands.py +0 -0
  229. {cmd2-2.5.2 → cmd2-2.5.4}/examples/environment.py +0 -0
  230. {cmd2-2.5.2 → cmd2-2.5.4}/examples/event_loops.py +0 -0
  231. {cmd2-2.5.2 → cmd2-2.5.4}/examples/example.py +0 -0
  232. {cmd2-2.5.2 → cmd2-2.5.4}/examples/exit_code.py +0 -0
  233. {cmd2-2.5.2 → cmd2-2.5.4}/examples/first_app.py +0 -0
  234. {cmd2-2.5.2 → cmd2-2.5.4}/examples/hello_cmd2.py +0 -0
  235. {cmd2-2.5.2 → cmd2-2.5.4}/examples/help_categories.py +0 -0
  236. {cmd2-2.5.2 → cmd2-2.5.4}/examples/hooks.py +0 -0
  237. {cmd2-2.5.2 → cmd2-2.5.4}/examples/initialization.py +0 -0
  238. {cmd2-2.5.2 → cmd2-2.5.4}/examples/migrating.py +0 -0
  239. {cmd2-2.5.2 → cmd2-2.5.4}/examples/modular_commands/__init__.py +0 -0
  240. {cmd2-2.5.2 → cmd2-2.5.4}/examples/modular_commands/commandset_basic.py +0 -0
  241. {cmd2-2.5.2 → cmd2-2.5.4}/examples/modular_commands/commandset_complex.py +0 -0
  242. {cmd2-2.5.2 → cmd2-2.5.4}/examples/modular_commands/commandset_custominit.py +0 -0
  243. {cmd2-2.5.2 → cmd2-2.5.4}/examples/modular_commands_basic.py +0 -0
  244. {cmd2-2.5.2 → cmd2-2.5.4}/examples/modular_commands_dynamic.py +0 -0
  245. {cmd2-2.5.2 → cmd2-2.5.4}/examples/modular_commands_main.py +0 -0
  246. {cmd2-2.5.2 → cmd2-2.5.4}/examples/modular_subcommands.py +0 -0
  247. {cmd2-2.5.2 → cmd2-2.5.4}/examples/override_parser.py +0 -0
  248. {cmd2-2.5.2 → cmd2-2.5.4}/examples/paged_output.py +0 -0
  249. {cmd2-2.5.2 → cmd2-2.5.4}/examples/persistent_history.py +0 -0
  250. {cmd2-2.5.2 → cmd2-2.5.4}/examples/pirate.py +0 -0
  251. {cmd2-2.5.2 → cmd2-2.5.4}/examples/python_scripting.py +0 -0
  252. {cmd2-2.5.2 → cmd2-2.5.4}/examples/read_input.py +0 -0
  253. {cmd2-2.5.2 → cmd2-2.5.4}/examples/remove_builtin_commands.py +0 -0
  254. {cmd2-2.5.2 → cmd2-2.5.4}/examples/remove_settable.py +0 -0
  255. {cmd2-2.5.2 → cmd2-2.5.4}/examples/scripts/arg_printer.py +0 -0
  256. {cmd2-2.5.2 → cmd2-2.5.4}/examples/scripts/conditional.py +0 -0
  257. {cmd2-2.5.2 → cmd2-2.5.4}/examples/scripts/nested.txt +0 -0
  258. {cmd2-2.5.2 → cmd2-2.5.4}/examples/scripts/quit.txt +0 -0
  259. {cmd2-2.5.2 → cmd2-2.5.4}/examples/scripts/save_help_text.py +0 -0
  260. {cmd2-2.5.2 → cmd2-2.5.4}/examples/scripts/script.py +0 -0
  261. {cmd2-2.5.2 → cmd2-2.5.4}/examples/scripts/script.txt +0 -0
  262. {cmd2-2.5.2 → cmd2-2.5.4}/examples/subcommands.py +0 -0
  263. {cmd2-2.5.2 → cmd2-2.5.4}/examples/table_creation.py +0 -0
  264. {cmd2-2.5.2 → cmd2-2.5.4}/examples/transcripts/exampleSession.txt +0 -0
  265. {cmd2-2.5.2 → cmd2-2.5.4}/examples/transcripts/pirate.transcript +0 -0
  266. {cmd2-2.5.2 → cmd2-2.5.4}/examples/transcripts/quit.txt +0 -0
  267. {cmd2-2.5.2 → cmd2-2.5.4}/examples/transcripts/transcript_regex.txt +0 -0
  268. {cmd2-2.5.2 → cmd2-2.5.4}/examples/unicode_commands.py +0 -0
  269. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/README.txt +0 -0
  270. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/ext_test/CHANGELOG.md +0 -0
  271. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/ext_test/README.md +0 -0
  272. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/ext_test/build-pyenvs.sh +0 -0
  273. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/ext_test/cmd2_ext_test/__init__.py +0 -0
  274. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/ext_test/cmd2_ext_test/cmd2_ext_test.py +0 -0
  275. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/ext_test/cmd2_ext_test/py.typed +0 -0
  276. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/ext_test/cmd2_ext_test/pylintrc +0 -0
  277. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/ext_test/examples/example.py +0 -0
  278. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/ext_test/noxfile.py +0 -0
  279. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/ext_test/pyproject.toml +0 -0
  280. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/ext_test/setup.py +0 -0
  281. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/ext_test/tests/__init__.py +0 -0
  282. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/ext_test/tests/pylintrc +0 -0
  283. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/ext_test/tests/test_ext_test.py +0 -0
  284. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/tasks.py +0 -0
  285. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/template/CHANGELOG.md +0 -0
  286. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/template/LICENSE +0 -0
  287. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/template/README.md +0 -0
  288. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/template/build-pyenvs.sh +0 -0
  289. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/template/cmd2_myplugin/__init__.py +0 -0
  290. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/template/cmd2_myplugin/myplugin.py +0 -0
  291. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/template/cmd2_myplugin/pylintrc +0 -0
  292. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/template/examples/example.py +0 -0
  293. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/template/noxfile.py +0 -0
  294. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/template/setup.py +0 -0
  295. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/template/tests/__init__.py +0 -0
  296. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/template/tests/pylintrc +0 -0
  297. {cmd2-2.5.2 → cmd2-2.5.4}/plugins/template/tests/test_myplugin.py +0 -0
  298. {cmd2-2.5.2 → cmd2-2.5.4}/readme_files/shout_out.csv +0 -0
  299. {cmd2-2.5.2 → cmd2-2.5.4}/readme_files/shoutout.txt +0 -0
  300. {cmd2-2.5.2 → cmd2-2.5.4}/setup.cfg +0 -0
  301. {cmd2-2.5.2 → cmd2-2.5.4}/tests/.cmd2rc +0 -0
  302. {cmd2-2.5.2 → cmd2-2.5.4}/tests/__init__.py +0 -0
  303. {cmd2-2.5.2 → cmd2-2.5.4}/tests/conftest.py +0 -0
  304. {cmd2-2.5.2 → cmd2-2.5.4}/tests/pyscript/echo.py +0 -0
  305. {cmd2-2.5.2 → cmd2-2.5.4}/tests/pyscript/environment.py +0 -0
  306. {cmd2-2.5.2 → cmd2-2.5.4}/tests/pyscript/help.py +0 -0
  307. {cmd2-2.5.2 → cmd2-2.5.4}/tests/pyscript/py_locals.py +0 -0
  308. {cmd2-2.5.2 → cmd2-2.5.4}/tests/pyscript/pyscript_dir.py +0 -0
  309. {cmd2-2.5.2 → cmd2-2.5.4}/tests/pyscript/raises_exception.py +0 -0
  310. {cmd2-2.5.2 → cmd2-2.5.4}/tests/pyscript/recursive.py +0 -0
  311. {cmd2-2.5.2 → cmd2-2.5.4}/tests/pyscript/self_in_py.py +0 -0
  312. {cmd2-2.5.2 → cmd2-2.5.4}/tests/pyscript/stdout_capture.py +0 -0
  313. {cmd2-2.5.2 → cmd2-2.5.4}/tests/pyscript/stop.py +0 -0
  314. {cmd2-2.5.2 → cmd2-2.5.4}/tests/relative_multiple.txt +0 -0
  315. {cmd2-2.5.2 → cmd2-2.5.4}/tests/script.py +0 -0
  316. {cmd2-2.5.2 → cmd2-2.5.4}/tests/script.txt +0 -0
  317. {cmd2-2.5.2 → cmd2-2.5.4}/tests/scripts/binary.bin +0 -0
  318. {cmd2-2.5.2 → cmd2-2.5.4}/tests/scripts/empty.txt +0 -0
  319. {cmd2-2.5.2 → cmd2-2.5.4}/tests/scripts/help.txt +0 -0
  320. {cmd2-2.5.2 → cmd2-2.5.4}/tests/scripts/nested.txt +0 -0
  321. {cmd2-2.5.2 → cmd2-2.5.4}/tests/scripts/one_down.txt +0 -0
  322. {cmd2-2.5.2 → cmd2-2.5.4}/tests/scripts/postcmds.txt +0 -0
  323. {cmd2-2.5.2 → cmd2-2.5.4}/tests/scripts/precmds.txt +0 -0
  324. {cmd2-2.5.2 → cmd2-2.5.4}/tests/scripts/utf8.txt +0 -0
  325. {cmd2-2.5.2 → cmd2-2.5.4}/tests/test_ansi.py +0 -0
  326. {cmd2-2.5.2 → cmd2-2.5.4}/tests/test_argparse_custom.py +0 -0
  327. {cmd2-2.5.2 → cmd2-2.5.4}/tests/test_cmd2.py +0 -0
  328. {cmd2-2.5.2 → cmd2-2.5.4}/tests/test_history.py +0 -0
  329. {cmd2-2.5.2 → cmd2-2.5.4}/tests/test_parsing.py +0 -0
  330. {cmd2-2.5.2 → cmd2-2.5.4}/tests/test_plugin.py +0 -0
  331. {cmd2-2.5.2 → cmd2-2.5.4}/tests/test_run_pyscript.py +0 -0
  332. {cmd2-2.5.2 → cmd2-2.5.4}/tests/test_table_creator.py +0 -0
  333. {cmd2-2.5.2 → cmd2-2.5.4}/tests/test_transcript.py +0 -0
  334. {cmd2-2.5.2 → cmd2-2.5.4}/tests/test_utils_defining_class.py +0 -0
  335. {cmd2-2.5.2 → cmd2-2.5.4}/tests/transcripts/bol_eol.txt +0 -0
  336. {cmd2-2.5.2 → cmd2-2.5.4}/tests/transcripts/characterclass.txt +0 -0
  337. {cmd2-2.5.2 → cmd2-2.5.4}/tests/transcripts/dotstar.txt +0 -0
  338. {cmd2-2.5.2 → cmd2-2.5.4}/tests/transcripts/extension_notation.txt +0 -0
  339. {cmd2-2.5.2 → cmd2-2.5.4}/tests/transcripts/failure.txt +0 -0
  340. {cmd2-2.5.2 → cmd2-2.5.4}/tests/transcripts/from_cmdloop.txt +0 -0
  341. {cmd2-2.5.2 → cmd2-2.5.4}/tests/transcripts/multiline_no_regex.txt +0 -0
  342. {cmd2-2.5.2 → cmd2-2.5.4}/tests/transcripts/multiline_regex.txt +0 -0
  343. {cmd2-2.5.2 → cmd2-2.5.4}/tests/transcripts/no_output.txt +0 -0
  344. {cmd2-2.5.2 → cmd2-2.5.4}/tests/transcripts/no_output_last.txt +0 -0
  345. {cmd2-2.5.2 → cmd2-2.5.4}/tests/transcripts/regex_set.txt +0 -0
  346. {cmd2-2.5.2 → cmd2-2.5.4}/tests/transcripts/singleslash.txt +0 -0
  347. {cmd2-2.5.2 → cmd2-2.5.4}/tests/transcripts/slashes_escaped.txt +0 -0
  348. {cmd2-2.5.2 → cmd2-2.5.4}/tests/transcripts/slashslash.txt +0 -0
  349. {cmd2-2.5.2 → cmd2-2.5.4}/tests/transcripts/spaces.txt +0 -0
  350. {cmd2-2.5.2 → cmd2-2.5.4}/tests/transcripts/word_boundaries.txt +0 -0
  351. {cmd2-2.5.2 → cmd2-2.5.4}/tests_isolated/__init__.py +0 -0
  352. {cmd2-2.5.2 → cmd2-2.5.4}/tests_isolated/test_commandset/__init__.py +0 -0
  353. {cmd2-2.5.2 → cmd2-2.5.4}/tests_isolated/test_commandset/conftest.py +0 -0
  354. {cmd2-2.5.2 → cmd2-2.5.4}/tests_isolated/test_commandset/test_categories.py +0 -0
@@ -1,8 +1,18 @@
1
- # 2.5.2 (November 3, 2024)
1
+ ## 2.5.4 (November 6, 2024)
2
+ * Bug Fixes
3
+ * Fixed `ZeroDivisionError` in `async_alert()` when `shutil.get_terminal_size().columns` is 0.
4
+
5
+ ## 2.5.3 (November 5, 2024)
6
+ * Enhancements
7
+ * Changed `CommandSet._cmd` to a read-only property which never returns `None` because it
8
+ is meant to be called after the `CommandSet` is registered. This addresses type checker
9
+ errors that occurred if `CommandSet._cmd` wasn't cast or checked if `None` before use.
10
+
11
+ ## 2.5.2 (November 3, 2024)
2
12
  * Bug Fixes
3
13
  * Fixed default `pytest` execution when not using cmd2's custom `invoke` command via `inv pytest`
4
14
 
5
- # 2.5.1 (November 2, 2024)
15
+ ## 2.5.1 (November 2, 2024)
6
16
  * Bug Fixes
7
17
  * Fixed readline bug when using `ipy` command with `gnureadline` and Python 3.13
8
18
 
@@ -1,62 +1,81 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cmd2
3
- Version: 2.5.2
3
+ Version: 2.5.4
4
4
  Summary: cmd2 - quickly build feature-rich and user-friendly interactive command line applications in Python
5
- Home-page: https://github.com/python-cmd2/cmd2
6
- Author: Catherine Devlin
7
- Author-email: catherine.devlin@gmail.com
8
- License: MIT
9
- Keywords: command prompt console cmd
10
- Platform: any
5
+ Author: cmd2 Contributors
6
+ License: The MIT License (MIT)
7
+
8
+ Copyright (c) 2008-2024 Catherine Devlin and others
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in
18
+ all copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26
+ THE SOFTWARE.
27
+
28
+ Keywords: CLI,cmd,command,interactive,prompt,Python
11
29
  Classifier: Development Status :: 5 - Production/Stable
12
30
  Classifier: Environment :: Console
13
31
  Classifier: Operating System :: OS Independent
14
32
  Classifier: Intended Audience :: Developers
15
33
  Classifier: Intended Audience :: System Administrators
16
34
  Classifier: License :: OSI Approved :: MIT License
17
- Classifier: Programming Language :: Python
18
- Classifier: Programming Language :: Python :: 3
35
+ Classifier: Programming Language :: Python :: 3 :: Only
19
36
  Classifier: Programming Language :: Python :: 3.8
20
37
  Classifier: Programming Language :: Python :: 3.9
21
38
  Classifier: Programming Language :: Python :: 3.10
22
39
  Classifier: Programming Language :: Python :: 3.11
23
40
  Classifier: Programming Language :: Python :: 3.12
24
41
  Classifier: Programming Language :: Python :: 3.13
25
- Classifier: Programming Language :: Python :: Implementation :: CPython
26
42
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
27
43
  Requires-Python: >=3.8
28
44
  Description-Content-Type: text/markdown
29
45
  License-File: LICENSE
46
+ Requires-Dist: gnureadline; platform_system == "Darwin"
30
47
  Requires-Dist: pyperclip
48
+ Requires-Dist: pyreadline3; platform_system == "Windows"
31
49
  Requires-Dist: wcwidth
32
- Requires-Dist: pyreadline3; sys_platform == "win32"
33
- Provides-Extra: test
34
- Requires-Dist: gnureadline; sys_platform == "darwin" and extra == "test"
35
- Requires-Dist: codecov; extra == "test"
36
- Requires-Dist: coverage; extra == "test"
37
- Requires-Dist: pytest; extra == "test"
38
- Requires-Dist: pytest-cov; extra == "test"
39
- Requires-Dist: pytest-mock; extra == "test"
50
+ Provides-Extra: build
51
+ Requires-Dist: build; extra == "build"
52
+ Requires-Dist: setuptools; extra == "build"
53
+ Requires-Dist: setuptools-scm; extra == "build"
40
54
  Provides-Extra: dev
41
55
  Requires-Dist: codecov; extra == "dev"
42
56
  Requires-Dist: doc8; extra == "dev"
43
57
  Requires-Dist: invoke; extra == "dev"
44
58
  Requires-Dist: mypy; extra == "dev"
45
- Requires-Dist: nox; extra == "dev"
46
- Requires-Dist: pytest>=4.6; extra == "dev"
59
+ Requires-Dist: pytest; extra == "dev"
47
60
  Requires-Dist: pytest-cov; extra == "dev"
48
61
  Requires-Dist: pytest-mock; extra == "dev"
49
62
  Requires-Dist: sphinx; extra == "dev"
50
- Requires-Dist: sphinx-rtd-theme; extra == "dev"
51
63
  Requires-Dist: sphinx-autobuild; extra == "dev"
64
+ Requires-Dist: sphinx-rtd-theme; extra == "dev"
52
65
  Requires-Dist: ruff; extra == "dev"
53
66
  Requires-Dist: twine; extra == "dev"
54
67
  Provides-Extra: docs
55
68
  Requires-Dist: setuptools; extra == "docs"
56
69
  Requires-Dist: setuptools_scm; extra == "docs"
57
70
  Requires-Dist: sphinx; extra == "docs"
58
- Requires-Dist: sphinx-rtd-theme; extra == "docs"
59
71
  Requires-Dist: sphinx-autobuild; extra == "docs"
72
+ Requires-Dist: sphinx-rtd-theme; extra == "docs"
73
+ Provides-Extra: test
74
+ Requires-Dist: codecov; extra == "test"
75
+ Requires-Dist: coverage; extra == "test"
76
+ Requires-Dist: pytest; extra == "test"
77
+ Requires-Dist: pytest-cov; extra == "test"
78
+ Requires-Dist: pytest-mock; extra == "test"
60
79
  Provides-Extra: validate
61
80
  Requires-Dist: mypy; extra == "validate"
62
81
  Requires-Dist: ruff; extra == "validate"
@@ -3404,8 +3404,7 @@ class Cmd(cmd.Cmd):
3404
3404
  alias_description = "Manage aliases\n" "\n" "An alias is a command that enables replacement of a word by another string."
3405
3405
  alias_epilog = "See also:\n" " macro"
3406
3406
  alias_parser = argparse_custom.DEFAULT_ARGUMENT_PARSER(description=alias_description, epilog=alias_epilog)
3407
- alias_subparsers = alias_parser.add_subparsers(dest='subcommand', metavar='SUBCOMMAND')
3408
- alias_subparsers.required = True
3407
+ alias_parser.add_subparsers(dest='subcommand', metavar='SUBCOMMAND', required=True)
3409
3408
 
3410
3409
  # Preserve quotes since we are passing strings to other commands
3411
3410
  @with_argparser(alias_parser, preserve_quotes=True)
@@ -3573,8 +3572,7 @@ class Cmd(cmd.Cmd):
3573
3572
  macro_description = "Manage macros\n" "\n" "A macro is similar to an alias, but it can contain argument placeholders."
3574
3573
  macro_epilog = "See also:\n" " alias"
3575
3574
  macro_parser = argparse_custom.DEFAULT_ARGUMENT_PARSER(description=macro_description, epilog=macro_epilog)
3576
- macro_subparsers = macro_parser.add_subparsers(dest='subcommand', metavar='SUBCOMMAND')
3577
- macro_subparsers.required = True
3575
+ macro_parser.add_subparsers(dest='subcommand', metavar='SUBCOMMAND', required=True)
3578
3576
 
3579
3577
  # Preserve quotes since we are passing strings to other commands
3580
3578
  @with_argparser(macro_parser, preserve_quotes=True)
@@ -5337,9 +5335,12 @@ class Cmd(cmd.Cmd):
5337
5335
  if update_terminal:
5338
5336
  import shutil
5339
5337
 
5338
+ # Prior to Python 3.11 this can return 0, so use a fallback if needed.
5339
+ terminal_columns = shutil.get_terminal_size().columns or constants.DEFAULT_TERMINAL_WIDTH
5340
+
5340
5341
  # Print a string which replaces the onscreen prompt and input lines with the alert.
5341
5342
  terminal_str = ansi.async_alert_str(
5342
- terminal_columns=shutil.get_terminal_size().columns,
5343
+ terminal_columns=terminal_columns,
5343
5344
  prompt=rl_get_display_prompt(),
5344
5345
  line=readline.get_line_buffer(),
5345
5346
  cursor_offset=rl_get_point(),
@@ -92,10 +92,31 @@ class CommandSet(object):
92
92
  """
93
93
 
94
94
  def __init__(self) -> None:
95
- self._cmd: Optional[cmd2.Cmd] = None
95
+ # Private reference to the CLI instance in which this CommandSet running.
96
+ # This will be set when the CommandSet is registered and it should be
97
+ # accessed by child classes using the self._cmd property.
98
+ self.__cmd_internal: Optional[cmd2.Cmd] = None
99
+
96
100
  self._settables: Dict[str, Settable] = {}
97
101
  self._settable_prefix = self.__class__.__name__
98
102
 
103
+ @property
104
+ def _cmd(self) -> 'cmd2.Cmd':
105
+ """
106
+ Property for child classes to access self.__cmd_internal.
107
+
108
+ Using this property ensures that self.__cmd_internal has been set
109
+ and it tells type checkers that it's no longer a None type.
110
+
111
+ Override this property if you need to change its return type to a
112
+ child class of Cmd.
113
+
114
+ :raises: CommandSetRegistrationError if CommandSet is not registered.
115
+ """
116
+ if self.__cmd_internal is None:
117
+ raise CommandSetRegistrationError('This CommandSet is not registered')
118
+ return self.__cmd_internal
119
+
99
120
  def on_register(self, cmd: 'cmd2.Cmd') -> None:
100
121
  """
101
122
  Called by cmd2.Cmd as the first step to registering a CommandSet. The commands defined in this class have
@@ -103,9 +124,10 @@ class CommandSet(object):
103
124
  requiring access to the Cmd object (e.g. configure commands and their parsers based on CLI state data).
104
125
 
105
126
  :param cmd: The cmd2 main application
127
+ :raises: CommandSetRegistrationError if CommandSet is already registered.
106
128
  """
107
- if self._cmd is None:
108
- self._cmd = cmd
129
+ if self.__cmd_internal is None:
130
+ self.__cmd_internal = cmd
109
131
  else:
110
132
  raise CommandSetRegistrationError('This CommandSet has already been registered')
111
133
 
@@ -129,7 +151,7 @@ class CommandSet(object):
129
151
  Called by ``cmd2.Cmd`` after a CommandSet has been unregistered and all its commands removed from the CLI.
130
152
  Subclasses can override this to perform remaining cleanup steps.
131
153
  """
132
- self._cmd = None
154
+ self.__cmd_internal = None
133
155
 
134
156
  @property
135
157
  def settable_prefix(self) -> str:
@@ -145,7 +167,7 @@ class CommandSet(object):
145
167
 
146
168
  :param settable: Settable object being added
147
169
  """
148
- if self._cmd:
170
+ if self.__cmd_internal is not None:
149
171
  if not self._cmd.always_prefix_settables:
150
172
  if settable.name in self._cmd.settables.keys() and settable.name not in self._settables.keys():
151
173
  raise KeyError(f'Duplicate settable: {settable.name}')
@@ -57,3 +57,6 @@ PARSER_ATTR_COMMANDSET = 'command_set'
57
57
 
58
58
  # custom attributes added to argparse Namespaces
59
59
  NS_ATTR_SUBCMD_HANDLER = '__subcmd_handler__'
60
+
61
+ # For cases prior to Python 3.11 when shutil.get_terminal_size().columns can return 0.
62
+ DEFAULT_TERMINAL_WIDTH = 80
@@ -874,7 +874,8 @@ def align_text(
874
874
  )
875
875
 
876
876
  if width is None:
877
- width = shutil.get_terminal_size().columns
877
+ # Prior to Python 3.11 this can return 0, so use a fallback if needed.
878
+ width = shutil.get_terminal_size().columns or constants.DEFAULT_TERMINAL_WIDTH
878
879
 
879
880
  if width < 1:
880
881
  raise ValueError("width must be at least 1")
@@ -1,62 +1,81 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cmd2
3
- Version: 2.5.2
3
+ Version: 2.5.4
4
4
  Summary: cmd2 - quickly build feature-rich and user-friendly interactive command line applications in Python
5
- Home-page: https://github.com/python-cmd2/cmd2
6
- Author: Catherine Devlin
7
- Author-email: catherine.devlin@gmail.com
8
- License: MIT
9
- Keywords: command prompt console cmd
10
- Platform: any
5
+ Author: cmd2 Contributors
6
+ License: The MIT License (MIT)
7
+
8
+ Copyright (c) 2008-2024 Catherine Devlin and others
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in
18
+ all copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26
+ THE SOFTWARE.
27
+
28
+ Keywords: CLI,cmd,command,interactive,prompt,Python
11
29
  Classifier: Development Status :: 5 - Production/Stable
12
30
  Classifier: Environment :: Console
13
31
  Classifier: Operating System :: OS Independent
14
32
  Classifier: Intended Audience :: Developers
15
33
  Classifier: Intended Audience :: System Administrators
16
34
  Classifier: License :: OSI Approved :: MIT License
17
- Classifier: Programming Language :: Python
18
- Classifier: Programming Language :: Python :: 3
35
+ Classifier: Programming Language :: Python :: 3 :: Only
19
36
  Classifier: Programming Language :: Python :: 3.8
20
37
  Classifier: Programming Language :: Python :: 3.9
21
38
  Classifier: Programming Language :: Python :: 3.10
22
39
  Classifier: Programming Language :: Python :: 3.11
23
40
  Classifier: Programming Language :: Python :: 3.12
24
41
  Classifier: Programming Language :: Python :: 3.13
25
- Classifier: Programming Language :: Python :: Implementation :: CPython
26
42
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
27
43
  Requires-Python: >=3.8
28
44
  Description-Content-Type: text/markdown
29
45
  License-File: LICENSE
46
+ Requires-Dist: gnureadline; platform_system == "Darwin"
30
47
  Requires-Dist: pyperclip
48
+ Requires-Dist: pyreadline3; platform_system == "Windows"
31
49
  Requires-Dist: wcwidth
32
- Requires-Dist: pyreadline3; sys_platform == "win32"
33
- Provides-Extra: test
34
- Requires-Dist: gnureadline; sys_platform == "darwin" and extra == "test"
35
- Requires-Dist: codecov; extra == "test"
36
- Requires-Dist: coverage; extra == "test"
37
- Requires-Dist: pytest; extra == "test"
38
- Requires-Dist: pytest-cov; extra == "test"
39
- Requires-Dist: pytest-mock; extra == "test"
50
+ Provides-Extra: build
51
+ Requires-Dist: build; extra == "build"
52
+ Requires-Dist: setuptools; extra == "build"
53
+ Requires-Dist: setuptools-scm; extra == "build"
40
54
  Provides-Extra: dev
41
55
  Requires-Dist: codecov; extra == "dev"
42
56
  Requires-Dist: doc8; extra == "dev"
43
57
  Requires-Dist: invoke; extra == "dev"
44
58
  Requires-Dist: mypy; extra == "dev"
45
- Requires-Dist: nox; extra == "dev"
46
- Requires-Dist: pytest>=4.6; extra == "dev"
59
+ Requires-Dist: pytest; extra == "dev"
47
60
  Requires-Dist: pytest-cov; extra == "dev"
48
61
  Requires-Dist: pytest-mock; extra == "dev"
49
62
  Requires-Dist: sphinx; extra == "dev"
50
- Requires-Dist: sphinx-rtd-theme; extra == "dev"
51
63
  Requires-Dist: sphinx-autobuild; extra == "dev"
64
+ Requires-Dist: sphinx-rtd-theme; extra == "dev"
52
65
  Requires-Dist: ruff; extra == "dev"
53
66
  Requires-Dist: twine; extra == "dev"
54
67
  Provides-Extra: docs
55
68
  Requires-Dist: setuptools; extra == "docs"
56
69
  Requires-Dist: setuptools_scm; extra == "docs"
57
70
  Requires-Dist: sphinx; extra == "docs"
58
- Requires-Dist: sphinx-rtd-theme; extra == "docs"
59
71
  Requires-Dist: sphinx-autobuild; extra == "docs"
72
+ Requires-Dist: sphinx-rtd-theme; extra == "docs"
73
+ Provides-Extra: test
74
+ Requires-Dist: codecov; extra == "test"
75
+ Requires-Dist: coverage; extra == "test"
76
+ Requires-Dist: pytest; extra == "test"
77
+ Requires-Dist: pytest-cov; extra == "test"
78
+ Requires-Dist: pytest-mock; extra == "test"
60
79
  Provides-Extra: validate
61
80
  Requires-Dist: mypy; extra == "validate"
62
81
  Requires-Dist: ruff; extra == "validate"
@@ -5,9 +5,7 @@ MANIFEST.in
5
5
  Pipfile
6
6
  README.md
7
7
  cmd2.png
8
- noxfile.py
9
8
  pyproject.toml
10
- setup.py
11
9
  tasks.py
12
10
  cmd2/__init__.py
13
11
  cmd2/ansi.py
@@ -108,7 +106,6 @@ examples/argparse_completion.py
108
106
  examples/async_printing.py
109
107
  examples/basic.py
110
108
  examples/basic_completion.py
111
- examples/cmd2_history.dat
112
109
  examples/cmd_as_argument.py
113
110
  examples/colors.py
114
111
  examples/custom_parser.py
@@ -140,108 +137,6 @@ examples/remove_settable.py
140
137
  examples/subcommands.py
141
138
  examples/table_creation.py
142
139
  examples/unicode_commands.py
143
- examples/.mypy_cache/CACHEDIR.TAG
144
- examples/.mypy_cache/3.12/@plugins_snapshot.json
145
- examples/.mypy_cache/3.12/_ast.data.json
146
- examples/.mypy_cache/3.12/_ast.meta.json
147
- examples/.mypy_cache/3.12/_codecs.data.json
148
- examples/.mypy_cache/3.12/_codecs.meta.json
149
- examples/.mypy_cache/3.12/_collections_abc.data.json
150
- examples/.mypy_cache/3.12/_collections_abc.meta.json
151
- examples/.mypy_cache/3.12/abc.data.json
152
- examples/.mypy_cache/3.12/abc.meta.json
153
- examples/.mypy_cache/3.12/argparse.data.json
154
- examples/.mypy_cache/3.12/argparse.meta.json
155
- examples/.mypy_cache/3.12/builtins.data.json
156
- examples/.mypy_cache/3.12/builtins.meta.json
157
- examples/.mypy_cache/3.12/codecs.data.json
158
- examples/.mypy_cache/3.12/codecs.meta.json
159
- examples/.mypy_cache/3.12/contextlib.data.json
160
- examples/.mypy_cache/3.12/contextlib.meta.json
161
- examples/.mypy_cache/3.12/dataclasses.data.json
162
- examples/.mypy_cache/3.12/dataclasses.meta.json
163
- examples/.mypy_cache/3.12/enum.data.json
164
- examples/.mypy_cache/3.12/enum.meta.json
165
- examples/.mypy_cache/3.12/genericpath.data.json
166
- examples/.mypy_cache/3.12/genericpath.meta.json
167
- examples/.mypy_cache/3.12/io.data.json
168
- examples/.mypy_cache/3.12/io.meta.json
169
- examples/.mypy_cache/3.12/pathlib.data.json
170
- examples/.mypy_cache/3.12/pathlib.meta.json
171
- examples/.mypy_cache/3.12/posixpath.data.json
172
- examples/.mypy_cache/3.12/posixpath.meta.json
173
- examples/.mypy_cache/3.12/re.data.json
174
- examples/.mypy_cache/3.12/re.meta.json
175
- examples/.mypy_cache/3.12/resource.data.json
176
- examples/.mypy_cache/3.12/resource.meta.json
177
- examples/.mypy_cache/3.12/sre_compile.data.json
178
- examples/.mypy_cache/3.12/sre_compile.meta.json
179
- examples/.mypy_cache/3.12/sre_constants.data.json
180
- examples/.mypy_cache/3.12/sre_constants.meta.json
181
- examples/.mypy_cache/3.12/sre_parse.data.json
182
- examples/.mypy_cache/3.12/sre_parse.meta.json
183
- examples/.mypy_cache/3.12/subprocess.data.json
184
- examples/.mypy_cache/3.12/subprocess.meta.json
185
- examples/.mypy_cache/3.12/types.data.json
186
- examples/.mypy_cache/3.12/types.meta.json
187
- examples/.mypy_cache/3.12/typing.data.json
188
- examples/.mypy_cache/3.12/typing.meta.json
189
- examples/.mypy_cache/3.12/typing_extensions.data.json
190
- examples/.mypy_cache/3.12/typing_extensions.meta.json
191
- examples/.mypy_cache/3.12/_typeshed/__init__.data.json
192
- examples/.mypy_cache/3.12/_typeshed/__init__.meta.json
193
- examples/.mypy_cache/3.12/_typeshed/importlib.data.json
194
- examples/.mypy_cache/3.12/_typeshed/importlib.meta.json
195
- examples/.mypy_cache/3.12/collections/__init__.data.json
196
- examples/.mypy_cache/3.12/collections/__init__.meta.json
197
- examples/.mypy_cache/3.12/collections/abc.data.json
198
- examples/.mypy_cache/3.12/collections/abc.meta.json
199
- examples/.mypy_cache/3.12/email/__init__.data.json
200
- examples/.mypy_cache/3.12/email/__init__.meta.json
201
- examples/.mypy_cache/3.12/email/_policybase.data.json
202
- examples/.mypy_cache/3.12/email/_policybase.meta.json
203
- examples/.mypy_cache/3.12/email/charset.data.json
204
- examples/.mypy_cache/3.12/email/charset.meta.json
205
- examples/.mypy_cache/3.12/email/contentmanager.data.json
206
- examples/.mypy_cache/3.12/email/contentmanager.meta.json
207
- examples/.mypy_cache/3.12/email/errors.data.json
208
- examples/.mypy_cache/3.12/email/errors.meta.json
209
- examples/.mypy_cache/3.12/email/header.data.json
210
- examples/.mypy_cache/3.12/email/header.meta.json
211
- examples/.mypy_cache/3.12/email/message.data.json
212
- examples/.mypy_cache/3.12/email/message.meta.json
213
- examples/.mypy_cache/3.12/email/policy.data.json
214
- examples/.mypy_cache/3.12/email/policy.meta.json
215
- examples/.mypy_cache/3.12/importlib/__init__.data.json
216
- examples/.mypy_cache/3.12/importlib/__init__.meta.json
217
- examples/.mypy_cache/3.12/importlib/_abc.data.json
218
- examples/.mypy_cache/3.12/importlib/_abc.meta.json
219
- examples/.mypy_cache/3.12/importlib/abc.data.json
220
- examples/.mypy_cache/3.12/importlib/abc.meta.json
221
- examples/.mypy_cache/3.12/importlib/machinery.data.json
222
- examples/.mypy_cache/3.12/importlib/machinery.meta.json
223
- examples/.mypy_cache/3.12/importlib/readers.data.json
224
- examples/.mypy_cache/3.12/importlib/readers.meta.json
225
- examples/.mypy_cache/3.12/importlib/metadata/__init__.data.json
226
- examples/.mypy_cache/3.12/importlib/metadata/__init__.meta.json
227
- examples/.mypy_cache/3.12/importlib/metadata/_meta.data.json
228
- examples/.mypy_cache/3.12/importlib/metadata/_meta.meta.json
229
- examples/.mypy_cache/3.12/importlib/resources/__init__.data.json
230
- examples/.mypy_cache/3.12/importlib/resources/__init__.meta.json
231
- examples/.mypy_cache/3.12/importlib/resources/abc.data.json
232
- examples/.mypy_cache/3.12/importlib/resources/abc.meta.json
233
- examples/.mypy_cache/3.12/os/__init__.data.json
234
- examples/.mypy_cache/3.12/os/__init__.meta.json
235
- examples/.mypy_cache/3.12/os/path.data.json
236
- examples/.mypy_cache/3.12/os/path.meta.json
237
- examples/.mypy_cache/3.12/sys/__init__.data.json
238
- examples/.mypy_cache/3.12/sys/__init__.meta.json
239
- examples/.mypy_cache/3.12/sys/_monitoring.data.json
240
- examples/.mypy_cache/3.12/sys/_monitoring.meta.json
241
- examples/.mypy_cache/3.12/zipfile/__init__.data.json
242
- examples/.mypy_cache/3.12/zipfile/__init__.meta.json
243
- examples/.mypy_cache/3.12/zipfile/_path.data.json
244
- examples/.mypy_cache/3.12/zipfile/_path.meta.json
245
140
  examples/modular_commands/__init__.py
246
141
  examples/modular_commands/commandset_basic.py
247
142
  examples/modular_commands/commandset_complex.py
@@ -1,21 +1,28 @@
1
1
  pyperclip
2
2
  wcwidth
3
3
 
4
- [:sys_platform=='win32']
4
+ [:platform_system == "Darwin"]
5
+ gnureadline
6
+
7
+ [:platform_system == "Windows"]
5
8
  pyreadline3
6
9
 
10
+ [build]
11
+ build
12
+ setuptools
13
+ setuptools-scm
14
+
7
15
  [dev]
8
16
  codecov
9
17
  doc8
10
18
  invoke
11
19
  mypy
12
- nox
13
- pytest>=4.6
20
+ pytest
14
21
  pytest-cov
15
22
  pytest-mock
16
23
  sphinx
17
- sphinx-rtd-theme
18
24
  sphinx-autobuild
25
+ sphinx-rtd-theme
19
26
  ruff
20
27
  twine
21
28
 
@@ -23,8 +30,8 @@ twine
23
30
  setuptools
24
31
  setuptools_scm
25
32
  sphinx
26
- sphinx-rtd-theme
27
33
  sphinx-autobuild
34
+ sphinx-rtd-theme
28
35
 
29
36
  [test]
30
37
  codecov
@@ -33,9 +40,6 @@ pytest
33
40
  pytest-cov
34
41
  pytest-mock
35
42
 
36
- [test:sys_platform == "darwin"]
37
- gnureadline
38
-
39
43
  [validate]
40
44
  mypy
41
45
  ruff
@@ -23,10 +23,13 @@ from importlib.metadata import version as get_version
23
23
  from os.path import abspath, dirname
24
24
 
25
25
  # Make sure we get the version of this copy of cmd2
26
- sys.path.insert(1, dirname(dirname(abspath(__file__))))
26
+ root_path = dirname(dirname(abspath(__file__)))
27
+ cmd2_ext_test_path = f'{root_path}/plugins/ext_test/'
28
+ sys.path.insert(1, root_path) # cmd2
29
+ sys.path.insert(2, cmd2_ext_test_path) # cmd2_ext_test
27
30
 
28
31
  # Import for custom theme from Read the Docs
29
- import sphinx_rtd_theme
32
+ import sphinx_rtd_theme # noqa E402
30
33
 
31
34
  # -- General configuration -----------------------------------------------------
32
35
 
@@ -179,9 +182,13 @@ autodoc_default_options = {'member-order': 'bysource'}
179
182
  # Ignore nitpicky warnings from autodoc which are occurring for very new versions of Sphinx and autodoc
180
183
  # They seem to be happening because autodoc is now trying to add hyperlinks to docs for typehint classes
181
184
  nitpick_ignore = [
182
- ('py:class', 'cmd2.decorators.CommandParent'),
183
- ('py:obj', 'cmd2.decorators.CommandParent'),
185
+ ('py:class', 'ArgparseCommandFunc'),
184
186
  ('py:class', 'argparse._SubParsersAction'),
187
+ ('py:class', 'cmd2.decorators.CommandParent'),
185
188
  ('py:class', 'cmd2.utils._T'),
189
+ ('py:class', 'CommandParent'),
190
+ ('py:class', 'frame'),
191
+ ('py:class', 'RawCommandFuncOptionalBoolReturn'),
186
192
  ('py:class', 'types.FrameType'),
193
+ ('py:obj', 'cmd2.decorators.CommandParent'),
187
194
  ]
@@ -157,7 +157,7 @@ namespace_clean.add_task(clean_all, 'all')
157
157
  def sdist(context):
158
158
  """Create a source distribution"""
159
159
  with context.cd(TASK_ROOT_STR):
160
- context.run('python setup.py sdist')
160
+ context.run('python -m build --sdist')
161
161
 
162
162
 
163
163
  namespace.add_task(sdist)
@@ -167,7 +167,7 @@ namespace.add_task(sdist)
167
167
  def wheel(context):
168
168
  """Build a wheel distribution"""
169
169
  with context.cd(TASK_ROOT_STR):
170
- context.run('python setup.py bdist_wheel')
170
+ context.run('python -m build --wheel')
171
171
 
172
172
 
173
173
  namespace.add_task(wheel)
@@ -170,7 +170,7 @@ namespace_clean.add_task(clean_all, 'all')
170
170
  @invoke.task(pre=[clean_all])
171
171
  def sdist(context):
172
172
  """Create a source distribution"""
173
- context.run('python setup.py sdist')
173
+ context.run('python -m build --sdist')
174
174
 
175
175
 
176
176
  namespace.add_task(sdist)
@@ -179,7 +179,7 @@ namespace.add_task(sdist)
179
179
  @invoke.task(pre=[clean_all])
180
180
  def wheel(context):
181
181
  """Build a wheel distribution"""
182
- context.run('python setup.py bdist_wheel')
182
+ context.run('python -m build --wheel')
183
183
 
184
184
 
185
185
  namespace.add_task(wheel)