|
52 | 52 | from . import constants |
53 | 53 | from . import utils |
54 | 54 |
|
| 55 | +from cmd2.parsing import StatementParser, Statement |
| 56 | + |
55 | 57 | # Set up readline |
56 | 58 | from .rl_utils import rl_type, RlType |
57 | 59 | if rl_type == RlType.NONE: |
|
60 | 62 | sys.stderr.write(Fore.LIGHTYELLOW_EX + rl_err_msg + Fore.RESET) |
61 | 63 | else: |
62 | 64 | from .rl_utils import rl_force_redisplay, readline |
| 65 | + from .argparse_completer import AutoCompleter, ACArgumentParser |
63 | 66 |
|
64 | | -from .argparse_completer import AutoCompleter, ACArgumentParser |
65 | | - |
66 | | -from cmd2.parsing import StatementParser, Statement |
67 | | - |
68 | | -if rl_type == RlType.PYREADLINE: |
| 67 | + if rl_type == RlType.PYREADLINE: |
69 | 68 |
|
70 | | - # Save the original pyreadline display completion function since we need to override it and restore it |
71 | | - # noinspection PyProtectedMember |
72 | | - orig_pyreadline_display = readline.rl.mode._display_completions |
| 69 | + # Save the original pyreadline display completion function since we need to override it and restore it |
| 70 | + # noinspection PyProtectedMember |
| 71 | + orig_pyreadline_display = readline.rl.mode._display_completions |
73 | 72 |
|
74 | | -elif rl_type == RlType.GNU: |
| 73 | + elif rl_type == RlType.GNU: |
75 | 74 |
|
76 | | - # We need wcswidth to calculate display width of tab completions |
77 | | - from wcwidth import wcswidth |
| 75 | + # We need wcswidth to calculate display width of tab completions |
| 76 | + from wcwidth import wcswidth |
78 | 77 |
|
79 | | - # Get the readline lib so we can make changes to it |
80 | | - import ctypes |
81 | | - from .rl_utils import readline_lib |
| 78 | + # Get the readline lib so we can make changes to it |
| 79 | + import ctypes |
| 80 | + from .rl_utils import readline_lib |
82 | 81 |
|
83 | 82 | # Newer versions of pyperclip are released as a single file, but older versions had a more complicated structure |
84 | 83 | try: |
|
0 commit comments