summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
diff options
context:
space:
mode:
Diffstat (limited to 'cmd2/cmd2.py')
-rwxr-xr-xcmd2/cmd2.py27
1 files changed, 13 insertions, 14 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index ee6beb98..8c234dab 100755
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -52,6 +52,8 @@ import pyperclip
from . import constants
from . import utils
+from cmd2.parsing import StatementParser, Statement
+
# Set up readline
from .rl_utils import rl_type, RlType
if rl_type == RlType.NONE:
@@ -60,25 +62,22 @@ if rl_type == RlType.NONE:
sys.stderr.write(Fore.LIGHTYELLOW_EX + rl_err_msg + Fore.RESET)
else:
from .rl_utils import rl_force_redisplay, readline
+ from .argparse_completer import AutoCompleter, ACArgumentParser
-from .argparse_completer import AutoCompleter, ACArgumentParser
-
-from cmd2.parsing import StatementParser, Statement
-
-if rl_type == RlType.PYREADLINE:
+ if rl_type == RlType.PYREADLINE:
- # Save the original pyreadline display completion function since we need to override it and restore it
- # noinspection PyProtectedMember
- orig_pyreadline_display = readline.rl.mode._display_completions
+ # Save the original pyreadline display completion function since we need to override it and restore it
+ # noinspection PyProtectedMember
+ orig_pyreadline_display = readline.rl.mode._display_completions
-elif rl_type == RlType.GNU:
+ elif rl_type == RlType.GNU:
- # We need wcswidth to calculate display width of tab completions
- from wcwidth import wcswidth
+ # We need wcswidth to calculate display width of tab completions
+ from wcwidth import wcswidth
- # Get the readline lib so we can make changes to it
- import ctypes
- from .rl_utils import readline_lib
+ # Get the readline lib so we can make changes to it
+ import ctypes
+ from .rl_utils import readline_lib
# Newer versions of pyperclip are released as a single file, but older versions had a more complicated structure
try: