SPPAS 4.22

https://sppas.org/

Module sppas.src.wkps

Class States

Description

All states of any FileBase.

Example
Example
 >>> with States() as s:
 >>> print(s.UNUSED)

This class is a solution to mimic an 'Enum' but is compatible with both Python 2.7 and Python 3+.

Constructor

Create the dictionary.

View Source
def __init__(self):
    """Create the dictionary."""
    self.__dict__ = dict(MISSING=-1, UNUSED=0, CHECKED=1, LOCKED=2, AT_LEAST_ONE_CHECKED=3, AT_LEAST_ONE_LOCKED=4)

Overloads

__enter__

View Source
def __enter__(self):
    return self

__exit__

View Source
def __exit__(self, exc_type, exc_value, traceback):
    pass