Releases: python-cmd2/cmd2
Releases · python-cmd2/cmd2
1.2.0 (July 13, 2020)
- Bug Fixes
- Fixed
typingmodule compatibility issue with Python 3.5 prior to 3.5.4
- Fixed
- Enhancements
- Switched to getting version using
importlib.metadatainstead of usingpkg_resources- Improves
cmd2application launch time on systems that have a lot of Python packages onsys.path - Added dependency on
importlib_metadatawhen running on versions of Python prior to 3.8
- Improves
- Switched to getting version using
1.1.0 (June 6, 2020)
- Bug Fixes
- Fixed issue where subcommand usage text could contain a subcommand alias instead of the actual name
- Fixed bug in
ArgparseCompleterwherefill_widthcould become negative iftoken_widthwas large
relative to the terminal width.
- Enhancements
- Made
ipyconsistent withpyin the following waysipyreturns whether any of the commands run in it returned True to stop command loopCmd.in_pyscript()returns True while inipy.- Starting
ipywhenCmd.in_pyscript()is already True is not allowed.
with_argument_list,with_argparser, andwith_argparser_and_unknown_argswrappers now pass
kwargsthrough to their wrapped command function.- Added
table_creatormodule for creating richly formatted tables. This module is in beta and subject
to change.- See table_creation
documentation for an overview. - See table_creation.py
for an example.
- See table_creation
- Added the following exceptions to the public API
SkipPostcommandHooks- Custom exception class for when a command has a failure bad enough to skip
post command hooks, but not bad enough to print the exception to the user.Cmd2ArgparseError- ASkipPostcommandHooksexception for when a command fails to parse its arguments.
Normally argparse raises aSystemExitexception in these cases. To avoid stopping the command
loop, catch theSystemExitand raise this instead. If you still need to run post command hooks
after parsing fails, just return instead of raising an exception.
- Added explicit handling of
SystemExit. If a command raises this exception, the command loop will be
gracefully stopped.
- Made
1.0.2 (April 06, 2020)
- Bug Fixes
- Ctrl-C now stops a running text script instead of just the current
run_scriptcommand
- Ctrl-C now stops a running text script instead of just the current
- Enhancements
do_shell()now saves the return code of the command it runs inself.last_resultfor use in pyscripts
1.0.1 (March 13, 2020)
- Bug Fixes
- Fixed issue where postcmd hooks were running after an
argparseexception in a command.
- Fixed issue where postcmd hooks were running after an
1.0.0 (March 1, 2020)
- Enhancements
- The documentation at cmd2.rftd.io received a major overhaul
- Other
- Moved categorize utility function from decorators module to utils module
- Notes
- Now that the 1.0 release is out,
cmd2intends to follow Semantic Versioning
- Now that the 1.0 release is out,
0.10.1 (February 19, 2020)
- Bug Fixes
- Corrected issue where the actual new value was not always being printed in do_set. This occurred in cases where the typed value differed from what the setter had converted it to.
- Fixed bug where ANSI style sequences were not correctly handled in
utils.truncate_line(). - Fixed bug where pyscripts could edit
cmd2.Cmd.py_localsdictionary. - Fixed bug where cmd2 set
sys.path[0]for a pyscript to cmd2's working directory instead of the script file's directory. - Fixed bug where
sys.pathwas not being restored after a pyscript ran.
- Enhancements
- Renamed set command's
-l/--longflag to-v/--verbosefor consistency with help and history commands. - Setting the following pyscript variables:
__name__: main__file__: script path (as typed, ~ will be expanded)
- Only tab complete after redirection tokens if redirection is allowed
- Made
CompletionErrorexception available to non-argparse tab completion - Added
apply_styletoCompletionErrorinitializer. It defaults to True, but can be set to False if you don't want the error text to haveansi.style_error()applied to it when printed.
- Renamed set command's
- Other
- Removed undocumented
py runcommand since it was replaced byrun_pyscripta while ago - Renamed
AutoCompletertoArgparseCompleterfor clarity - Custom
EmptyStatementexception is no longer part of the documented public API
- Removed undocumented
- Notes
- This is a beta release leading up to the 1.0.0 release
- We intend no more breaking changes prior to 1.0.0
- Just bug fixes, documentation updates, and enhancements
0.10.0 (February 7, 2020)
- Enhancements
- Changed the default help text to make
help -vmore discoverable - set command now supports tab-completion of values
- Added
add_settable()andremove_settable()convenience methods to updateself.settabledictionary - Added convenience
ansi.fgandansi.bgenums of foreground and background colorsansi.style()fgargument can now either be of typestroransi.fgansi.style()bgargument can now either be of typestroransi.bg- This supports IDE auto-completion of color names
- The enums also support
f-stringsandformat()calls (e.g."{}hello{}".format(fg.blue, fg.reset))- string concatenation (e.g.
fg.blue + "hello" + fg.reset)
- Changed the default help text to make
- Breaking changes
- Renamed
locals_in_pyattribute ofcmd2.Cmdtoself_in_py - The following public attributes of
cmd2.Cmdare no longer settable at runtime by default:continuation_promptself_in_pyprompt
self.settablechanged toself.settables- It is now a Dict[str, Settable] instead of Dict[str, str]
- setting onchange callbacks have a new method signature and must be added to the
Settable instance in order to be called
- Removed
cast()utility function - Removed
ansi.FG_COLORSandansi.BG_COLORSdictionaries- Replaced with
ansi.fgandansi.bgenums providing similar but improved functionality
- Replaced with
- Renamed
- Notes
- This is an alpha release leading up to the 1.0.0 release
- We intend no more breaking changes prior to 1.0.0
- Just bug fixes, documentation updates, and enhancements
0.9.25 (January 26, 2020)
- Enhancements
- Reduced what gets put in package downloadable from PyPI (removed irrelevant CI config files and such)
0.9.24 (January 23, 2020)
- Enhancements
- Flushing stderr when setting the window title and printing alerts for better responsiveness in cases where stderr is not unbuffered.
- Added function to truncate a single line to fit within a given display width.
cmd2.utils.truncate_linesupports characters with display widths greater than 1 and ANSI style sequences. - Added line truncation support to
cmd2.utilstext alignment functions. - Added support for Python 3.9 alpha
0.9.23 (January 9, 2020)
- Bug Fixes
- Fixed bug where startup script containing a single quote in its file name was incorrectly quoted
- Added missing implicit dependency on
setuptoolsdue to build withsetuptools_scm
- Enhancements
- Added dim text style support via
style()function andansi.INTENSITY_DIMsetting.
- Added dim text style support via
- Breaking changes
- Renamed the following
ansimembers for accuracy in what types of ANSI escape sequences are handledansi.allow_ansi->ansi.allow_styleansi.ansi_safe_wcswidth()->ansi.style_aware_wcswidth()ansi.ansi_aware_write()->ansi.style_aware_write()
- Renamed the following
ansimembers for clarificationansi.BRIGHT->ansi.INTENSITY_BRIGHTansi.NORMAL->ansi.INTENSITY_NORMAL
- Renamed the following