-
Notifications
You must be signed in to change notification settings - Fork 128
Expand file tree
/
Copy path__init__.py
More file actions
108 lines (104 loc) · 2.35 KB
/
__init__.py
File metadata and controls
108 lines (104 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
"""Import certain things for backwards compatibility."""
import contextlib
import importlib.metadata as importlib_metadata
with contextlib.suppress(importlib_metadata.PackageNotFoundError):
__version__ = importlib_metadata.version(__name__)
from . import (
plugin,
rich_utils,
string_utils,
)
from .argparse_completer import set_default_ap_completer_type
from .argparse_custom import (
Cmd2ArgumentParser,
Cmd2AttributeWrapper,
register_argparse_argument_parameter,
set_default_argument_parser_type,
)
from .cmd2 import Cmd
from .colors import Color
from .command_definition import (
CommandSet,
with_default_category,
)
from .completion import (
Choices,
CompletionItem,
Completions,
)
from .constants import (
COMMAND_NAME,
DEFAULT_SHORTCUTS,
)
from .decorators import (
as_subcommand_to,
with_argparser,
with_argument_list,
with_category,
)
from .exceptions import (
Cmd2ArgparseError,
CommandSetRegistrationError,
CompletionError,
PassThroughException,
SkipPostcommandHooks,
)
from .parsing import Statement
from .py_bridge import CommandResult
from .rich_utils import RichPrintKwargs
from .string_utils import stylize
from .styles import Cmd2Style
from .utils import (
CustomCompletionSettings,
Settable,
categorize,
set_default_str_sort_key,
)
__all__: list[str] = [ # noqa: RUF022
'COMMAND_NAME',
'DEFAULT_SHORTCUTS',
# Argparse Exports
'Cmd2ArgumentParser',
'Cmd2AttributeWrapper',
'register_argparse_argument_parameter',
'set_default_ap_completer_type',
'set_default_argument_parser_type',
# Cmd2
'Cmd',
'CommandResult',
'CommandSet',
'Statement',
# Colors
"Color",
# Completion
'Choices',
'CompletionItem',
'Completions',
# Decorators
'with_argument_list',
'with_argparser',
'with_category',
'with_default_category',
'as_subcommand_to',
# Exceptions
'Cmd2ArgparseError',
'CommandSetRegistrationError',
'CompletionError',
'PassThroughException',
'SkipPostcommandHooks',
# modules
'plugin',
'rich_utils',
'string_utils',
# Rich Utils
'RichPrintKwargs',
# String Utils
'stylize',
# Styles,
"Cmd2Style",
# Utilities
'categorize',
'CustomCompletionSettings',
'Settable',
'set_default_str_sort_key',
]