diff options
Diffstat (limited to 'cmd2')
-rw-r--r-- | cmd2/ansi.py | 4 | ||||
-rw-r--r-- | cmd2/argparse_completer.py | 14 | ||||
-rw-r--r-- | cmd2/argparse_custom.py | 2 | ||||
-rw-r--r-- | cmd2/cmd2.py | 11 | ||||
-rw-r--r-- | cmd2/history.py | 1 | ||||
-rwxr-xr-x | cmd2/parsing.py | 3 | ||||
-rw-r--r-- | cmd2/py_bridge.py | 4 | ||||
-rw-r--r-- | cmd2/rl_utils.py | 2 |
8 files changed, 21 insertions, 20 deletions
diff --git a/cmd2/ansi.py b/cmd2/ansi.py index a6c09413..f172b87f 100644 --- a/cmd2/ansi.py +++ b/cmd2/ansi.py @@ -6,10 +6,10 @@ setting the window title, and asynchronous alerts. import functools import re from enum import Enum -from typing import Any, IO, List, Union +from typing import IO, Any, List, Union import colorama -from colorama import Fore, Back, Style +from colorama import Back, Fore, Style from wcwidth import wcswidth # On Windows, filter ANSI escape codes out of text sent to stdout/stderr, and replace them with equivalent Win32 calls diff --git a/cmd2/argparse_completer.py b/cmd2/argparse_completer.py index f61f5fd8..61f173cc 100644 --- a/cmd2/argparse_completer.py +++ b/cmd2/argparse_completer.py @@ -14,10 +14,16 @@ from collections import deque from typing import Dict, List, Optional, Union from . import ansi, cmd2, constants -from .argparse_custom import ATTR_CHOICES_CALLABLE, generate_range_error -from .argparse_custom import ATTR_SUPPRESS_TAB_HINT, ATTR_DESCRIPTIVE_COMPLETION_HEADER, ATTR_NARGS_RANGE -from .argparse_custom import ChoicesCallable, CompletionItem -from .utils import basic_complete, CompletionError +from .argparse_custom import ( + ATTR_CHOICES_CALLABLE, + ATTR_DESCRIPTIVE_COMPLETION_HEADER, + ATTR_NARGS_RANGE, + ATTR_SUPPRESS_TAB_HINT, + ChoicesCallable, + CompletionItem, + generate_range_error, +) +from .utils import CompletionError, basic_complete # If no descriptive header is supplied, then this will be used instead DEFAULT_DESCRIPTIVE_HEADER = 'Description' diff --git a/cmd2/argparse_custom.py b/cmd2/argparse_custom.py index f018f33f..485f65c2 100644 --- a/cmd2/argparse_custom.py +++ b/cmd2/argparse_custom.py @@ -203,7 +203,7 @@ import argparse import re import sys # noinspection PyUnresolvedReferences,PyProtectedMember -from argparse import ZERO_OR_MORE, ONE_OR_MORE, ArgumentError, _ +from argparse import ONE_OR_MORE, ZERO_OR_MORE, ArgumentError, _ from typing import Callable, Optional, Tuple, Type, Union from . import ansi, constants diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index d14b4d99..49c181f1 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -42,17 +42,14 @@ from collections import namedtuple from contextlib import redirect_stdout from typing import Any, Callable, Dict, Iterable, List, Mapping, Optional, Tuple, Type, Union -from . import ansi -from . import constants -from . import plugin -from . import utils -from .argparse_custom import CompletionItem, DEFAULT_ARGUMENT_PARSER +from . import ansi, constants, plugin, utils +from .argparse_custom import DEFAULT_ARGUMENT_PARSER, CompletionItem from .clipboard import can_clip, get_paste_buffer, write_to_paste_buffer from .decorators import with_argparser from .exceptions import Cmd2ArgparseError, Cmd2ShlexError, EmbeddedConsoleExit, EmptyStatement, RedirectionError from .history import History, HistoryItem -from .parsing import StatementParser, Statement, Macro, MacroArg, shlex_split -from .rl_utils import rl_type, RlType, rl_get_point, rl_set_prompt, vt100_support, rl_make_safe_prompt, rl_warning +from .parsing import Macro, MacroArg, Statement, StatementParser, shlex_split +from .rl_utils import RlType, rl_get_point, rl_make_safe_prompt, rl_set_prompt, rl_type, rl_warning, vt100_support from .utils import CompletionError, Settable # Set up readline diff --git a/cmd2/history.py b/cmd2/history.py index 7b52aa16..60a071fb 100644 --- a/cmd2/history.py +++ b/cmd2/history.py @@ -4,7 +4,6 @@ History management classes """ import re - from typing import List, Union import attr diff --git a/cmd2/parsing.py b/cmd2/parsing.py index 71582f1a..a7ee74a1 100755 --- a/cmd2/parsing.py +++ b/cmd2/parsing.py @@ -8,8 +8,7 @@ from typing import Dict, Iterable, List, Optional, Tuple, Union import attr -from . import constants -from . import utils +from . import constants, utils from .exceptions import Cmd2ShlexError diff --git a/cmd2/py_bridge.py b/cmd2/py_bridge.py index 0dc04ca6..38fef142 100644 --- a/cmd2/py_bridge.py +++ b/cmd2/py_bridge.py @@ -5,10 +5,10 @@ while maintaining a reasonable degree of isolation between the two. """ import sys -from contextlib import redirect_stdout, redirect_stderr +from contextlib import redirect_stderr, redirect_stdout from typing import Optional -from .utils import namedtuple_with_defaults, StdSim +from .utils import StdSim, namedtuple_with_defaults class CommandResult(namedtuple_with_defaults('CommandResult', ['stdout', 'stderr', 'stop', 'data'])): diff --git a/cmd2/rl_utils.py b/cmd2/rl_utils.py index 4df733db..099d76b7 100644 --- a/cmd2/rl_utils.py +++ b/cmd2/rl_utils.py @@ -2,8 +2,8 @@ """ Imports the proper readline for the platform and provides utility functions for it """ -from enum import Enum import sys +from enum import Enum # Prefer statically linked gnureadline if available (for macOS compatibility due to issues with libedit) try: |