mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-17 06:11:35 +01:00
Updated for typing
This commit is contained in:
parent
85c1db70cd
commit
4b8e5fedff
2 changed files with 32 additions and 32 deletions
|
@ -56,7 +56,7 @@ class CheckUpdates(Configs):
|
||||||
if self.utils.is_option(self.flag_bin_repository, self.flags):
|
if self.utils.is_option(self.flag_bin_repository, self.flags):
|
||||||
|
|
||||||
for repo in bin_repositories.keys():
|
for repo in bin_repositories.keys():
|
||||||
if repo in self.repos.bin_enabled_repos and self.repo == repo:
|
if repo in self.repos.bin_enabled_repos and repo == self.repo:
|
||||||
bin_repositories[repo]()
|
bin_repositories[repo]()
|
||||||
break
|
break
|
||||||
|
|
||||||
|
@ -71,86 +71,86 @@ class CheckUpdates(Configs):
|
||||||
|
|
||||||
return self.compare
|
return self.compare
|
||||||
|
|
||||||
def alien_repository(self):
|
def alien_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.alien_repo_path, self.repos.alien_repo_changelog)
|
self.local_chg_txt: Path = Path(self.repos.alien_repo_path, self.repos.alien_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.alien_repo_changelog_mirror}{self.repos.alien_repo_changelog}'
|
self.repo_chg_txt: str = f'{self.repos.alien_repo_changelog_mirror}{self.repos.alien_repo_changelog}'
|
||||||
self.compare[self.repos.alien_repo_name] = self.compare_dates()
|
self.compare[self.repos.alien_repo_name] = self.compare_dates()
|
||||||
|
|
||||||
def multilib_repository(self):
|
def multilib_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.multilib_repo_path, self.repos.multilib_repo_changelog)
|
self.local_chg_txt: Path = Path(self.repos.multilib_repo_path, self.repos.multilib_repo_changelog)
|
||||||
self.repo_chg_txt: str = (f'{self.repos.multilib_repo_changelog_mirror}'
|
self.repo_chg_txt: str = (f'{self.repos.multilib_repo_changelog_mirror}'
|
||||||
f'{self.repos.multilib_repo_changelog}')
|
f'{self.repos.multilib_repo_changelog}')
|
||||||
self.compare[self.repos.multilib_repo_name] = self.compare_dates()
|
self.compare[self.repos.multilib_repo_name] = self.compare_dates()
|
||||||
|
|
||||||
def restricted_repository(self):
|
def restricted_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.restricted_repo_path, self.repos.restricted_repo_changelog)
|
self.local_chg_txt: Path = Path(self.repos.restricted_repo_path, self.repos.restricted_repo_changelog)
|
||||||
self.repo_chg_txt: str = (f'{self.repos.restricted_repo_changelog_mirror}'
|
self.repo_chg_txt: str = (f'{self.repos.restricted_repo_changelog_mirror}'
|
||||||
f'{self.repos.restricted_repo_changelog}')
|
f'{self.repos.restricted_repo_changelog}')
|
||||||
self.compare[self.repos.restricted_repo_name] = self.compare_dates()
|
self.compare[self.repos.restricted_repo_name] = self.compare_dates()
|
||||||
|
|
||||||
def gnome_repository(self):
|
def gnome_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.gnome_repo_path, self.repos.gnome_repo_changelog)
|
self.local_chg_txt: Path = Path(self.repos.gnome_repo_path, self.repos.gnome_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.gnome_repo_mirror}{self.repos.gnome_repo_changelog}'
|
self.repo_chg_txt: str = f'{self.repos.gnome_repo_mirror}{self.repos.gnome_repo_changelog}'
|
||||||
self.compare[self.repos.gnome_repo_name] = self.compare_dates()
|
self.compare[self.repos.gnome_repo_name] = self.compare_dates()
|
||||||
|
|
||||||
def msb_repository(self):
|
def msb_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.msb_repo_path, self.repos.msb_repo_changelog)
|
self.local_chg_txt: Path = Path(self.repos.msb_repo_path, self.repos.msb_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.msb_repo_changelog_mirror}{self.repos.msb_repo_changelog}'
|
self.repo_chg_txt: str = f'{self.repos.msb_repo_changelog_mirror}{self.repos.msb_repo_changelog}'
|
||||||
self.compare[self.repos.msb_repo_name] = self.compare_dates()
|
self.compare[self.repos.msb_repo_name] = self.compare_dates()
|
||||||
|
|
||||||
def csb_repository(self):
|
def csb_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.csb_repo_path, self.repos.csb_repo_changelog)
|
self.local_chg_txt: Path = Path(self.repos.csb_repo_path, self.repos.csb_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.csb_repo_changelog_mirror}{self.repos.csb_repo_changelog}'
|
self.repo_chg_txt: str = f'{self.repos.csb_repo_changelog_mirror}{self.repos.csb_repo_changelog}'
|
||||||
self.compare[self.repos.csb_repo_name] = self.compare_dates()
|
self.compare[self.repos.csb_repo_name] = self.compare_dates()
|
||||||
|
|
||||||
def conraid_repository(self):
|
def conraid_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.conraid_repo_path, self.repos.conraid_repo_changelog)
|
self.local_chg_txt: Path = Path(self.repos.conraid_repo_path, self.repos.conraid_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.conraid_repo_mirror}{self.repos.conraid_repo_changelog}'
|
self.repo_chg_txt: str = f'{self.repos.conraid_repo_mirror}{self.repos.conraid_repo_changelog}'
|
||||||
self.compare[self.repos.conraid_repo_name] = self.compare_dates()
|
self.compare[self.repos.conraid_repo_name] = self.compare_dates()
|
||||||
|
|
||||||
def slackonly_repository(self):
|
def slackonly_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.slackonly_repo_path, self.repos.slackonly_repo_changelog)
|
self.local_chg_txt: Path = Path(self.repos.slackonly_repo_path, self.repos.slackonly_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.slackonly_repo_mirror}{self.repos.slackonly_repo_changelog}'
|
self.repo_chg_txt: str = f'{self.repos.slackonly_repo_mirror}{self.repos.slackonly_repo_changelog}'
|
||||||
self.compare[self.repos.slackonly_repo_name] = self.compare_dates()
|
self.compare[self.repos.slackonly_repo_name] = self.compare_dates()
|
||||||
|
|
||||||
def ponce_bin_repository(self):
|
def ponce_bin_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.ponce_bin_repo_path, self.repos.ponce_bin_repo_changelog)
|
self.local_chg_txt: Path = Path(self.repos.ponce_bin_repo_path, self.repos.ponce_bin_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.ponce_bin_repo_mirror}{self.repos.ponce_bin_repo_changelog}'
|
self.repo_chg_txt: str = f'{self.repos.ponce_bin_repo_mirror}{self.repos.ponce_bin_repo_changelog}'
|
||||||
self.compare[self.repos.ponce_bin_repo_name] = self.compare_dates()
|
self.compare[self.repos.ponce_bin_repo_name] = self.compare_dates()
|
||||||
|
|
||||||
def salixos_repository(self):
|
def salixos_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.salixos_repo_path, self.repos.salixos_repo_changelog)
|
self.local_chg_txt: Path = Path(self.repos.salixos_repo_path, self.repos.salixos_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.salixos_repo_mirror}{self.repos.salixos_repo_changelog}'
|
self.repo_chg_txt: str = f'{self.repos.salixos_repo_mirror}{self.repos.salixos_repo_changelog}'
|
||||||
self.compare[self.repos.salixos_repo_name] = self.compare_dates()
|
self.compare[self.repos.salixos_repo_name] = self.compare_dates()
|
||||||
|
|
||||||
def salixos_extra_repository(self):
|
def salixos_extra_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.salixos_extra_repo_path,
|
self.local_chg_txt: Path = Path(self.repos.salixos_extra_repo_path,
|
||||||
self.repos.salixos_extra_repo_changelog)
|
self.repos.salixos_extra_repo_changelog)
|
||||||
self.repo_chg_txt: str = (f'{self.repos.salixos_extra_repo_mirror}'
|
self.repo_chg_txt: str = (f'{self.repos.salixos_extra_repo_mirror}'
|
||||||
f'{self.repos.salixos_extra_repo_changelog}')
|
f'{self.repos.salixos_extra_repo_changelog}')
|
||||||
self.compare[self.repos.salixos_extra_repo_name] = self.compare_dates()
|
self.compare[self.repos.salixos_extra_repo_name] = self.compare_dates()
|
||||||
|
|
||||||
def slackel_repository(self):
|
def slackel_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.slackel_repo_path, self.repos.slackel_repo_changelog)
|
self.local_chg_txt: Path = Path(self.repos.slackel_repo_path, self.repos.slackel_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.slackel_repo_mirror}{self.repos.slackel_repo_changelog}'
|
self.repo_chg_txt: str = f'{self.repos.slackel_repo_mirror}{self.repos.slackel_repo_changelog}'
|
||||||
self.compare[self.repos.slackel_repo_name] = self.compare_dates()
|
self.compare[self.repos.slackel_repo_name] = self.compare_dates()
|
||||||
|
|
||||||
def slint_repository(self):
|
def slint_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.slint_repo_path, self.repos.slint_repo_changelog)
|
self.local_chg_txt: Path = Path(self.repos.slint_repo_path, self.repos.slint_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.slint_repo_mirror}{self.repos.slint_repo_changelog}'
|
self.repo_chg_txt: str = f'{self.repos.slint_repo_mirror}{self.repos.slint_repo_changelog}'
|
||||||
self.compare[self.repos.slint_repo_name] = self.compare_dates()
|
self.compare[self.repos.slint_repo_name] = self.compare_dates()
|
||||||
|
|
||||||
def sbo_repository(self):
|
def sbo_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.sbo_repo_path, self.repos.sbo_repo_changelog)
|
self.local_chg_txt: Path = Path(self.repos.sbo_repo_path, self.repos.sbo_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.sbo_repo_mirror}{self.repos.sbo_repo_changelog}'
|
self.repo_chg_txt: str = f'{self.repos.sbo_repo_mirror}{self.repos.sbo_repo_changelog}'
|
||||||
self.compare[self.repos.sbo_repo_name] = self.compare_dates()
|
self.compare[self.repos.sbo_repo_name] = self.compare_dates()
|
||||||
|
|
||||||
def ponce_repository(self):
|
def ponce_repository(self) -> None:
|
||||||
self.local_chg_txt: Path = Path(self.repos.ponce_repo_path, self.repos.ponce_repo_changelog)
|
self.local_chg_txt: Path = Path(self.repos.ponce_repo_path, self.repos.ponce_repo_changelog)
|
||||||
self.repo_chg_txt: str = f'{self.repos.ponce_repo_mirror}{self.repos.ponce_repo_changelog}'
|
self.repo_chg_txt: str = f'{self.repos.ponce_repo_mirror}{self.repos.ponce_repo_changelog}'
|
||||||
self.compare[self.repos.ponce_repo_name] = self.compare_dates()
|
self.compare[self.repos.ponce_repo_name] = self.compare_dates()
|
||||||
|
|
||||||
def compare_dates(self):
|
def compare_dates(self) -> bool:
|
||||||
local_date: int = 0
|
local_date: int = 0
|
||||||
try:
|
try:
|
||||||
http = urllib3.PoolManager()
|
http = urllib3.PoolManager()
|
||||||
|
|
|
@ -108,7 +108,7 @@ class UpdateRepository(Configs):
|
||||||
else:
|
else:
|
||||||
self.not_enabled_message(self.repos.alien_repo_name)
|
self.not_enabled_message(self.repos.alien_repo_name)
|
||||||
|
|
||||||
def multilib_repository(self):
|
def multilib_repository(self) -> None:
|
||||||
if self.repos.multilib_repo:
|
if self.repos.multilib_repo:
|
||||||
urls: list = []
|
urls: list = []
|
||||||
print('Updating the packages list...\n')
|
print('Updating the packages list...\n')
|
||||||
|
@ -135,7 +135,7 @@ class UpdateRepository(Configs):
|
||||||
else:
|
else:
|
||||||
self.not_enabled_message(self.repos.multilib_repo_name)
|
self.not_enabled_message(self.repos.multilib_repo_name)
|
||||||
|
|
||||||
def restricted_repository(self):
|
def restricted_repository(self) -> None:
|
||||||
if self.repos.restricted_repo:
|
if self.repos.restricted_repo:
|
||||||
urls: list = []
|
urls: list = []
|
||||||
print('Updating the packages list...\n')
|
print('Updating the packages list...\n')
|
||||||
|
@ -162,7 +162,7 @@ class UpdateRepository(Configs):
|
||||||
else:
|
else:
|
||||||
self.not_enabled_message(self.repos.restricted_repo_name)
|
self.not_enabled_message(self.repos.restricted_repo_name)
|
||||||
|
|
||||||
def gnome_repository(self):
|
def gnome_repository(self) -> None:
|
||||||
if self.repos.gnome_repo:
|
if self.repos.gnome_repo:
|
||||||
urls: list = []
|
urls: list = []
|
||||||
print('Updating the packages list...\n')
|
print('Updating the packages list...\n')
|
||||||
|
@ -188,7 +188,7 @@ class UpdateRepository(Configs):
|
||||||
else:
|
else:
|
||||||
self.not_enabled_message(self.repos.gnome_repo_name)
|
self.not_enabled_message(self.repos.gnome_repo_name)
|
||||||
|
|
||||||
def msb_repository(self):
|
def msb_repository(self) -> None:
|
||||||
if self.repos.msb_repo:
|
if self.repos.msb_repo:
|
||||||
urls: list = []
|
urls: list = []
|
||||||
print('Updating the packages list...\n')
|
print('Updating the packages list...\n')
|
||||||
|
@ -218,7 +218,7 @@ class UpdateRepository(Configs):
|
||||||
else:
|
else:
|
||||||
self.not_enabled_message(self.repos.msb_repo_name)
|
self.not_enabled_message(self.repos.msb_repo_name)
|
||||||
|
|
||||||
def csb_repository(self):
|
def csb_repository(self) -> None:
|
||||||
if self.repos.csb_repo:
|
if self.repos.csb_repo:
|
||||||
urls: list = []
|
urls: list = []
|
||||||
print('Updating the packages list...\n')
|
print('Updating the packages list...\n')
|
||||||
|
@ -248,7 +248,7 @@ class UpdateRepository(Configs):
|
||||||
else:
|
else:
|
||||||
self.not_enabled_message(self.repos.csb_repo_name)
|
self.not_enabled_message(self.repos.csb_repo_name)
|
||||||
|
|
||||||
def conraid_repository(self):
|
def conraid_repository(self) -> None:
|
||||||
if self.repos.conraid_repo:
|
if self.repos.conraid_repo:
|
||||||
urls: list = []
|
urls: list = []
|
||||||
print('Updating the packages list...\n')
|
print('Updating the packages list...\n')
|
||||||
|
@ -275,7 +275,7 @@ class UpdateRepository(Configs):
|
||||||
else:
|
else:
|
||||||
self.not_enabled_message(self.repos.conraid_repo_name)
|
self.not_enabled_message(self.repos.conraid_repo_name)
|
||||||
|
|
||||||
def slackonly_repository(self):
|
def slackonly_repository(self) -> None:
|
||||||
if self.repos.slackonly_repo:
|
if self.repos.slackonly_repo:
|
||||||
urls: list = []
|
urls: list = []
|
||||||
print('Updating the packages list...\n')
|
print('Updating the packages list...\n')
|
||||||
|
@ -302,7 +302,7 @@ class UpdateRepository(Configs):
|
||||||
else:
|
else:
|
||||||
self.not_enabled_message(self.repos.slackonly_repo_name)
|
self.not_enabled_message(self.repos.slackonly_repo_name)
|
||||||
|
|
||||||
def ponce_bin_repository(self):
|
def ponce_bin_repository(self) -> None:
|
||||||
if self.repos.ponce_bin_repo:
|
if self.repos.ponce_bin_repo:
|
||||||
urls: list = []
|
urls: list = []
|
||||||
print('Updating the packages list...\n')
|
print('Updating the packages list...\n')
|
||||||
|
@ -329,7 +329,7 @@ class UpdateRepository(Configs):
|
||||||
else:
|
else:
|
||||||
self.not_enabled_message(self.repos.ponce_bin_repo_name)
|
self.not_enabled_message(self.repos.ponce_bin_repo_name)
|
||||||
|
|
||||||
def salixos_repository(self):
|
def salixos_repository(self) -> None:
|
||||||
if self.repos.salixos_repo:
|
if self.repos.salixos_repo:
|
||||||
urls: list = []
|
urls: list = []
|
||||||
print('Updating the packages list...\n')
|
print('Updating the packages list...\n')
|
||||||
|
@ -356,7 +356,7 @@ class UpdateRepository(Configs):
|
||||||
else:
|
else:
|
||||||
self.not_enabled_message(self.repos.salixos_repo_name)
|
self.not_enabled_message(self.repos.salixos_repo_name)
|
||||||
|
|
||||||
def salixos_extra_repository(self):
|
def salixos_extra_repository(self) -> None:
|
||||||
if self.repos.salixos_extra_repo:
|
if self.repos.salixos_extra_repo:
|
||||||
urls: list = []
|
urls: list = []
|
||||||
print('Updating the packages list...\n')
|
print('Updating the packages list...\n')
|
||||||
|
@ -386,7 +386,7 @@ class UpdateRepository(Configs):
|
||||||
else:
|
else:
|
||||||
self.not_enabled_message(self.repos.salixos_extra_repo_name)
|
self.not_enabled_message(self.repos.salixos_extra_repo_name)
|
||||||
|
|
||||||
def slackel_repository(self):
|
def slackel_repository(self) -> None:
|
||||||
if self.repos.slackel_repo:
|
if self.repos.slackel_repo:
|
||||||
urls: list = []
|
urls: list = []
|
||||||
print('Updating the packages list...\n')
|
print('Updating the packages list...\n')
|
||||||
|
@ -413,7 +413,7 @@ class UpdateRepository(Configs):
|
||||||
else:
|
else:
|
||||||
self.not_enabled_message(self.repos.slackel_repo_name)
|
self.not_enabled_message(self.repos.slackel_repo_name)
|
||||||
|
|
||||||
def slint_repository(self):
|
def slint_repository(self) -> None:
|
||||||
if self.repos.slint_repo:
|
if self.repos.slint_repo:
|
||||||
urls: list = []
|
urls: list = []
|
||||||
print('Updating the packages list...\n')
|
print('Updating the packages list...\n')
|
||||||
|
@ -440,7 +440,7 @@ class UpdateRepository(Configs):
|
||||||
else:
|
else:
|
||||||
self.not_enabled_message(self.repos.slint_repo_name)
|
self.not_enabled_message(self.repos.slint_repo_name)
|
||||||
|
|
||||||
def slackbuild_repositories(self):
|
def slackbuild_repositories(self) -> None:
|
||||||
""" Update the slackbuild repositories. """
|
""" Update the slackbuild repositories. """
|
||||||
if self.repos.ponce_repo:
|
if self.repos.ponce_repo:
|
||||||
self.make_dirs(self.repos.gnome_repo_name)
|
self.make_dirs(self.repos.gnome_repo_name)
|
||||||
|
@ -486,7 +486,7 @@ class UpdateRepository(Configs):
|
||||||
print(f"{self.prog_name}: {self.bred}Error{self.endc}: "
|
print(f"{self.prog_name}: {self.bred}Error{self.endc}: "
|
||||||
f"The repository '{self.green}{repo}{self.endc}' is not enabled.")
|
f"The repository '{self.green}{repo}{self.endc}' is not enabled.")
|
||||||
|
|
||||||
def make_dirs(self, repo):
|
def make_dirs(self, repo) -> None:
|
||||||
""" Creating the repositories folders. """
|
""" Creating the repositories folders. """
|
||||||
path = Path(self.lib_path, 'repositories', repo)
|
path = Path(self.lib_path, 'repositories', repo)
|
||||||
if not os.path.isdir(path):
|
if not os.path.isdir(path):
|
||||||
|
@ -555,7 +555,7 @@ class UpdateRepository(Configs):
|
||||||
self.session.query(LastRepoUpdated).where(LastRepoUpdated.repo == repo).delete()
|
self.session.query(LastRepoUpdated).where(LastRepoUpdated.repo == repo).delete()
|
||||||
self.session.commit()
|
self.session.commit()
|
||||||
|
|
||||||
def drop_the_tables(self):
|
def drop_the_tables(self) -> None:
|
||||||
""" Drop all the tables from the database. """
|
""" Drop all the tables from the database. """
|
||||||
print(f'\n{self.prog_name}: {self.bred}WARNING{self.endc}: All the data from the database will be deleted!')
|
print(f'\n{self.prog_name}: {self.bred}WARNING{self.endc}: All the data from the database will be deleted!')
|
||||||
self.view.question()
|
self.view.question()
|
||||||
|
|
Loading…
Reference in a new issue