stubber.rst.output_dict
¶
- ModuleSourceDict represents a source file with the following components
docstr
version
comment
typing
Optional: list of constants
optional: ClassSourcedicts
optional: FunctionSourcedicts
optional: individual lines of code
- ClassSourceDict represents a source file with the following components
comment
class
docstr
Optional: list of constants
__init__ : class signature
optional: FunctionSourcedicts
optional: individual lines of code
- FunctionSourceDict represents a source file with the following components
# comments - todo
optional: decorator
def - function definition
docstr
constants
body - …
optional: individual lines of code
SourceDict is the ‘base class’
Module Contents¶
Classes¶
(abstract) dict to store source components respecting parent child dependencies and proper definition order |
|
(abstract) dict to store source components respecting parent child dependencies and proper definition order |
|
(abstract) dict to store source components respecting parent child dependencies and proper definition order |
|
(abstract) dict to store source components respecting parent child dependencies and proper definition order |
- class stubber.rst.output_dict.SourceDict(base: List, indent: int = 0, body: int = 0, lf: str = '\n')¶
Bases:
OrderedDict
(abstract) dict to store source components respecting parent child dependencies and proper definition order
- __add__(dict: SourceDict)¶
- Parameters
dict (SourceDict) –
- class stubber.rst.output_dict.ModuleSourceDict(name: str, indent=0, lf: str = '\n')¶
Bases:
SourceDict
(abstract) dict to store source components respecting parent child dependencies and proper definition order
- sort()¶
make sure all classdefs are in order
- __str__()¶
convert the OD into a string
- find(name: str) Union[str, None] ¶
find a classnode based on the name with or without the superclass
- classes()¶
get a list of the class names in parent-child order
- class stubber.rst.output_dict.ClassSourceDict(name: str, *, docstr: List[str] = ['""" """'], init: str = '', indent: int = 0, lf='\n')¶
Bases:
SourceDict
(abstract) dict to store source components respecting parent child dependencies and proper definition order
- class stubber.rst.output_dict.FunctionSourceDict(name: str, *, definition: List[str] = [], docstr: List[str] = ['""" """'], indent: int = 0, decorators: List[str] = [], lf='\n')¶
Bases:
SourceDict
(abstract) dict to store source components respecting parent child dependencies and proper definition order