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 a ValuedTupleArgument with a single dash in front of the switch name.

  • LongTupleFlag: Represents a ValuedTupleArgument with a double dash in front of the switch name.

  • WindowsTupleFlag: Represents a ValuedTupleArgument with a single slash in front of the switch name.


Classes

class pyTooling.CLIAbstraction.ValuedTupleFlag.ShortTupleFlag[source]

Represents a ValuedTupleArgument with a single dash in front of the switch name.

Example:

  • -file file1.txt

Inheritance

Inheritance diagram of ShortTupleFlag

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

Union[str, Iterable[str]]

Returns:

Formatted argument as tuple of strings.

Raises:

ValueError – If internal name is None.

property Name: str

Get the internal name.

Returns:

Internal name.

property Value: ValueT

Get the internal value.

Returns:

Internal value.

__init__(value)
Parameters:

value (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.ValuedTupleFlag.LongTupleFlag[source]

Represents a ValuedTupleArgument with a double dash in front of the switch name.

Example:

  • --file file1.txt

Inheritance

Inheritance diagram of LongTupleFlag

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

Union[str, Iterable[str]]

Returns:

Formatted argument as tuple of strings.

Raises:

ValueError – If internal name is None.

property Name: str

Get the internal name.

Returns:

Internal name.

property Value: ValueT

Get the internal value.

Returns:

Internal value.

__init__(value)
Parameters:

value (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.ValuedTupleFlag.WindowsTupleFlag[source]

Represents a ValuedTupleArgument with a single slash in front of the switch name.

Example:

  • /file file1.txt

Inheritance

Inheritance diagram of WindowsTupleFlag

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

Union[str, Iterable[str]]

Returns:

Formatted argument as tuple of strings.

Raises:

ValueError – If internal name is None.

property Name: str

Get the internal name.

Returns:

Internal name.

property Value: ValueT

Get the internal value.

Returns:

Internal value.

__init__(value)
Parameters:

value (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.