diff options
author | kotfu <kotfu@kotfu.net> | 2018-04-29 12:44:38 -0600 |
---|---|---|
committer | kotfu <kotfu@kotfu.net> | 2018-04-29 12:44:38 -0600 |
commit | 83fd707dcf9916c9f483e4417a2c3b2b083c8da2 (patch) | |
tree | 54152104564c751554c3b79d32d507ec152ed2ff /cmd2 | |
parent | fbc6d0b39fa1e84ea3de3b38b700c45189146429 (diff) | |
download | cmd2-git-83fd707dcf9916c9f483e4417a2c3b2b083c8da2.tar.gz |
outputTo -> output_to
Diffstat (limited to 'cmd2')
-rwxr-xr-x | cmd2/cmd2.py | 8 | ||||
-rw-r--r-- | cmd2/parsing.py | 10 |
2 files changed, 9 insertions, 9 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 985e2b66..0c738991 100755 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -2142,16 +2142,16 @@ class Cmd(cmd.Cmd): # Re-raise the exception raise ex elif statement.output: - if (not statement.outputTo) and (not can_clip): + if (not statement.output_to) and (not can_clip): raise EnvironmentError('Cannot redirect to paste buffer; install ``xclip`` and re-run to enable') self.kept_state = Statekeeper(self, ('stdout',)) self.kept_sys = Statekeeper(sys, ('stdout',)) self.redirecting = True - if statement.outputTo: + if statement.output_to: mode = 'w' if statement.output == 2 * self.redirector: mode = 'a' - sys.stdout = self.stdout = open(os.path.expanduser(statement.outputTo), mode) + sys.stdout = self.stdout = open(os.path.expanduser(statement.output_to), mode) else: sys.stdout = self.stdout = tempfile.TemporaryFile(mode="w+") if statement.output == '>>': @@ -2165,7 +2165,7 @@ class Cmd(cmd.Cmd): # If we have redirected output to a file or the clipboard or piped it to a shell command, then restore state if self.kept_state is not None: # If we redirected output to the clipboard - if statement.output and not statement.outputTo: + if statement.output and not statement.output_to: self.stdout.seek(0) write_to_paste_buffer(self.stdout.read()) diff --git a/cmd2/parsing.py b/cmd2/parsing.py index 9b548716..0ba0736d 100644 --- a/cmd2/parsing.py +++ b/cmd2/parsing.py @@ -40,7 +40,7 @@ class Statement(str): self.suffix = None self.pipe_to = None self.output = None - self.outputTo = None + self.output_to = None @property def command_and_args(self): @@ -186,11 +186,11 @@ class StatementParser(): # check for output redirect output = None - outputTo = None + output_to = None try: output_pos = tokens.index('>') output = '>' - outputTo = ' '.join(tokens[output_pos+1:]) + output_to = ' '.join(tokens[output_pos+1:]) # remove all the tokens after the output redirect tokens = tokens[:output_pos] except ValueError: @@ -199,7 +199,7 @@ class StatementParser(): try: output_pos = tokens.index('>>') output = '>>' - outputTo = ' '.join(tokens[output_pos+1:]) + output_to = ' '.join(tokens[output_pos+1:]) # remove all tokens after the output redirect tokens = tokens[:output_pos] except ValueError: @@ -241,7 +241,7 @@ class StatementParser(): result.terminator = terminator result.inputFrom = inputFrom result.output = output - result.outputTo = outputTo + result.output_to = output_to result.pipe_to = pipe_to result.suffix = suffix result.multiline_command = multiline_command |