File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11"""Supports the definition of commands in separate classes to be composed into cmd2.Cmd."""
22
3- from collections .abc import Callable , Mapping
3+ from collections .abc import (
4+ Callable ,
5+ Mapping ,
6+ )
47from typing import (
58 TYPE_CHECKING ,
69 TypeAlias ,
1114 CLASS_ATTR_DEFAULT_HELP_CATEGORY ,
1215 COMMAND_FUNC_PREFIX ,
1316)
14- from .exceptions import (
15- CommandSetRegistrationError ,
16- )
17+ from .exceptions import CommandSetRegistrationError
1718from .utils import Settable
1819
1920if TYPE_CHECKING : # pragma: no cover
Original file line number Diff line number Diff line change 11"""Decorators for ``cmd2`` commands."""
22
33import argparse
4- from collections .abc import Callable , Sequence
4+ from collections .abc import (
5+ Callable ,
6+ Sequence ,
7+ )
58from typing import (
69 TYPE_CHECKING ,
710 Any ,
1013 Union ,
1114)
1215
13- from . import (
14- constants ,
15- )
16- from .argparse_custom import (
17- Cmd2AttributeWrapper ,
18- )
16+ from . import constants
17+ from .argparse_custom import Cmd2AttributeWrapper
1918from .command_definition import (
2019 CommandFunc ,
2120 CommandSet ,
2221)
23- from .exceptions import (
24- Cmd2ArgparseError ,
25- )
26- from .parsing import (
27- Statement ,
28- )
22+ from .exceptions import Cmd2ArgparseError
23+ from .parsing import Statement
2924
3025if TYPE_CHECKING : # pragma: no cover
3126 import cmd2
Original file line number Diff line number Diff line change 22
33import json
44import re
5- from collections import (
6- OrderedDict ,
7- )
8- from collections .abc import Callable , Iterable
9- from dataclasses import (
10- dataclass ,
5+ from collections import OrderedDict
6+ from collections .abc import (
7+ Callable ,
8+ Iterable ,
119)
10+ from dataclasses import dataclass
1211from typing import (
1312 Any ,
1413 overload ,
Original file line number Diff line number Diff line change 11"""Classes for the cmd2 lifecycle hooks that you can register multiple callback functions/methods with."""
22
3- from dataclasses import (
4- dataclass ,
5- )
3+ from dataclasses import dataclass
64
7- from .parsing import (
8- Statement ,
9- )
5+ from .parsing import Statement
106
117
128@dataclass
Original file line number Diff line number Diff line change 11"""Utilities for integrating prompt_toolkit with cmd2."""
22
33import re
4- from collections .abc import Callable , Iterable
4+ from collections .abc import (
5+ Callable ,
6+ Iterable ,
7+ )
58from typing import (
69 TYPE_CHECKING ,
710 Any ,
Original file line number Diff line number Diff line change 1414 cast ,
1515)
1616
17- from .utils import ( # namedtuple_with_defaults,
18- StdSim ,
19- )
17+ from .utils import StdSim # namedtuple_with_defaults,
2018
2119if TYPE_CHECKING : # pragma: no cover
2220 import cmd2
Original file line number Diff line number Diff line change @@ -22,9 +22,7 @@ class is used in cmd2.py::run_transcript_tests()
2222from . import utils
2323
2424if TYPE_CHECKING : # pragma: no cover
25- from cmd2 import (
26- Cmd ,
27- )
25+ from cmd2 import Cmd
2826
2927
3028class Cmd2TestCase (unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments