Skip to content

vtf iosys gates

srccircumflex edited this page Jan 6, 2023 · 4 revisions

↑ vtf-iosys

gates

The module provides the possibility to switch some escape sequences of the framework on and off centrally.

For example, the future creation of new SGR sequences in runtime can be switched off via:

>>> __STYLE_GATE__.disable()

Module contents

Constants

class gates.__DECPM_GATE__ = Gate()

This gate is adapted to the methods in factory class DECPrivateMode. After the deactivation, the methods return an empty EscSegment (<EscSegment("")>).

class gates.__STYLE_GATE__ = Gate()

This gate is adapted to some factory methods of "non-functional" escape sequences in os and cursor; and to the Types in sgr. After the deactivation, the methods and types return an empty EscSegment (<EscSegment("")>).

Objects

class gates.Gate

A wrapper class for a decorator that executes the function or an alternative depending on self.status (control via enable | disable | destroy).

Statuses:
  • True : enabled
  • None : disabled
  • False : permanently disabled (destroyed)

state: bool | None

__bool__() -> bool

bool(self.state)

__call__(alt=lambda cls, *args, **kwargs: str()) -> Callable[ [...], ...]

The wrapper function.

destroy() -> None

Set status to False, future executions of enable | disable have no effect in runtime.

disable() -> bool

Set status to None, the alternative function will be executed. Return whether the gate is not permanently disabled.

enable() -> bool

Set status to True, the original function will be executed. Return whether the gate is not permanently disabled.

wrapper(alt=lambda cls, *args, **kwargs: str()) -> Callable[ [...], ...]

The wrapper function.

Date: 11 Nov 2022
Version: 0.1
Author: Adrian Hoefflin [srccircumflex]
Doc-Generator: "pyiStructure-RSTGenerator" <prototype>
Clone this wiki locally