diff options
author | kotfu <kotfu@kotfu.net> | 2018-04-29 12:43:11 -0600 |
---|---|---|
committer | kotfu <kotfu@kotfu.net> | 2018-04-29 12:43:11 -0600 |
commit | fbc6d0b39fa1e84ea3de3b38b700c45189146429 (patch) | |
tree | f8f2d76c73282af2741cc38941aa0d2767e0b4a4 /cmd2 | |
parent | 975818feb4f24c25e84b3586cfe68230f1ac84f5 (diff) | |
download | cmd2-git-fbc6d0b39fa1e84ea3de3b38b700c45189146429.tar.gz |
pipeTo -> pipe_to
Diffstat (limited to 'cmd2')
-rwxr-xr-x | cmd2/cmd2.py | 4 | ||||
-rw-r--r-- | cmd2/parsing.py | 16 |
2 files changed, 10 insertions, 10 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 136d86b2..985e2b66 100755 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -2114,7 +2114,7 @@ class Cmd(cmd.Cmd): :param statement: Statement - a parsed statement from the user """ - if statement.pipeTo: + if statement.pipe_to: self.kept_state = Statekeeper(self, ('stdout',)) # Create a pipe with read and write sides @@ -2129,7 +2129,7 @@ class Cmd(cmd.Cmd): # We want Popen to raise an exception if it fails to open the process. Thus we don't set shell to True. try: - self.pipe_proc = subprocess.Popen(shlex.split(statement.pipeTo), stdin=subproc_stdin) + self.pipe_proc = subprocess.Popen(shlex.split(statement.pipe_to), stdin=subproc_stdin) except Exception as ex: # Restore stdout to what it was and close the pipe self.stdout.close() diff --git a/cmd2/parsing.py b/cmd2/parsing.py index 63766a8c..9b548716 100644 --- a/cmd2/parsing.py +++ b/cmd2/parsing.py @@ -38,7 +38,7 @@ class Statement(str): self.args = '' self.terminator = None self.suffix = None - self.pipeTo = None + self.pipe_to = None self.output = None self.outputTo = None @@ -56,9 +56,9 @@ class StatementParser(): self, allow_redirection=True, terminators=None, - multiline_commands = None, - aliases = None, - shortcuts = [], + multiline_commands=None, + aliases=None, + shortcuts=[], ): self.allow_redirection = allow_redirection if terminators is None: @@ -209,13 +209,13 @@ class StatementParser(): try: # find the first pipe if it exists pipe_pos = tokens.index('|') - # set everything after the first pipe to result.pipeTo - pipeTo = ' '.join(tokens[pipe_pos+1:]) + # set everything after the first pipe to result.pipe_to + pipe_to = ' '.join(tokens[pipe_pos+1:]) # remove all the tokens after the pipe tokens = tokens[:pipe_pos] except ValueError: # no pipe in the tokens - pipeTo = None + pipe_to = None if terminator: # whatever is left is the suffix @@ -242,7 +242,7 @@ class StatementParser(): result.inputFrom = inputFrom result.output = output result.outputTo = outputTo - result.pipeTo = pipeTo + result.pipe_to = pipe_to result.suffix = suffix result.multiline_command = multiline_command return result |