diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-12-06 12:29:29 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-06 12:29:29 -0500 |
commit | ea182bbea386288b1acfbc35c99243a457ff1036 (patch) | |
tree | d3641a78217bbb79cbe039f80648b44b2fbdd0a4 /cmd2/argparse_completer.py | |
parent | 709af49a7f161c98260cc5ddda736987fb0f1f23 (diff) | |
parent | 9d90c1eb57c62ba1fcd8e470fa2e27248e1e9064 (diff) | |
download | cmd2-git-ea182bbea386288b1acfbc35c99243a457ff1036.tar.gz |
Merge pull request #607 from python-cmd2/flake8
Fix flake8 issues
Diffstat (limited to 'cmd2/argparse_completer.py')
-rw-r--r-- | cmd2/argparse_completer.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cmd2/argparse_completer.py b/cmd2/argparse_completer.py index 77a62b9d..18549e9e 100644 --- a/cmd2/argparse_completer.py +++ b/cmd2/argparse_completer.py @@ -1,4 +1,7 @@ # coding=utf-8 +# flake8: noqa C901 +# NOTE: Ignoreing flake8 cyclomatic complexity in this file because the complexity due to copy-and-paste overrides from +# argparse """ AutoCompleter interprets the argparse.ArgumentParser internals to automatically generate the completion options for each argument. @@ -595,7 +598,7 @@ class AutoCompleter(object): fill_width = int(term_size.columns * .6) - (token_width + 2) for item in completions: entry = '{: <{token_width}}{: <{fill_width}}'.format(item, item.description, - token_width=token_width+2, + token_width=token_width + 2, fill_width=fill_width) completions_with_desc.append(entry) @@ -603,7 +606,7 @@ class AutoCompleter(object): desc_header = action.desc_header except AttributeError: desc_header = 'Description' - header = '\n{: <{token_width}}{}'.format(action.dest.upper(), desc_header, token_width=token_width+2) + header = '\n{: <{token_width}}{}'.format(action.dest.upper(), desc_header, token_width=token_width + 2) self._cmd2_app.completion_header = header self._cmd2_app.display_matches = completions_with_desc |