| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Also included a number of minor maintenance updates:
- Bumped version to 0.7.8 in preparation for upcoming release
- Updated Readme.md to add link to slides from recent Florida PyCon talk about cmd2
- Updated documentation on integrating cmd2 with other event loops to use newer runcmds_plus_hooks() method instead of legacy onecmds_plus_hooks method which doesn't properly deal with load commands
- Deleted old files which were used to prepare for a PyCon 2010 presentation
- Updated ChangeLog regarding this bug fix
|
|
|
|
| |
got added
|
|
|
|
|
|
| |
Fixed a weird corner case.
Also added some comments to do_edit to better explain what the code is doing.
|
|
|
|
|
|
|
|
|
| |
than the length of the history
Previously a edit was creating a file named 'None' in this case.
Now an error is printed to the screen and no editor is opened.
Also did some miscellaneous cleanup based on PyCharm warnings.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
Also:
- Added arg_print.py example to demonstrate this
- Bumped version to 0.7.8a
- Updated CHANGELOG
|
|/
|
|
|
|
|
|
|
|
|
|
| |
runcmds_plus_hooks can accept multiple commands process the command queue to
deal with subsequent commands loaded from scripts without requiring a command
loop. This better supports a one-off batch processing scenario.
Also fixed the insertion order of commands placed in the command queue by load
and _relative_load so that script commands are run in the expected order.
Minor tweak to setup instructions in CONTRIBUTING.md to include pyperclip in
prerequisites.
|
|
|
|
|
|
|
| |
The poutput() function has been ruggedized so that it has a better conditional check so that it will actually print
things which are "falsy" but are still convertible to a string.
A few unit tests have been added specifically for the poutput function.
|
| |
|
| |
|
|
|
|
| |
if we are on a pipe, we have to echo the prompt only after we read and are not at EOF.
|
| |
|
|
|
|
|
|
| |
command and echo is True
Previously just the command get printed. Now the prompt and the command gets printed.
|
|
|
|
|
|
| |
regexes
Also bumped version from 0.7.7a to 0.7.7 in preparation for eventual next release.
|
|\ |
|
| |
| |
| |
| |
| |
| | |
parsing related to spaces and quotes
The recent change of edit to allow spaces means that it can benefit from the better argument parsing cmd2 has for commands implemented using the @options decorator.
|
| | |
|
| | |
|
| |
| |
| |
| | |
It output double newlines after each history item
|
| | |
|
|/
|
|
| |
Escapes of slashes don’t work yet.
|
|
|
|
| |
This is so that non-essential info which isn't directly associated with command output, such as time elapsed while executing a command, won't redirect when command output is redirected using >, >>, or |.
|
| |
|
|
|
|
| |
If feedback_to_output is false, .pfeedback() now sends messages to stderr instead of stdout.
|
|
|
|
| |
This is to help distinguish latest code in GitHub from a version installed via pip from PyPI
|
| |
|
|
|
|
| |
This bug is exposed by cmd2's dependency on pyperclip and pyperclip's optional dependency on pygtk.
|
|
|
|
|
|
| |
Removed the complexity of a member variable which would be unnecessary for the vast majority of applications.
If users have an application with atypical requirements, they are free to override the default.
|
| |
|
|\ |
|
| | |
|
|/
|
|
|
|
| |
when piping to shell commands.
Fixed error caused by BrokenPipeError not existing in Python 2.
|
|
|
|
|
|
| |
- poutput() can now take any argument convertible to a str via '{}'.format() instead of only str
- postparsing_postcmd() automatically runs a 'stty sane' on POSIX OSes to handle those cases of your terminal getting in a messed up state if you do something like pipe to a terminal command like "less" and then improperly quit out of it with a <Ctrl>-C instead of properly using "q"
- In _restore_output(), immeditelly restore stdout state in a finally block after closing the temporary one used for redirection/piping
|
| |
|
| |
|
|
|
|
|
|
| |
Modified implementation of poutput() to accept an optional "end" argument which can change the ending to something other than a newline or simply suppress adding a newline. Also added a try/except to catch BrokenPipeError exceptions which can occupoutputr if the subprocess output is being piped to closes before the command piping output to it is finished.
Updated install docs to note that when using Python 2.7, the subprocess32 module should also be installed.
|
|
|
|
|
|
|
|
| |
Open them in text mode in Python 3 so self.stdout.write() expects normal Python 3 (unicode) strings.
Open them in binary mode in Python 2 so self.stdout.write() expects normal Python 2 (byte) strings.
Also fixed a unit test mocking issue on Python 2 to account for the fact that Python 2.7 requires the subprocess32 module instead of subprocess.
|
|
|
|
|
|
|
|
|
|
| |
Now a real pipe is created to a subprocess. This has many advantages and should "just work" like intended with all commands.
One downside is to work properly on Python 2.7, it requires the subprocess32 module which is the subprocess module from Python 3.2 backported to Python 2.7. Another downside, is that unit testing the feature is now more difficult.
This still needs to be tested for compatibility across all OSes and supported versions of Python.
The user needs to be careful if designing multi-threaded cmd2 applications that do command processing in other threads and those threads can make calls to self.stdout.write to put in a try/except to catch Broken Pipe errors which can occur for long running commands if the user closes the shell subprocess before the command is finished.
|
| |
|
|
|
|
|
|
| |
Transcript testing now strips ANSI escape codes from the current line and current prompt before comparing the start of the current line with the current prompt to see if it is a command.
This makes it easier to use transcript testing with applications that colorize the prompt.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Bugs fixed:
- Case-sensitive parsing was completely broken, this has been fixed
- <Ctrl>+D to quit wasn't working when case-sensitive parsing was enabled, this is fixed
Added a "case_sensitive.py" example in the examples directory for quickly testing case-sensitive command parsing behavior.
|
| |
|
| |
|
|
|
|
| |
Python 2
|
| |
|
| |
|
| |
|
| |
|