summaryrefslogtreecommitdiff
path: root/cmd2/parsing.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-09-19 15:32:37 -0400
committerTodd Leonhardt <todd.leonhardt@gmail.com>2018-09-19 15:32:37 -0400
commitccbe1276f786e94f1996877fdec6d070705f5ab8 (patch)
tree167fe848ea36915091fbc7cbd7ad1032dd4474ec /cmd2/parsing.py
parentf787b1fb0adc8596d338af9cebdf3866e75fdbaa (diff)
downloadcmd2-git-ccbe1276f786e94f1996877fdec6d070705f5ab8.tar.gz
cmd2.Cmd.__init__ now initializes colorama and tells it to never strip ANSI codes since cmd2 deals with that
Also: - Finished editing poutput(), ppaged(), and pfeedback() methods to strip ANSI color when appropriate - Changed attr.ib() factory usage so cmd2 is compatible with older versions of attrs
Diffstat (limited to 'cmd2/parsing.py')
-rw-r--r--cmd2/parsing.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd2/parsing.py b/cmd2/parsing.py
index 8edfacb9..92dc1b40 100644
--- a/cmd2/parsing.py
+++ b/cmd2/parsing.py
@@ -90,7 +90,7 @@ class Statement(str):
command = attr.ib(default='', validator=attr.validators.instance_of(str), type=str)
# list of arguments to the command, not including any output redirection or terminators; quoted args remain quoted
- arg_list = attr.ib(factory=list, validator=attr.validators.instance_of(list), type=List[str])
+ arg_list = attr.ib(default=attr.Factory(list), validator=attr.validators.instance_of(list), type=List[str])
# if the command is a multiline command, the name of the command, otherwise empty
multiline_command = attr.ib(default='', validator=attr.validators.instance_of(str), type=str)
@@ -102,7 +102,7 @@ class Statement(str):
suffix = attr.ib(default='', validator=attr.validators.instance_of(str), type=str)
# if output was piped to a shell command, the shell command as a list of tokens
- pipe_to = attr.ib(factory=list, validator=attr.validators.instance_of(list), type=List[str])
+ pipe_to = attr.ib(default=attr.Factory(list), validator=attr.validators.instance_of(list), type=List[str])
# if output was redirected, the redirection token, i.e. '>>'
output = attr.ib(default='', validator=attr.validators.instance_of(str), type=str)