Fixed KeyError in configs

Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
Dimitris Zlatanidis 2022-10-14 20:27:37 +03:00
parent 1406064374
commit 143670754d

View file

@ -59,41 +59,44 @@ class Configs:
with open(config_file, 'r') as conf:
configs = yaml.safe_load(conf)
config = configs['configs']
try:
config = configs['configs']
# OS architecture by default
os_arch: str = config['os_arch']
# OS architecture by default
os_arch: str = config['os_arch']
# All necessary paths
tmp_path: str = config['tmp_path']
tmp_slpkg: str = config['tmp_slpkg']
build_path: str = config['build_path']
download_only: str = config['download_only']
lib_path: str = config['lib_path']
etc_path: str = config['etc_path']
db_path: str = config['db_path']
sbo_repo_path: str = config['sbo_repo_path']
log_packages: str = config['log_packages']
# All necessary paths
tmp_path: str = config['tmp_path']
tmp_slpkg: str = config['tmp_slpkg']
build_path: str = config['build_path']
download_only: str = config['download_only']
lib_path: str = config['lib_path']
etc_path: str = config['etc_path']
db_path: str = config['db_path']
sbo_repo_path: str = config['sbo_repo_path']
log_packages: str = config['log_packages']
# Database name
database: str = config['database']
# Database name
database: str = config['database']
# Repository details
repo_version: str = config['repo_version']
sbo_url: str = config['sbo_url']
sbo_txt: str = config['sbo_txt']
tar_suffix: str = config['tar_suffix']
pkg_suffix: str = config['pkg_suffix']
repo_tag: str = config['repo_tag']
# Repository details
repo_version: str = config['repo_version']
sbo_url: str = config['sbo_url']
sbo_txt: str = config['sbo_txt']
tar_suffix: str = config['tar_suffix']
pkg_suffix: str = config['pkg_suffix']
repo_tag: str = config['repo_tag']
# Slackware commands
installpkg: str = config['installpkg']
reinstall: str = config['reinstall']
removepkg: str = config['removepkg']
# Slackware commands
installpkg: str = config['installpkg']
reinstall: str = config['reinstall']
removepkg: str = config['removepkg']
# Other configs
colors: str = config['colors']
wget_options: str = config['wget_options']
# Other configs
colors: str = config['colors']
wget_options: str = config['wget_options']
except KeyError:
pass
@classmethod
def colour(cls):