summaryrefslogtreecommitdiff
path: root/cmd2
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2020-04-24 21:15:34 -0400
committerTodd Leonhardt <todd.leonhardt@gmail.com>2020-04-24 21:21:35 -0400
commit9b78cf4913202995dcf065ecf5077bf16fa01f95 (patch)
treea04ca95d6f67bae491f290cc71036d2a4f6b168c /cmd2
parent9c7bbfa5bdbf8c8d81c0cd3c3cd5179d700de0b2 (diff)
downloadcmd2-git-9b78cf4913202995dcf065ecf5077bf16fa01f95.tar.gz
Added info on semantic versioning and branching strategy to CONTRIBUTING.md
Also: - Added isort to Pipenv dev - Added setup.cfg to make it easy to run flake8, doc8, and isort directly from the command line without using invoke - Ran isort to sort includes
Diffstat (limited to 'cmd2')
-rw-r--r--cmd2/ansi.py4
-rw-r--r--cmd2/argparse_completer.py14
-rw-r--r--cmd2/argparse_custom.py2
-rw-r--r--cmd2/cmd2.py11
-rw-r--r--cmd2/history.py1
-rwxr-xr-xcmd2/parsing.py3
-rw-r--r--cmd2/py_bridge.py4
-rw-r--r--cmd2/rl_utils.py2
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: