summaryrefslogtreecommitdiff
path: root/cmd2/parsing.py
diff options
context:
space:
mode:
authorkotfu <kotfu@kotfu.net>2018-04-29 15:29:54 -0600
committerkotfu <kotfu@kotfu.net>2018-04-29 15:29:54 -0600
commit7b2d8a23b978f408cc1fe949e23c0aae97ed54a3 (patch)
tree2fce238aa94ee0a63dac1a872ea188066e50717d /cmd2/parsing.py
parent00093dd2cff5b0532c9c6154b396acf49043df66 (diff)
downloadcmd2-git-7b2d8a23b978f408cc1fe949e23c0aae97ed54a3.tar.gz
multilineCommands -> multiline_commands
Diffstat (limited to 'cmd2/parsing.py')
-rw-r--r--cmd2/parsing.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/cmd2/parsing.py b/cmd2/parsing.py
index 0ba0736d..75bbd1c4 100644
--- a/cmd2/parsing.py
+++ b/cmd2/parsing.py
@@ -66,7 +66,7 @@ class StatementParser():
else:
self.terminators = terminators
if multiline_commands is None:
- self.multilineCommands = []
+ self.multiline_commands = []
else:
self.multiline_commands = multiline_commands
if aliases is None:
@@ -133,9 +133,9 @@ class StatementParser():
terminator = BLANK_LINE
# split the input on whitespace
- s = shlex.shlex(line, posix=False)
- s.whitespace_split = True
- tokens = self.split_on_punctuation(list(s))
+ lexer = shlex.shlex(line, posix=False)
+ lexer.whitespace_split = True
+ tokens = self.split_on_punctuation(list(lexer))
# expand aliases
if tokens:
@@ -268,9 +268,9 @@ class StatementParser():
line = self.expand_shortcuts(line)
# split the input on whitespace
- s = shlex.shlex(line, posix=False)
- s.whitespace_split = True
- tokens = self.split_on_punctuation(list(s))
+ lexer = shlex.shlex(line, posix=False)
+ lexer.whitespace_split = True
+ tokens = self.split_on_punctuation(list(lexer))
# expand aliases
if tokens:
@@ -304,7 +304,7 @@ class StatementParser():
"""Given a command, expand any aliases for the command"""
# make a copy of aliases so we can edit it
tmp_aliases = list(self.aliases.keys())
- keep_expanding = len(tmp_aliases) > 0
+ keep_expanding = bool(tmp_aliases)
while keep_expanding:
for cur_alias in tmp_aliases:
@@ -312,7 +312,7 @@ class StatementParser():
if command == cur_alias:
command = self.aliases[cur_alias]
tmp_aliases.remove(cur_alias)
- keep_expanding = len(tmp_aliases) > 0
+ keep_expanding = bool(tmp_aliases)
break
return command