summaryrefslogtreecommitdiff
path: root/cmd2/utils.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2021-02-19 21:40:15 -0500
committerTodd Leonhardt <todd.leonhardt@gmail.com>2021-02-19 21:40:15 -0500
commit486b8c726a7d657ef320e68598077c31fa664790 (patch)
tree46b53d0f530d6ae273c4379272684ee80026658a /cmd2/utils.py
parent3e180a810e9c4b9d251c135667d1d150b0bbd0dd (diff)
downloadcmd2-git-486b8c726a7d657ef320e68598077c31fa664790.tar.gz
Fixed black, isort, flake8, and doc8 issues
Diffstat (limited to 'cmd2/utils.py')
-rw-r--r--cmd2/utils.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/cmd2/utils.py b/cmd2/utils.py
index 8dad5f4c..9920ad64 100644
--- a/cmd2/utils.py
+++ b/cmd2/utils.py
@@ -93,11 +93,18 @@ def str_to_bool(val: str) -> bool:
class Settable:
"""Used to configure a cmd2 instance member to be settable via the set command in the CLI"""
- def __init__(self, name: str, val_type: Callable, description: str, *,
- onchange_cb: Callable[[str, Any, Any], Any] = None,
- choices: Iterable = None,
- choices_provider: Optional[Callable] = None,
- completer: Optional[Callable] = None):
+
+ def __init__(
+ self,
+ name: str,
+ val_type: Callable,
+ description: str,
+ *,
+ onchange_cb: Callable[[str, Any, Any], Any] = None,
+ choices: Iterable = None,
+ choices_provider: Optional[Callable] = None,
+ completer: Optional[Callable] = None
+ ):
"""
Settable Initializer
@@ -1075,6 +1082,7 @@ def get_defining_class(meth) -> Type:
class CompletionMode(Enum):
"""Enum for what type of tab completion to perform in cmd2.Cmd.read_input()"""
+
# Tab completion will be disabled during read_input() call
# Use of custom up-arrow history supported
NONE = 1
@@ -1092,6 +1100,7 @@ class CompletionMode(Enum):
class CustomCompletionSettings:
"""Used by cmd2.Cmd.complete() to tab complete strings other than command arguments"""
+
def __init__(self, parser: argparse.ArgumentParser, *, preserve_quotes: bool = False):
"""
Initializer