From db93d14966f02bb04322ceb1892f686025535ca0 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Mon, 8 May 2023 18:13:07 +0300 Subject: [PATCH] Updated for update repos --- slpkg/update_repository.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/slpkg/update_repository.py b/slpkg/update_repository.py index 961d601f..3a858716 100644 --- a/slpkg/update_repository.py +++ b/slpkg/update_repository.py @@ -31,7 +31,6 @@ class UpdateRepository(Configs): self.progress = ProgressBar() self.utils = Utilities() self.data = InstallData() - self.check_updates = CheckUpdates(flags, repository) self.repos_for_update: dict = {} @@ -625,10 +624,8 @@ class UpdateRepository(Configs): } with open(Path(path, sbo_txt), 'w') as sbo: - for p in path.glob('**/*'): if p.name.endswith('.info'): - sbo_path = Path('/'.join(str(p).split('/')[:-1])) name: str = str(p).split('/')[-2] @@ -710,9 +707,13 @@ class UpdateRepository(Configs): return info[begin:end] - def check(self, queue) -> None: + def check_for_updates(self, queue) -> None: compare: dict = self.check_updates.check_the_repositories() + self.print_the_messages(compare) + return queue.put(compare) + + def print_the_messages(self, compare: dict) -> None: print() for repo, comp in compare.items(): if comp: @@ -723,14 +724,12 @@ class UpdateRepository(Configs): print(f'\n{self.endc}{self.yellow}No changes in ChangeLog.txt between your ' f'last update and now.{self.endc}') - return queue.put(compare) - def repositories(self) -> None: queue = Queue() message = f'Checking for news, please wait...' # Starting multiprocessing - p1 = Process(target=self.check, args=(queue,)) + p1 = Process(target=self.check_for_updates, args=(queue,)) p2 = Process(target=self.progress.bar, args=(message, '')) p1.start()