pyTooling.Attributes.ArgParse.Argument
Classes
DelimiterArgument
: Represents a delimiter symbol like--
.NamedArgument
: Base-class for all command line arguments with a name.ValuedArgument
: Base-class for all command line arguments with a value.PositionalArgument
: Represents a simple string argument containing any information encoded in a string.StringArgument
: Represents a simple string argument.IntegerArgument
: Represents an integer argument.FloatArgument
: Represents a floating point number argument.PathArgument
: Represents a single path argument.ListArgument
: Represents a list of string argument (StringArgument
).StringListArgument
: Represents a list of string argument (StringArgument
).IntegerListArgument
: Represents a list of string argument (StringArgument
).FloatListArgument
: Represents a list of string argument (StringArgument
).PathListArgument
: Represents a list of path arguments (PathArgument
).
Classes
- class pyTooling.Attributes.ArgParse.Argument.DelimiterArgument(*args, **kwargs)[source]
Represents a delimiter symbol like
--
.Inheritance
- property Args: Tuple
A tuple of additional positional parameters (
*args
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- classmethod GetAttributes(method, includeSubClasses=True)
Returns attached attributes of this kind for a given method.
- classmethod GetClasses(scope=None, subclassOf=None)
Return a generator for all classes, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.subclassOf
- when the item is a subclass ofsubclassOf
.
- Parameters:
- Return type:
- Returns:
A sequence of classes where this attribute is attached to.
- classmethod GetFunctions(scope=None)
Return a generator for all functions, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- classmethod GetMethods(scope=None)
Return a generator for all methods, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- class property HasClassAttributes: bool
Check if class has Attributes.
- Returns:
True
, if the class has Attributes.
- class property HasMethodAttributes: bool
Check if class has any method with Attributes.
- Returns:
True
, if the class has any method with Attributes.
- property KWArgs: Dict
A dictionary of additional named parameters (
**kwargs
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- static _AppendAttribute(entity, attribute)
Append an attribute to a language entity (class, method, function).
Hint
This method can be used in attribute groups to apply multiple attributes within
__call__
method.class GroupAttribute(Attribute): def __call__(self, entity: Entity) -> Entity: self._AppendAttribute(entity, SimpleAttribute(...)) self._AppendAttribute(entity, SimpleAttribute(...)) return entity
- __call__(entity)
Attributes get attached to an entity (function, class, method) and an index is updated at the attribute for reverse lookups.
- __init__(*args, **kwargs)
The constructor expects positional (
*args
) and/or named parameters (**kwargs
) which are passed without modification toadd_argument()
.
- classmethod __init_subclass__(**kwargs)
Ensure each derived class has its own instance of
_functions
,_classes
and_methods
to register the usage of that Attribute.
- _classes: ClassVar[List[Any]] = []
List of classes, this Attribute was attached to.
- _functions: ClassVar[List[Any]] = []
List of functions, this Attribute was attached to.
- _methods: ClassVar[List[Any]] = []
List of methods, this Attribute was attached to.
- _scope: ClassVar[AttributeScope] = 7
Allowed language construct this attribute can be used with.
- _handler: Callable
Reference to a method that is called to handle e.g. a sub-command.
- class pyTooling.Attributes.ArgParse.Argument.NamedArgument(*args, **kwargs)[source]
Base-class for all command line arguments with a name.
Inheritance
- property Args: Tuple
A tuple of additional positional parameters (
*args
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- classmethod GetAttributes(method, includeSubClasses=True)
Returns attached attributes of this kind for a given method.
- classmethod GetClasses(scope=None, subclassOf=None)
Return a generator for all classes, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.subclassOf
- when the item is a subclass ofsubclassOf
.
- Parameters:
- Return type:
- Returns:
A sequence of classes where this attribute is attached to.
- classmethod GetFunctions(scope=None)
Return a generator for all functions, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- classmethod GetMethods(scope=None)
Return a generator for all methods, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- class property HasClassAttributes: bool
Check if class has Attributes.
- Returns:
True
, if the class has Attributes.
- class property HasMethodAttributes: bool
Check if class has any method with Attributes.
- Returns:
True
, if the class has any method with Attributes.
- property KWArgs: Dict
A dictionary of additional named parameters (
**kwargs
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- static _AppendAttribute(entity, attribute)
Append an attribute to a language entity (class, method, function).
Hint
This method can be used in attribute groups to apply multiple attributes within
__call__
method.class GroupAttribute(Attribute): def __call__(self, entity: Entity) -> Entity: self._AppendAttribute(entity, SimpleAttribute(...)) self._AppendAttribute(entity, SimpleAttribute(...)) return entity
- __call__(entity)
Attributes get attached to an entity (function, class, method) and an index is updated at the attribute for reverse lookups.
- __init__(*args, **kwargs)
The constructor expects positional (
*args
) and/or named parameters (**kwargs
) which are passed without modification toadd_argument()
.
- classmethod __init_subclass__(**kwargs)
Ensure each derived class has its own instance of
_functions
,_classes
and_methods
to register the usage of that Attribute.
- _classes: ClassVar[List[Any]] = []
List of classes, this Attribute was attached to.
- _functions: ClassVar[List[Any]] = []
List of functions, this Attribute was attached to.
- _methods: ClassVar[List[Any]] = []
List of methods, this Attribute was attached to.
- _scope: ClassVar[AttributeScope] = 7
Allowed language construct this attribute can be used with.
- _handler: Callable
Reference to a method that is called to handle e.g. a sub-command.
- class pyTooling.Attributes.ArgParse.Argument.ValuedArgument(*args, **kwargs)[source]
Base-class for all command line arguments with a value.
Inheritance
- property Args: Tuple
A tuple of additional positional parameters (
*args
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- classmethod GetAttributes(method, includeSubClasses=True)
Returns attached attributes of this kind for a given method.
- classmethod GetClasses(scope=None, subclassOf=None)
Return a generator for all classes, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.subclassOf
- when the item is a subclass ofsubclassOf
.
- Parameters:
- Return type:
- Returns:
A sequence of classes where this attribute is attached to.
- classmethod GetFunctions(scope=None)
Return a generator for all functions, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- classmethod GetMethods(scope=None)
Return a generator for all methods, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- class property HasClassAttributes: bool
Check if class has Attributes.
- Returns:
True
, if the class has Attributes.
- class property HasMethodAttributes: bool
Check if class has any method with Attributes.
- Returns:
True
, if the class has any method with Attributes.
- property KWArgs: Dict
A dictionary of additional named parameters (
**kwargs
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- static _AppendAttribute(entity, attribute)
Append an attribute to a language entity (class, method, function).
Hint
This method can be used in attribute groups to apply multiple attributes within
__call__
method.class GroupAttribute(Attribute): def __call__(self, entity: Entity) -> Entity: self._AppendAttribute(entity, SimpleAttribute(...)) self._AppendAttribute(entity, SimpleAttribute(...)) return entity
- __call__(entity)
Attributes get attached to an entity (function, class, method) and an index is updated at the attribute for reverse lookups.
- __init__(*args, **kwargs)
The constructor expects positional (
*args
) and/or named parameters (**kwargs
) which are passed without modification toadd_argument()
.
- classmethod __init_subclass__(**kwargs)
Ensure each derived class has its own instance of
_functions
,_classes
and_methods
to register the usage of that Attribute.
- _classes: ClassVar[List[Any]] = []
List of classes, this Attribute was attached to.
- _functions: ClassVar[List[Any]] = []
List of functions, this Attribute was attached to.
- _methods: ClassVar[List[Any]] = []
List of methods, this Attribute was attached to.
- _scope: ClassVar[AttributeScope] = 7
Allowed language construct this attribute can be used with.
- _handler: Callable
Reference to a method that is called to handle e.g. a sub-command.
- class pyTooling.Attributes.ArgParse.Argument.PositionalArgument(dest, metaName, type=<class 'str'>, optional=False, help='')[source]
Represents a simple string argument containing any information encoded in a string.
TODO
A list of strings is available as
StringListArgument
.Inheritance
- __init__(dest, metaName, type=<class 'str'>, optional=False, help='')[source]
The constructor expects positional (
*args
) and/or named parameters (**kwargs
) which are passed without modification toadd_argument()
.
- property Args: Tuple
A tuple of additional positional parameters (
*args
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- classmethod GetAttributes(method, includeSubClasses=True)
Returns attached attributes of this kind for a given method.
- classmethod GetClasses(scope=None, subclassOf=None)
Return a generator for all classes, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.subclassOf
- when the item is a subclass ofsubclassOf
.
- Parameters:
- Return type:
- Returns:
A sequence of classes where this attribute is attached to.
- classmethod GetFunctions(scope=None)
Return a generator for all functions, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- classmethod GetMethods(scope=None)
Return a generator for all methods, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- class property HasClassAttributes: bool
Check if class has Attributes.
- Returns:
True
, if the class has Attributes.
- class property HasMethodAttributes: bool
Check if class has any method with Attributes.
- Returns:
True
, if the class has any method with Attributes.
- property KWArgs: Dict
A dictionary of additional named parameters (
**kwargs
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- static _AppendAttribute(entity, attribute)
Append an attribute to a language entity (class, method, function).
Hint
This method can be used in attribute groups to apply multiple attributes within
__call__
method.class GroupAttribute(Attribute): def __call__(self, entity: Entity) -> Entity: self._AppendAttribute(entity, SimpleAttribute(...)) self._AppendAttribute(entity, SimpleAttribute(...)) return entity
- __call__(entity)
Attributes get attached to an entity (function, class, method) and an index is updated at the attribute for reverse lookups.
- classmethod __init_subclass__(**kwargs)
Ensure each derived class has its own instance of
_functions
,_classes
and_methods
to register the usage of that Attribute.
- _classes: ClassVar[List[Any]] = []
List of classes, this Attribute was attached to.
- _functions: ClassVar[List[Any]] = []
List of functions, this Attribute was attached to.
- _methods: ClassVar[List[Any]] = []
List of methods, this Attribute was attached to.
- _scope: ClassVar[AttributeScope] = 7
Allowed language construct this attribute can be used with.
- _handler: Callable
Reference to a method that is called to handle e.g. a sub-command.
- class pyTooling.Attributes.ArgParse.Argument.StringArgument(dest, metaName, optional=False, help='')[source]
Represents a simple string argument.
A list of strings is available as
StringListArgument
.Inheritance
- __init__(dest, metaName, optional=False, help='')[source]
The constructor expects positional (
*args
) and/or named parameters (**kwargs
) which are passed without modification toadd_argument()
.
- property Args: Tuple
A tuple of additional positional parameters (
*args
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- classmethod GetAttributes(method, includeSubClasses=True)
Returns attached attributes of this kind for a given method.
- classmethod GetClasses(scope=None, subclassOf=None)
Return a generator for all classes, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.subclassOf
- when the item is a subclass ofsubclassOf
.
- Parameters:
- Return type:
- Returns:
A sequence of classes where this attribute is attached to.
- classmethod GetFunctions(scope=None)
Return a generator for all functions, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- classmethod GetMethods(scope=None)
Return a generator for all methods, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- class property HasClassAttributes: bool
Check if class has Attributes.
- Returns:
True
, if the class has Attributes.
- class property HasMethodAttributes: bool
Check if class has any method with Attributes.
- Returns:
True
, if the class has any method with Attributes.
- property KWArgs: Dict
A dictionary of additional named parameters (
**kwargs
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- static _AppendAttribute(entity, attribute)
Append an attribute to a language entity (class, method, function).
Hint
This method can be used in attribute groups to apply multiple attributes within
__call__
method.class GroupAttribute(Attribute): def __call__(self, entity: Entity) -> Entity: self._AppendAttribute(entity, SimpleAttribute(...)) self._AppendAttribute(entity, SimpleAttribute(...)) return entity
- __call__(entity)
Attributes get attached to an entity (function, class, method) and an index is updated at the attribute for reverse lookups.
- classmethod __init_subclass__(**kwargs)
Ensure each derived class has its own instance of
_functions
,_classes
and_methods
to register the usage of that Attribute.
- _classes: ClassVar[List[Any]] = []
List of classes, this Attribute was attached to.
- _functions: ClassVar[List[Any]] = []
List of functions, this Attribute was attached to.
- _methods: ClassVar[List[Any]] = []
List of methods, this Attribute was attached to.
- _scope: ClassVar[AttributeScope] = 7
Allowed language construct this attribute can be used with.
- _handler: Callable
Reference to a method that is called to handle e.g. a sub-command.
- class pyTooling.Attributes.ArgParse.Argument.IntegerArgument(dest, metaName, optional=False, help='')[source]
Represents an integer argument.
A list of strings is available as
StringListArgument
.Inheritance
- __init__(dest, metaName, optional=False, help='')[source]
The constructor expects positional (
*args
) and/or named parameters (**kwargs
) which are passed without modification toadd_argument()
.
- property Args: Tuple
A tuple of additional positional parameters (
*args
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- classmethod GetAttributes(method, includeSubClasses=True)
Returns attached attributes of this kind for a given method.
- classmethod GetClasses(scope=None, subclassOf=None)
Return a generator for all classes, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.subclassOf
- when the item is a subclass ofsubclassOf
.
- Parameters:
- Return type:
- Returns:
A sequence of classes where this attribute is attached to.
- classmethod GetFunctions(scope=None)
Return a generator for all functions, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- classmethod GetMethods(scope=None)
Return a generator for all methods, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- class property HasClassAttributes: bool
Check if class has Attributes.
- Returns:
True
, if the class has Attributes.
- class property HasMethodAttributes: bool
Check if class has any method with Attributes.
- Returns:
True
, if the class has any method with Attributes.
- property KWArgs: Dict
A dictionary of additional named parameters (
**kwargs
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- static _AppendAttribute(entity, attribute)
Append an attribute to a language entity (class, method, function).
Hint
This method can be used in attribute groups to apply multiple attributes within
__call__
method.class GroupAttribute(Attribute): def __call__(self, entity: Entity) -> Entity: self._AppendAttribute(entity, SimpleAttribute(...)) self._AppendAttribute(entity, SimpleAttribute(...)) return entity
- __call__(entity)
Attributes get attached to an entity (function, class, method) and an index is updated at the attribute for reverse lookups.
- classmethod __init_subclass__(**kwargs)
Ensure each derived class has its own instance of
_functions
,_classes
and_methods
to register the usage of that Attribute.
- _classes: ClassVar[List[Any]] = []
List of classes, this Attribute was attached to.
- _functions: ClassVar[List[Any]] = []
List of functions, this Attribute was attached to.
- _methods: ClassVar[List[Any]] = []
List of methods, this Attribute was attached to.
- _scope: ClassVar[AttributeScope] = 7
Allowed language construct this attribute can be used with.
- _handler: Callable
Reference to a method that is called to handle e.g. a sub-command.
- class pyTooling.Attributes.ArgParse.Argument.FloatArgument(dest, metaName, optional=False, help='')[source]
Represents a floating point number argument.
A list of strings is available as
StringListArgument
.Inheritance
- __init__(dest, metaName, optional=False, help='')[source]
The constructor expects positional (
*args
) and/or named parameters (**kwargs
) which are passed without modification toadd_argument()
.
- property Args: Tuple
A tuple of additional positional parameters (
*args
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- classmethod GetAttributes(method, includeSubClasses=True)
Returns attached attributes of this kind for a given method.
- classmethod GetClasses(scope=None, subclassOf=None)
Return a generator for all classes, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.subclassOf
- when the item is a subclass ofsubclassOf
.
- Parameters:
- Return type:
- Returns:
A sequence of classes where this attribute is attached to.
- classmethod GetFunctions(scope=None)
Return a generator for all functions, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- classmethod GetMethods(scope=None)
Return a generator for all methods, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- class property HasClassAttributes: bool
Check if class has Attributes.
- Returns:
True
, if the class has Attributes.
- class property HasMethodAttributes: bool
Check if class has any method with Attributes.
- Returns:
True
, if the class has any method with Attributes.
- property KWArgs: Dict
A dictionary of additional named parameters (
**kwargs
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- static _AppendAttribute(entity, attribute)
Append an attribute to a language entity (class, method, function).
Hint
This method can be used in attribute groups to apply multiple attributes within
__call__
method.class GroupAttribute(Attribute): def __call__(self, entity: Entity) -> Entity: self._AppendAttribute(entity, SimpleAttribute(...)) self._AppendAttribute(entity, SimpleAttribute(...)) return entity
- __call__(entity)
Attributes get attached to an entity (function, class, method) and an index is updated at the attribute for reverse lookups.
- classmethod __init_subclass__(**kwargs)
Ensure each derived class has its own instance of
_functions
,_classes
and_methods
to register the usage of that Attribute.
- _classes: ClassVar[List[Any]] = []
List of classes, this Attribute was attached to.
- _functions: ClassVar[List[Any]] = []
List of functions, this Attribute was attached to.
- _methods: ClassVar[List[Any]] = []
List of methods, this Attribute was attached to.
- _scope: ClassVar[AttributeScope] = 7
Allowed language construct this attribute can be used with.
- _handler: Callable
Reference to a method that is called to handle e.g. a sub-command.
- class pyTooling.Attributes.ArgParse.Argument.PathArgument(dest, metaName, optional=False, help='')[source]
Represents a single path argument.
A list of paths is available as
PathListArgument
.Inheritance
- __init__(dest, metaName, optional=False, help='')[source]
The constructor expects positional (
*args
) and/or named parameters (**kwargs
) which are passed without modification toadd_argument()
.
- property Args: Tuple
A tuple of additional positional parameters (
*args
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- classmethod GetAttributes(method, includeSubClasses=True)
Returns attached attributes of this kind for a given method.
- classmethod GetClasses(scope=None, subclassOf=None)
Return a generator for all classes, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.subclassOf
- when the item is a subclass ofsubclassOf
.
- Parameters:
- Return type:
- Returns:
A sequence of classes where this attribute is attached to.
- classmethod GetFunctions(scope=None)
Return a generator for all functions, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- classmethod GetMethods(scope=None)
Return a generator for all methods, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- class property HasClassAttributes: bool
Check if class has Attributes.
- Returns:
True
, if the class has Attributes.
- class property HasMethodAttributes: bool
Check if class has any method with Attributes.
- Returns:
True
, if the class has any method with Attributes.
- property KWArgs: Dict
A dictionary of additional named parameters (
**kwargs
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- static _AppendAttribute(entity, attribute)
Append an attribute to a language entity (class, method, function).
Hint
This method can be used in attribute groups to apply multiple attributes within
__call__
method.class GroupAttribute(Attribute): def __call__(self, entity: Entity) -> Entity: self._AppendAttribute(entity, SimpleAttribute(...)) self._AppendAttribute(entity, SimpleAttribute(...)) return entity
- __call__(entity)
Attributes get attached to an entity (function, class, method) and an index is updated at the attribute for reverse lookups.
- classmethod __init_subclass__(**kwargs)
Ensure each derived class has its own instance of
_functions
,_classes
and_methods
to register the usage of that Attribute.
- _classes: ClassVar[List[Any]] = []
List of classes, this Attribute was attached to.
- _functions: ClassVar[List[Any]] = []
List of functions, this Attribute was attached to.
- _methods: ClassVar[List[Any]] = []
List of methods, this Attribute was attached to.
- _scope: ClassVar[AttributeScope] = 7
Allowed language construct this attribute can be used with.
- _handler: Callable
Reference to a method that is called to handle e.g. a sub-command.
- class pyTooling.Attributes.ArgParse.Argument.ListArgument(dest, metaName, type=<class 'str'>, optional=False, help='')[source]
Represents a list of string argument (
StringArgument
).Inheritance
- __init__(dest, metaName, type=<class 'str'>, optional=False, help='')[source]
The constructor expects positional (
*args
) and/or named parameters (**kwargs
) which are passed without modification toadd_argument()
.
- property Args: Tuple
A tuple of additional positional parameters (
*args
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- classmethod GetAttributes(method, includeSubClasses=True)
Returns attached attributes of this kind for a given method.
- classmethod GetClasses(scope=None, subclassOf=None)
Return a generator for all classes, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.subclassOf
- when the item is a subclass ofsubclassOf
.
- Parameters:
- Return type:
- Returns:
A sequence of classes where this attribute is attached to.
- classmethod GetFunctions(scope=None)
Return a generator for all functions, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- classmethod GetMethods(scope=None)
Return a generator for all methods, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- class property HasClassAttributes: bool
Check if class has Attributes.
- Returns:
True
, if the class has Attributes.
- class property HasMethodAttributes: bool
Check if class has any method with Attributes.
- Returns:
True
, if the class has any method with Attributes.
- property KWArgs: Dict
A dictionary of additional named parameters (
**kwargs
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- static _AppendAttribute(entity, attribute)
Append an attribute to a language entity (class, method, function).
Hint
This method can be used in attribute groups to apply multiple attributes within
__call__
method.class GroupAttribute(Attribute): def __call__(self, entity: Entity) -> Entity: self._AppendAttribute(entity, SimpleAttribute(...)) self._AppendAttribute(entity, SimpleAttribute(...)) return entity
- __call__(entity)
Attributes get attached to an entity (function, class, method) and an index is updated at the attribute for reverse lookups.
- classmethod __init_subclass__(**kwargs)
Ensure each derived class has its own instance of
_functions
,_classes
and_methods
to register the usage of that Attribute.
- _classes: ClassVar[List[Any]] = []
List of classes, this Attribute was attached to.
- _functions: ClassVar[List[Any]] = []
List of functions, this Attribute was attached to.
- _methods: ClassVar[List[Any]] = []
List of methods, this Attribute was attached to.
- _scope: ClassVar[AttributeScope] = 7
Allowed language construct this attribute can be used with.
- _handler: Callable
Reference to a method that is called to handle e.g. a sub-command.
- class pyTooling.Attributes.ArgParse.Argument.StringListArgument(dest, metaName, optional=False, help='')[source]
Represents a list of string argument (
StringArgument
).Inheritance
- __init__(dest, metaName, optional=False, help='')[source]
The constructor expects positional (
*args
) and/or named parameters (**kwargs
) which are passed without modification toadd_argument()
.
- property Args: Tuple
A tuple of additional positional parameters (
*args
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- classmethod GetAttributes(method, includeSubClasses=True)
Returns attached attributes of this kind for a given method.
- classmethod GetClasses(scope=None, subclassOf=None)
Return a generator for all classes, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.subclassOf
- when the item is a subclass ofsubclassOf
.
- Parameters:
- Return type:
- Returns:
A sequence of classes where this attribute is attached to.
- classmethod GetFunctions(scope=None)
Return a generator for all functions, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- classmethod GetMethods(scope=None)
Return a generator for all methods, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- class property HasClassAttributes: bool
Check if class has Attributes.
- Returns:
True
, if the class has Attributes.
- class property HasMethodAttributes: bool
Check if class has any method with Attributes.
- Returns:
True
, if the class has any method with Attributes.
- property KWArgs: Dict
A dictionary of additional named parameters (
**kwargs
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- static _AppendAttribute(entity, attribute)
Append an attribute to a language entity (class, method, function).
Hint
This method can be used in attribute groups to apply multiple attributes within
__call__
method.class GroupAttribute(Attribute): def __call__(self, entity: Entity) -> Entity: self._AppendAttribute(entity, SimpleAttribute(...)) self._AppendAttribute(entity, SimpleAttribute(...)) return entity
- __call__(entity)
Attributes get attached to an entity (function, class, method) and an index is updated at the attribute for reverse lookups.
- classmethod __init_subclass__(**kwargs)
Ensure each derived class has its own instance of
_functions
,_classes
and_methods
to register the usage of that Attribute.
- _classes: ClassVar[List[Any]] = []
List of classes, this Attribute was attached to.
- _functions: ClassVar[List[Any]] = []
List of functions, this Attribute was attached to.
- _methods: ClassVar[List[Any]] = []
List of methods, this Attribute was attached to.
- _scope: ClassVar[AttributeScope] = 7
Allowed language construct this attribute can be used with.
- _handler: Callable
Reference to a method that is called to handle e.g. a sub-command.
- class pyTooling.Attributes.ArgParse.Argument.IntegerListArgument(dest, metaName, optional=False, help='')[source]
Represents a list of string argument (
StringArgument
).Inheritance
- __init__(dest, metaName, optional=False, help='')[source]
The constructor expects positional (
*args
) and/or named parameters (**kwargs
) which are passed without modification toadd_argument()
.
- property Args: Tuple
A tuple of additional positional parameters (
*args
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- classmethod GetAttributes(method, includeSubClasses=True)
Returns attached attributes of this kind for a given method.
- classmethod GetClasses(scope=None, subclassOf=None)
Return a generator for all classes, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.subclassOf
- when the item is a subclass ofsubclassOf
.
- Parameters:
- Return type:
- Returns:
A sequence of classes where this attribute is attached to.
- classmethod GetFunctions(scope=None)
Return a generator for all functions, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- classmethod GetMethods(scope=None)
Return a generator for all methods, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- class property HasClassAttributes: bool
Check if class has Attributes.
- Returns:
True
, if the class has Attributes.
- class property HasMethodAttributes: bool
Check if class has any method with Attributes.
- Returns:
True
, if the class has any method with Attributes.
- property KWArgs: Dict
A dictionary of additional named parameters (
**kwargs
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- static _AppendAttribute(entity, attribute)
Append an attribute to a language entity (class, method, function).
Hint
This method can be used in attribute groups to apply multiple attributes within
__call__
method.class GroupAttribute(Attribute): def __call__(self, entity: Entity) -> Entity: self._AppendAttribute(entity, SimpleAttribute(...)) self._AppendAttribute(entity, SimpleAttribute(...)) return entity
- __call__(entity)
Attributes get attached to an entity (function, class, method) and an index is updated at the attribute for reverse lookups.
- classmethod __init_subclass__(**kwargs)
Ensure each derived class has its own instance of
_functions
,_classes
and_methods
to register the usage of that Attribute.
- _classes: ClassVar[List[Any]] = []
List of classes, this Attribute was attached to.
- _functions: ClassVar[List[Any]] = []
List of functions, this Attribute was attached to.
- _methods: ClassVar[List[Any]] = []
List of methods, this Attribute was attached to.
- _scope: ClassVar[AttributeScope] = 7
Allowed language construct this attribute can be used with.
- _handler: Callable
Reference to a method that is called to handle e.g. a sub-command.
- class pyTooling.Attributes.ArgParse.Argument.FloatListArgument(dest, metaName, optional=False, help='')[source]
Represents a list of string argument (
StringArgument
).Inheritance
- __init__(dest, metaName, optional=False, help='')[source]
The constructor expects positional (
*args
) and/or named parameters (**kwargs
) which are passed without modification toadd_argument()
.
- property Args: Tuple
A tuple of additional positional parameters (
*args
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- classmethod GetAttributes(method, includeSubClasses=True)
Returns attached attributes of this kind for a given method.
- classmethod GetClasses(scope=None, subclassOf=None)
Return a generator for all classes, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.subclassOf
- when the item is a subclass ofsubclassOf
.
- Parameters:
- Return type:
- Returns:
A sequence of classes where this attribute is attached to.
- classmethod GetFunctions(scope=None)
Return a generator for all functions, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- classmethod GetMethods(scope=None)
Return a generator for all methods, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- class property HasClassAttributes: bool
Check if class has Attributes.
- Returns:
True
, if the class has Attributes.
- class property HasMethodAttributes: bool
Check if class has any method with Attributes.
- Returns:
True
, if the class has any method with Attributes.
- property KWArgs: Dict
A dictionary of additional named parameters (
**kwargs
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- static _AppendAttribute(entity, attribute)
Append an attribute to a language entity (class, method, function).
Hint
This method can be used in attribute groups to apply multiple attributes within
__call__
method.class GroupAttribute(Attribute): def __call__(self, entity: Entity) -> Entity: self._AppendAttribute(entity, SimpleAttribute(...)) self._AppendAttribute(entity, SimpleAttribute(...)) return entity
- __call__(entity)
Attributes get attached to an entity (function, class, method) and an index is updated at the attribute for reverse lookups.
- classmethod __init_subclass__(**kwargs)
Ensure each derived class has its own instance of
_functions
,_classes
and_methods
to register the usage of that Attribute.
- _classes: ClassVar[List[Any]] = []
List of classes, this Attribute was attached to.
- _functions: ClassVar[List[Any]] = []
List of functions, this Attribute was attached to.
- _methods: ClassVar[List[Any]] = []
List of methods, this Attribute was attached to.
- _scope: ClassVar[AttributeScope] = 7
Allowed language construct this attribute can be used with.
- _handler: Callable
Reference to a method that is called to handle e.g. a sub-command.
- class pyTooling.Attributes.ArgParse.Argument.PathListArgument(dest, metaName, optional=False, help='')[source]
Represents a list of path arguments (
PathArgument
).Inheritance
- __init__(dest, metaName, optional=False, help='')[source]
The constructor expects positional (
*args
) and/or named parameters (**kwargs
) which are passed without modification toadd_argument()
.
- property Args: Tuple
A tuple of additional positional parameters (
*args
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- classmethod GetAttributes(method, includeSubClasses=True)
Returns attached attributes of this kind for a given method.
- classmethod GetClasses(scope=None, subclassOf=None)
Return a generator for all classes, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.subclassOf
- when the item is a subclass ofsubclassOf
.
- Parameters:
- Return type:
- Returns:
A sequence of classes where this attribute is attached to.
- classmethod GetFunctions(scope=None)
Return a generator for all functions, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- classmethod GetMethods(scope=None)
Return a generator for all methods, where this attribute is attached to.
- The resulting item stream can be filtered by:
scope
- when the item is a nested class in scopescope
.
- class property HasClassAttributes: bool
Check if class has Attributes.
- Returns:
True
, if the class has Attributes.
- class property HasMethodAttributes: bool
Check if class has any method with Attributes.
- Returns:
True
, if the class has any method with Attributes.
- property KWArgs: Dict
A dictionary of additional named parameters (
**kwargs
) passed to the attribute. These additional parameters are passed without modification toArgumentParser
.
- static _AppendAttribute(entity, attribute)
Append an attribute to a language entity (class, method, function).
Hint
This method can be used in attribute groups to apply multiple attributes within
__call__
method.class GroupAttribute(Attribute): def __call__(self, entity: Entity) -> Entity: self._AppendAttribute(entity, SimpleAttribute(...)) self._AppendAttribute(entity, SimpleAttribute(...)) return entity
- __call__(entity)
Attributes get attached to an entity (function, class, method) and an index is updated at the attribute for reverse lookups.
- classmethod __init_subclass__(**kwargs)
Ensure each derived class has its own instance of
_functions
,_classes
and_methods
to register the usage of that Attribute.
- _classes: ClassVar[List[Any]] = []
List of classes, this Attribute was attached to.
- _functions: ClassVar[List[Any]] = []
List of functions, this Attribute was attached to.
- _methods: ClassVar[List[Any]] = []
List of methods, this Attribute was attached to.
- _scope: ClassVar[AttributeScope] = 7
Allowed language construct this attribute can be used with.
- _handler: Callable
Reference to a method that is called to handle e.g. a sub-command.