Skip to content

Commit 2f102b9

Browse files
committed
Fixed some warnings
1 parent 89397b5 commit 2f102b9

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

cmd2/parsing.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def command_and_args(self):
8181
return rtn
8282

8383

84-
class StatementParser():
84+
class StatementParser:
8585
"""Parse raw text into command components.
8686
8787
Shortcuts is a list of tuples with each tuple containing the shortcut and the expansion.
@@ -93,7 +93,7 @@ def __init__(
9393
multiline_commands=None,
9494
aliases=None,
9595
shortcuts=None,
96-
):
96+
):
9797
self.allow_redirection = allow_redirection
9898
if terminators is None:
9999
self.terminators = [';']
@@ -151,7 +151,6 @@ def __init__(
151151
# multiple lines
152152
self.command_pattern = re.compile(r'\A\s*(\S+)(\s|\Z)+')
153153

154-
155154
def tokenize(self, line: str) -> List[str]:
156155
"""Lex a string into a list of tokens.
157156
@@ -369,7 +368,7 @@ def _expand(self, line: str) -> str:
369368

370369
# expand shortcuts
371370
for (shortcut, expansion) in self.shortcuts:
372-
if line.startswith(shortcut):
371+
if line.startswith(shortcut):
373372
# If the next character after the shortcut isn't a space, then insert one
374373
shortcut_len = len(shortcut)
375374
if len(line) == shortcut_len or line[shortcut_len] != ' ':
@@ -397,7 +396,7 @@ def _command_and_args(tokens: List[str]) -> Tuple[str, str]:
397396
if len(tokens) > 1:
398397
args = ' '.join(tokens[1:])
399398

400-
return (command, args)
399+
return command, args
401400

402401
@staticmethod
403402
def _comment_replacer(match):
@@ -414,7 +413,7 @@ def _split_on_punctuation(self, tokens: List[str]) -> List[str]:
414413
# as word breaks when they are in unquoted strings. Each run of punctuation
415414
# characters is treated as a single token.
416415
417-
:param initial_tokens: the tokens as parsed by shlex
416+
:param tokens: the tokens as parsed by shlex
418417
:return: the punctuated tokens
419418
"""
420419
punctuation = []

0 commit comments

Comments
 (0)