vpype_cli.PageSizeType#

class PageSizeType(*args, **kwargs)#

click.ParamType sub-class to automatically converts a user-provided page size.

User-provided page size strings are converted into a tuple of float in CSS pixel units. See convert_page_size() for information on the page size descriptor syntax. Property substitution is perfomred as well.

Example:

>>> import click
>>> import vpype_cli
>>> import vpype
>>> @vpype_cli.cli.command(group="my commands")
... @click.argument("fmt", type=vpype_cli.PageSizeType())
... @vpype_cli.generator
... def my_command(fmt: tuple[float, float]):
...     pass

Methods

Attributes

name

the descriptive name of this type

Methods#

Attributes#

PageSizeType.name: str = 'pagesize'#

the descriptive name of this type