-
-
Notifications
You must be signed in to change notification settings - Fork 73
Kathara.setting.Setting
- AVAILABLE_DEBUG_LEVELS
- AVAILABLE_MANAGERS
- ONE_WEEK
- DEFAULTS
- SETTINGS_FILENAME
- DEFAULT_SETTINGS_PATH
Class responsible for interacting with Kathara Settings.
__init__() → Nonecheck() → NoneCheck 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) → NoneCheck 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) → boolCheck 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() → SettingReturn 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]') → NoneLoad 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) → NoneLoad 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() → NoneLoad a setting addon to the base settings.
Returns: None
save_to_disk(path: 'Optional[str]' = None) → NoneSaves 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() → NoneRemove settings from the default settings path on disk.
Returns: None
This file was automatically generated via lazydocs.
Website: kathara.org
Contact us: [email protected]