-
Notifications
You must be signed in to change notification settings - Fork 64
Kathara.setting.Setting
- AVAILABLE_DEBUG_LEVELS
- AVAILABLE_MANAGERS
- ONE_WEEK
- DEFAULTS
- SETTINGS_FILENAME
- DEFAULT_SETTINGS_PATH
Class responsible for interacting with Kathara Settings.
__init__() → None
check() → None
Check if Kathara is correctly working.
Check if the selected manager is available. Check the presence of Kathara updates. Check the correctness and validity of the net_prefix, device_prefix and debug level.
Returns: None
Raises:
-
SettingsError
: If the Networks Prefix does not contain only lowercase letters and underscore. -
SettingsError
: If the Device Prefix does not contain only lowercase letters and underscore. -
SettingsError
: If the Debug Level specified is not allowed.
check_image(image: 'str' = None) → None
Check if the specified image is valid.
Args:
-
image
(str): The name of the image to check. If None, check the default image.
Returns: None
Raises:
-
ConnectionError
: If the image is not locally available and there is no connection to a remote image repository. -
ImageNotFoundError
: If the image is not found.
check_terminal(terminal: 'str' = None) → bool
Check that the selected terminal is available.
Args:
-
terminal
(str): The selected terminal path. If None, check the availability of the default terminal.
Returns:
-
bool
: True if the selected terminal is TMUX (that do not require path), else False.
Raises:
-
SettingError
: If the terminal emulator specified is not found.
get_instance() → Setting
Return an instance of Setting.
Returns:
-
Kathara.setting.Setting
: An instance of Setting.
Raises:
-
InstantiationError
: If two instances of the class are created.
load_from_dict(settings: 'Dict[str, Any]') → None
Load settings from a dict.
Args:
-
settings
(Dict[str, Any]): A dict containing the settings name as key and its value.
Returns: None
load_from_disk(path: 'Optional[str]' = None) → None
Load settings from a specific path on disk.
Args:
-
path
(Optional[str]): A path where the kathara.conf file is stored. If None, default path is used.
Returns: None
Raises:
-
SettingsNotFound
: If the Settings file is not found in specified path. -
SettingsError
: If the specified file is not a valid JSON.
load_settings_addon() → None
Load a setting addon to the base settings.
Returns: None
save_to_disk(path: 'Optional[str]' = None) → None
Saves settings to a kathara.conf file in the specified path on disk.
Args:
-
path
(Optional[str]): A path where the kathara.conf file will be stored. If None, default path is used.
Returns: None
wipe_from_disk() → None
Remove settings from the default settings path on disk.
Returns: None
This file was automatically generated via lazydocs.
Website: kathara.org
Contact us: contact@kathara.org