vpype_cli._DeferredEvaluator

class _DeferredEvaluator(text, param_name, *args, **kwargs)

Abstract base-class for deferred evaluation of command parameters.

Click parses all command arguments and options before running the corresponding command functions. In contrast, property substitution must be performed just just before a command is executed, since it depends on the current context (e.g. currently defined properties and current layer ID).

To address this issue, sub-classes of click.ParamType may return some _DeferredEvaluator instance instead of directly converting the user input. The command decorators (e.g. generator() and friends) will detect such instances, perform the conversion, and forward the converted value to the command function.

Methods

evaluate

Sub-class must override this function and return the converted value of self._text

Attributes

_abc_impl

Methods

abstract _DeferredEvaluator.evaluate(state)

Sub-class must override this function and return the converted value of self._text

Return type

Any

Attributes

_DeferredEvaluator._abc_impl = <_abc_data object>