Updated for update repos

This commit is contained in:
Dimitris Zlatanidis 2023-05-08 18:13:07 +03:00
parent 12ee3ad43c
commit db93d14966

View file

@ -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()