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

Classes


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

Inheritance diagram of ValuedFlagList

Parameters:
classmethod __init_subclass__(*args, pattern='{0}={1}', **kwargs)[source]

This method is called when a class is derived.

Parameters:
  • args (Any) – Any positional arguments.

  • pattern (str) – This pattern is used to format an argument.

  • kwargs (Any) – Any keyword argument.

static __new__(cls, *args, **kwargs)[source]
Parameters:
__init__(value)[source]
Parameters:

value (List[ValueT])

Return type:

None

property Value: List[str]

Get the internal value.

Returns:

Internal value.

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:

Union[str, Iterable[str]]

Returns:

Formatted argument.

Raises:

ValueError – If internal name is None.

__str__()[source]

Return a string representation of this argument instance.

Return type:

str

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:

str

Returns:

Comma separated sequence of arguments formatted and each enclosed in double quotes.

property Name: str

Get the internal name.

Returns:

Internal name.

__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

Inheritance diagram of ShortValuedFlagList

Parameters:
classmethod __init_subclass__(*args, pattern='-{0}={1}', **kwargs)[source]

This method is called when a class is derived.

Parameters:
  • args (Any) – Any positional arguments.

  • pattern (str) – This pattern is used to format an argument.

  • kwargs (Any) – Any keyword argument.

static __new__(cls, *args, **kwargs)[source]
Parameters:
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:

Union[str, Iterable[str]]

Returns:

Formatted argument.

Raises:

ValueError – If internal name is None.

property Name: str

Get the internal name.

Returns:

Internal name.

property Value: List[str]

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 (List[ValueT])

Return type:

None

__repr__()

Return a string representation of this argument instance.

Return type:

str

Returns:

Comma separated sequence of arguments formatted and each enclosed in double quotes.

__str__()

Return a string representation of this argument instance.

Return type:

str

Returns:

Space 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

Inheritance diagram of LongValuedFlagList

Parameters:
classmethod __init_subclass__(*args, pattern='--{0}={1}', **kwargs)[source]

This method is called when a class is derived.

Parameters:
  • args (Any) – Any positional arguments.

  • pattern (str) – This pattern is used to format an argument.

  • kwargs (Any) – Any keyword argument.

static __new__(cls, *args, **kwargs)[source]
Parameters:
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:

Union[str, Iterable[str]]

Returns:

Formatted argument.

Raises:

ValueError – If internal name is None.

property Name: str

Get the internal name.

Returns:

Internal name.

property Value: List[str]

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 (List[ValueT])

Return type:

None

__repr__()

Return a string representation of this argument instance.

Return type:

str

Returns:

Comma separated sequence of arguments formatted and each enclosed in double quotes.

__str__()

Return a string representation of this argument instance.

Return type:

str

Returns:

Space 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

Inheritance diagram of WindowsValuedFlagList

Parameters:
classmethod __init_subclass__(*args, pattern='/{0}:{1}', **kwargs)[source]

This method is called when a class is derived.

Parameters:
  • args (Any) – Any positional arguments.

  • pattern (str) – This pattern is used to format an argument.

  • kwargs (Any) – Any keyword argument.

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:

Union[str, Iterable[str]]

Returns:

Formatted argument.

Raises:

ValueError – If internal name is None.

property Name: str

Get the internal name.

Returns:

Internal name.

property Value: List[str]

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 (List[ValueT])

Return type:

None

static __new__(cls, *args, **kwargs)[source]
Parameters:
__repr__()

Return a string representation of this argument instance.

Return type:

str

Returns:

Comma separated sequence of arguments formatted and each enclosed in double quotes.

__str__()

Return a string representation of this argument instance.

Return type:

str

Returns:

Space separated sequence of arguments formatted and each enclosed in double quotes.