Skip to content

dp3.common.state

SharedFlag

SharedFlag(flag: bool = False, banner: str = '')

A bool wrapper that can be shared between multiple objects

Source code in dp3/common/state.py
4
5
6
def __init__(self, flag: bool = False, banner: str = ""):
    self._flag = flag
    self._banner = banner

set

set(flag: bool = True)

Set the flag to flag. True by default.

Source code in dp3/common/state.py
def set(self, flag: bool = True):
    """Set the flag to `flag`. True by default."""
    self._flag = flag

unset

unset()

Unset the flag.

Source code in dp3/common/state.py
def unset(self):
    """Unset the flag."""
    self._flag = False

isset

isset()

Check if the flag is set.

Source code in dp3/common/state.py
def isset(self):
    """Check if the flag is set."""
    return self._flag