PageSizeType

class PageSizeType

click.ParamType sub-class to automatically converts a user-provided page size string into a tuple of float in CSS pixel units. See convert_page_size() for information on the page size descriptor syntax.

Example:

>>> import click
>>> import vpype_cli
>>> import vpype
>>> @vpype_cli.cli.command(group="my commands")
... @click.argument("fmt", type=vpype.PageSizeType())
... @vpype.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