pyTooling.CLIAbstraction.ValuedFlagList
List of valued flags are argument lists where each item is a valued flag (See
ValuedFlag
).
Each list item gets translated into a ***ValuedFlag
, with the same flag name, but differing values.
See also
For single valued flags.
→ValuedFlag
For list of strings.
→StringListArgument
For list of paths.
→PathListArgument
Classes
ValuedFlagList
: Class and base-class for all ValuedFlagList classes, which represents a list of valued flags.ShortValuedFlagList
: Represents aValuedFlagArgument
with a single dash.LongValuedFlagList
: Represents aValuedFlagArgument
with a double dash.WindowsValuedFlagList
: Represents aValuedFlagArgument
with a single slash.
Classes
- class pyTooling.CLIAbstraction.ValuedFlagList.ValuedFlagList(value)[source]
Class and base-class for all ValuedFlagList classes, which represents a list of valued flags.
Each list element gets translated to a valued flag using the pattern for formatting. See
ValuedFlag
for more details on valued flags.Example:
file=file1.log file=file2.log
Inheritance
- classmethod __init_subclass__(*args, pattern='{0}={1}', **kwargs)[source]
This method is called when a class is derived.
- AsArgument()[source]
Convert this argument instance to a string representation with proper escaping using the matching pattern based on the internal name and value.
- Return type:
- Returns:
Formatted argument.
- Raises:
ValueError – If internal name is None.
- __str__()[source]
Return a string representation of this argument instance.
- Return type:
- Returns:
Space separated sequence of arguments formatted and each enclosed in double quotes.
- __repr__()[source]
Return a string representation of this argument instance.
- Return type:
- Returns:
Comma separated sequence of arguments formatted and each enclosed in double quotes.
- __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]: ….
- class pyTooling.CLIAbstraction.ValuedFlagList.ShortValuedFlagList(value)[source]
Represents a
ValuedFlagArgument
with a single dash.Example:
-file=file1.log -file=file2.log
Inheritance
- classmethod __init_subclass__(*args, pattern='-{0}={1}', **kwargs)[source]
This method is called when a class is derived.
- AsArgument()
Convert this argument instance to a string representation with proper escaping using the matching pattern based on the internal name and value.
- Return type:
- Returns:
Formatted argument.
- Raises:
ValueError – If internal name is None.
- __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]: ….
- __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.ValuedFlagList.LongValuedFlagList(value)[source]
Represents a
ValuedFlagArgument
with a double dash.Example:
--file=file1.log --file=file2.log
Inheritance
- classmethod __init_subclass__(*args, pattern='--{0}={1}', **kwargs)[source]
This method is called when a class is derived.
- AsArgument()
Convert this argument instance to a string representation with proper escaping using the matching pattern based on the internal name and value.
- Return type:
- Returns:
Formatted argument.
- Raises:
ValueError – If internal name is None.
- __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]: ….
- __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.ValuedFlagList.WindowsValuedFlagList(value)[source]
Represents a
ValuedFlagArgument
with a single slash.Example:
/file:file1.log /file:file2.log
Inheritance
- classmethod __init_subclass__(*args, pattern='/{0}:{1}', **kwargs)[source]
This method is called when a class is derived.
- AsArgument()
Convert this argument instance to a string representation with proper escaping using the matching pattern based on the internal name and value.
- Return type:
- Returns:
Formatted argument.
- Raises:
ValueError – If internal name is None.
- __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]: ….
- __repr__()
Return a string representation of this argument instance.
- Return type:
- Returns:
Comma separated sequence of arguments formatted and each enclosed in double quotes.