From ce5092fd9c2e23baa0952aac665e7c26ed85a03a Mon Sep 17 00:00:00 2001 From: kotfu Date: Thu, 10 May 2018 11:11:40 -0600 Subject: Remove cmd2.Cmd.redirector for #381 --- cmd2/constants.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cmd2/constants.py') diff --git a/cmd2/constants.py b/cmd2/constants.py index 838650e5..af0a44cc 100644 --- a/cmd2/constants.py +++ b/cmd2/constants.py @@ -4,9 +4,13 @@ import re -# Used for command parsing, tab completion and word breaks. Do not change. +# Used for command parsing, output redirection, tab completion and word +# breaks. Do not change. QUOTES = ['"', "'"] -REDIRECTION_CHARS = ['|', '>'] +REDIRECTION_PIPE = '|' +REDIRECTION_OUTPUT = '>' +REDIRECTION_APPEND = '>>' +REDIRECTION_CHARS = [REDIRECTION_PIPE, REDIRECTION_OUTPUT] # Regular expression to match ANSI escape codes ANSI_ESCAPE_RE = re.compile(r'\x1b[^m]*m') -- cgit v1.2.1 From ceb3ef56e5c98e3af31de27a2ce43b64324c7e4e Mon Sep 17 00:00:00 2001 From: kotfu Date: Thu, 10 May 2018 11:33:53 -0600 Subject: Get rid of last hard-coded redirection constants --- cmd2/constants.py | 1 + 1 file changed, 1 insertion(+) (limited to 'cmd2/constants.py') diff --git a/cmd2/constants.py b/cmd2/constants.py index af0a44cc..b829000f 100644 --- a/cmd2/constants.py +++ b/cmd2/constants.py @@ -11,6 +11,7 @@ REDIRECTION_PIPE = '|' REDIRECTION_OUTPUT = '>' REDIRECTION_APPEND = '>>' REDIRECTION_CHARS = [REDIRECTION_PIPE, REDIRECTION_OUTPUT] +REDIRECTION_TOKENS = [REDIRECTION_PIPE, REDIRECTION_OUTPUT, REDIRECTION_APPEND] # Regular expression to match ANSI escape codes ANSI_ESCAPE_RE = re.compile(r'\x1b[^m]*m') -- cgit v1.2.1