LengthType¶
-
class
LengthType
¶ click.ParamType
sub-class to automatically converts a user-provided length string (which may contain units) into a value in CSS pixel units. This class usesconvert_length()
internally.Example:
>>> import click >>> import vpype_cli >>> import vpype >>> @vpype_cli.cli.command(group="my commands") ... @click.argument("x", type=vpype.LengthType()) ... @click.option("-o", "--option", type=vpype.LengthType(), default="1mm") ... @vpype.generator ... def my_command(x: float, option: float): ... pass
Methods
Attributes
the descriptive name of this type