|
1 | | -# |
2 | | -# -*- coding: utf-8 -*- |
3 | | -# flake8: noqa F401 |
4 | 1 | """This simply imports certain things for backwards compatibility.""" |
5 | 2 |
|
6 | | -import sys |
7 | | - |
| 3 | +import argparse |
8 | 4 | import importlib.metadata as importlib_metadata |
| 5 | +import sys |
9 | 6 |
|
10 | 7 | try: |
11 | 8 | __version__ = importlib_metadata.version(__name__) |
12 | 9 | except importlib_metadata.PackageNotFoundError: # pragma: no cover |
13 | 10 | # package is not installed |
14 | 11 | pass |
15 | 12 |
|
16 | | -from typing import List |
17 | | - |
18 | 13 | from .ansi import ( |
19 | | - Cursor, |
20 | 14 | Bg, |
21 | | - Fg, |
| 15 | + Cursor, |
22 | 16 | EightBitBg, |
23 | 17 | EightBitFg, |
| 18 | + Fg, |
24 | 19 | RgbBg, |
25 | 20 | RgbFg, |
26 | 21 | TextStyle, |
|
36 | 31 |
|
37 | 32 | # Check if user has defined a module that sets a custom value for argparse_custom.DEFAULT_ARGUMENT_PARSER. |
38 | 33 | # Do this before loading cmd2.Cmd class so its commands use the custom parser. |
39 | | -import argparse |
40 | | - |
41 | 34 | cmd2_parser_module = getattr(argparse, 'cmd2_parser_module', None) |
42 | 35 | if cmd2_parser_module is not None: |
43 | 36 | import importlib |
44 | 37 |
|
45 | 38 | importlib.import_module(cmd2_parser_module) |
46 | 39 |
|
| 40 | +from . import plugin |
47 | 41 | from .argparse_completer import set_default_ap_completer_type |
48 | | - |
49 | 42 | from .cmd2 import Cmd |
50 | 43 | from .command_definition import CommandSet, with_default_category |
51 | 44 | from .constants import COMMAND_NAME, DEFAULT_SHORTCUTS |
52 | | -from .decorators import with_argument_list, with_argparser, with_category, as_subcommand_to |
| 45 | +from .decorators import as_subcommand_to, with_argparser, with_argument_list, with_category |
53 | 46 | from .exceptions import ( |
54 | 47 | Cmd2ArgparseError, |
55 | 48 | CommandSetRegistrationError, |
56 | 49 | CompletionError, |
57 | 50 | PassThroughException, |
58 | 51 | SkipPostcommandHooks, |
59 | 52 | ) |
60 | | -from . import plugin |
61 | 53 | from .parsing import Statement |
62 | 54 | from .py_bridge import CommandResult |
63 | | -from .utils import categorize, CompletionMode, CustomCompletionSettings, Settable |
64 | | - |
| 55 | +from .utils import CompletionMode, CustomCompletionSettings, Settable, categorize |
65 | 56 |
|
66 | | -__all__: List[str] = [ |
| 57 | +__all__: list[str] = [ |
67 | 58 | 'COMMAND_NAME', |
68 | 59 | 'DEFAULT_SHORTCUTS', |
69 | 60 | # ANSI Exports |
|
0 commit comments