smah.settings.settings

Classes

Settings([config])

class smah.settings.settings.Settings(config=None)[source]

Bases: object

CONFIG_VSN = '0.0.1'
DEFAULT_CONFIG_FILE = '/home/docs/.smah/config.yaml'
config: str
static config_vsn() str[source]
static default_config() str[source]
inference: Inference | None
is_configured()[source]

Checks if the settings are fully configured.

Returns:

True if the settings are configured, False otherwise.

Return type:

bool

load() None[source]

Loads the profile from the profile path and sets the configuration values.

log(level: int = 10, format: bool = True, print: bool = False) None[source]

Log settings and optionally print to stdout.

Parameters:
  • format (bool) – Flag to enable/disable formatting of settings when printing.

  • print (bool) – Flag to enable/disable printing of settings.

save() None[source]

Saves the current settings to the profile path.

system: System | None
to_yaml(options=None) dict[source]

Returns the settings as a YAML dictionary.

Returns:

The settings as a YAML dictionary.

Return type:

dict

user: User | None
vsn: str | None
static vsn_supported(vsn: str | None) bool[source]

Checks if the provided version is supported.

Parameters:

vsn (Optional[str]) – The version string to check.

Returns:

True if the version is supported, False otherwise.

Return type:

bool