mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-30 20:34:38 +01:00
Fixed for KeyError
This commit is contained in:
parent
5dfe1ef6f7
commit
5d76680e0e
1 changed files with 23 additions and 22 deletions
|
@ -50,33 +50,34 @@ class Repositories(Configs):
|
|||
def configs(self) -> None:
|
||||
""" The repositories.toml configurations file. """
|
||||
|
||||
if self.repositories_file_toml.is_file():
|
||||
try:
|
||||
try:
|
||||
if self.repositories_file_toml.is_file():
|
||||
with open(self.repositories_file_toml, 'rb') as repo:
|
||||
self.repos: dict = tomli.load(repo)['REPOSITORIES']
|
||||
except (tomli.TOMLDecodeError, KeyError) as error:
|
||||
raise SystemExit(f"\n{self.prog_name} {self.bred}Error{self.endc}: {error}: in the configuration file "
|
||||
f"'{self.repositories_file_toml}'.\n"
|
||||
f"\nIf you have upgraded the '{self.prog_name}' probably you need to run:\n"
|
||||
f"'mv {self.repositories_file_toml}.new {self.repositories_file_toml}'.\n"
|
||||
f"or '{self.cyan}slpkg_new-configs{self.endc}' command.\n")
|
||||
|
||||
self.sbo_repo_url: str = self.repos['SBO_REPO_URL']
|
||||
self.sbo_repo_txt: str = self.repos['SBO_REPO_TXT']
|
||||
self.sbo_repo_chglog_txt: str = self.repos['SBO_REPO_CHGLOG_TXT']
|
||||
self.sbo_repo_tar_suffix: str = self.repos['SBO_REPO_TAR_SUFFIX']
|
||||
self.sbo_repo_tag: str = self.repos['SBO_REPO_TAG']
|
||||
self.sbo_repo_url: str = self.repos['SBO_REPO_URL']
|
||||
self.sbo_repo_txt: str = self.repos['SBO_REPO_TXT']
|
||||
self.sbo_repo_chglog_txt: str = self.repos['SBO_REPO_CHGLOG_TXT']
|
||||
self.sbo_repo_tar_suffix: str = self.repos['SBO_REPO_TAR_SUFFIX']
|
||||
self.sbo_repo_tag: str = self.repos['SBO_REPO_TAG']
|
||||
|
||||
self.ponce_repo: bool = self.repos['PONCE_REPO']
|
||||
self.ponce_repo_url: str = self.repos['PONCE_REPO_URL']
|
||||
self.ponce_repo_txt: str = self.repos['PONCE_REPO_TXT']
|
||||
self.ponce_repo_chglog_txt: str = self.repos['PONCE_REPO_CHGLOG_TXT']
|
||||
self.ponce_repo_tag: str = self.repos['PONCE_REPO_TAG']
|
||||
self.ponce_repo: bool = self.repos['PONCE_REPO']
|
||||
self.ponce_repo_url: str = self.repos['PONCE_REPO_URL']
|
||||
self.ponce_repo_txt: str = self.repos['PONCE_REPO_TXT']
|
||||
self.ponce_repo_chglog_txt: str = self.repos['PONCE_REPO_CHGLOG_TXT']
|
||||
self.ponce_repo_tag: str = self.repos['PONCE_REPO_TAG']
|
||||
|
||||
self.gnome_repo: bool = self.repos['GNOME_REPO']
|
||||
self.gnome_repo_url: str = self.repos['GNOME_REPO_URL']
|
||||
self.gnome_repo_pkg_txt: str = self.repos['GNOME_REPO_PKG_TXT']
|
||||
self.gnome_repo_chglog_pkg_txt: str = self.repos['GNOME_REPO_CHGLOG_TXT']
|
||||
self.gnome_repo: bool = self.repos['GNOME_REPO']
|
||||
self.gnome_repo_url: str = self.repos['GNOME_REPO_URL']
|
||||
self.gnome_repo_pkg_txt: str = self.repos['GNOME_REPO_PKG_TXT']
|
||||
self.gnome_repo_chglog_pkg_txt: str = self.repos['GNOME_REPO_CHGLOG_TXT']
|
||||
|
||||
except (tomli.TOMLDecodeError, KeyError) as error:
|
||||
raise SystemExit(f"\n{self.prog_name} {self.bred}Error{self.endc}: {error}: in the configuration file "
|
||||
f"'{self.repositories_file_toml}'.\n"
|
||||
f"\nIf you have upgraded the '{self.prog_name}' probably you need to run:\n"
|
||||
f"'mv {self.repositories_file_toml}.new {self.repositories_file_toml}'.\n"
|
||||
f"or '{self.cyan}slpkg_new-configs{self.endc}' command.\n")
|
||||
|
||||
if self.ponce_repo:
|
||||
self.repo_tag: str = self.ponce_repo_tag
|
||||
|
|
Loading…
Add table
Reference in a new issue