![]() |
StrokeSegLab
|
Public Member Functions | |
| None | __init__ (self) |
| T | get (self, str key, T default=None) |
| None | set (self, str key, T value) |
Protected Attributes | |
| dict | _options = {} |
Singleton class to manage application option with a dictionnary.
Options are execution parameters that change with each run (input path, save probability map, ...)
Args:
metaclass (_type_, optional): The metaclass controls the creation of the class itself. Defaults to SingletonMeta, which makes sure only one object of the class is ever created (singleton pattern)
| None option_manager.Option.__init__ | ( | self | ) |
Initialize the option class with just a dictionnary
| T option_manager.Option.get | ( | self, | |
| str | key, | ||
| T | default = None ) |
Get the value for a key
Args:
key (str): Key name
default (T, optional): Value to return if the key doesn't exist. Defaults to None
Returns:
T: Return value corresponding to the key
| None option_manager.Option.set | ( | self, | |
| str | key, | ||
| T | value ) |
Set or add a value for a key
Args:
key (str): Key name
value (T): Value corresponding to the key