pyTooling.CLIAbstraction.ValuedTupleFlag
Valued tuple-flag arguments represent a name and a value as a 2-tuple.
See also
For flags with a value.
→ValuedFlag
For flags that have an optional value.
→NamedOptionalValuedFlag
Classes
ShortTupleFlag
: Represents aValuedTupleArgument
with a single dash in front of the switch name.LongTupleFlag
: Represents aValuedTupleArgument
with a double dash in front of the switch name.WindowsTupleFlag
: Represents aValuedTupleArgument
with a single slash in front of the switch name.
Classes
- class pyTooling.CLIAbstraction.ValuedTupleFlag.ShortTupleFlag(value)[source]
Represents a
ValuedTupleArgument
with a single dash in front of the switch name.Example:
-file file1.txt
Inheritance
- classmethod __init_subclass__(*args, pattern='-{0}', **kwargs)[source]
This method is called when a class is derived.
- AsArgument()
Convert this argument instance to a sequence of string representations with proper escaping using the matching pattern based on the internal name and value.
- Return type:
- Returns:
Formatted argument as tuple of strings.
- Raises:
ValueError – If internal name is None.
- property Value: ValueT
Get the internal value.
- Returns:
Internal value.
- __class_getitem__()
Parameterizes a generic class.
At least, parameterizing a generic class is the main thing this method does. For example, for some generic class Foo, this is called when we do Foo[int] - there, with cls=Foo and params=int.
However, note that this method is also called when defining generic classes in the first place with class Foo[T]: ….
- __init__(value)
- Parameters:
value (ValueT)
- Return type:
None
- __repr__()
Return a string representation of this argument instance.
- Return type:
- Returns:
Comma separated sequence of arguments formatted and each enclosed in double quotes.
- class pyTooling.CLIAbstraction.ValuedTupleFlag.LongTupleFlag(value)[source]
Represents a
ValuedTupleArgument
with a double dash in front of the switch name.Example:
--file file1.txt
Inheritance
- classmethod __init_subclass__(*args, pattern='--{0}', **kwargs)[source]
This method is called when a class is derived.
- AsArgument()
Convert this argument instance to a sequence of string representations with proper escaping using the matching pattern based on the internal name and value.
- Return type:
- Returns:
Formatted argument as tuple of strings.
- Raises:
ValueError – If internal name is None.
- property Value: ValueT
Get the internal value.
- Returns:
Internal value.
- __class_getitem__()
Parameterizes a generic class.
At least, parameterizing a generic class is the main thing this method does. For example, for some generic class Foo, this is called when we do Foo[int] - there, with cls=Foo and params=int.
However, note that this method is also called when defining generic classes in the first place with class Foo[T]: ….
- __init__(value)
- Parameters:
value (ValueT)
- Return type:
None
- __repr__()
Return a string representation of this argument instance.
- Return type:
- Returns:
Comma separated sequence of arguments formatted and each enclosed in double quotes.
- class pyTooling.CLIAbstraction.ValuedTupleFlag.WindowsTupleFlag(value)[source]
Represents a
ValuedTupleArgument
with a single slash in front of the switch name.Example:
/file file1.txt
Inheritance
- classmethod __init_subclass__(*args, pattern='/{0}', **kwargs)[source]
This method is called when a class is derived.
- AsArgument()
Convert this argument instance to a sequence of string representations with proper escaping using the matching pattern based on the internal name and value.
- Return type:
- Returns:
Formatted argument as tuple of strings.
- Raises:
ValueError – If internal name is None.
- property Value: ValueT
Get the internal value.
- Returns:
Internal value.
- __class_getitem__()
Parameterizes a generic class.
At least, parameterizing a generic class is the main thing this method does. For example, for some generic class Foo, this is called when we do Foo[int] - there, with cls=Foo and params=int.
However, note that this method is also called when defining generic classes in the first place with class Foo[T]: ….
- __init__(value)
- Parameters:
value (ValueT)
- Return type:
None
- __repr__()
Return a string representation of this argument instance.
- Return type:
- Returns:
Comma separated sequence of arguments formatted and each enclosed in double quotes.