forked from sh-edraft.de/sh_linux_installation_scripts
25 lines
766 B
Python
25 lines
766 B
Python
import traceback
|
|
|
|
from cpl_core.configuration.configuration_model_abc import ConfigurationModelABC
|
|
from cpl_core.console import Console
|
|
|
|
|
|
class OSSettings(ConfigurationModelABC):
|
|
|
|
def __init__(self):
|
|
ConfigurationModelABC.__init__(self)
|
|
|
|
self._operating_systems = []
|
|
|
|
@property
|
|
def operating_systems(self) -> list[str]:
|
|
return self._operating_systems
|
|
|
|
def from_dict(self, settings: dict):
|
|
try:
|
|
for os in settings['OperatingSystems']:
|
|
self._operating_systems.append(os)
|
|
except Exception as e:
|
|
Console.error(f'[ ERROR ] [ {__name__} ]: Reading error in {self.__name__} settings')
|
|
Console.error(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}')
|