mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-02-06 08:46:21 +01:00
Updated for naming
This commit is contained in:
parent
b8f544b44f
commit
28ba2e534e
4 changed files with 28 additions and 28 deletions
|
@ -144,18 +144,18 @@ class CheckUpdates(Configs):
|
||||||
message: str = 'Checking for news, please wait...'
|
message: str = 'Checking for news, please wait...'
|
||||||
|
|
||||||
# Starting multiprocessing
|
# Starting multiprocessing
|
||||||
p1 = Process(target=self.check_for_updates)
|
process_1 = Process(target=self.check_for_updates)
|
||||||
p2 = Process(target=self.progress.progress_bar, args=(message,))
|
process_2 = Process(target=self.progress.progress_bar, args=(message,))
|
||||||
|
|
||||||
p1.start()
|
process_1.start()
|
||||||
p2.start()
|
process_2.start()
|
||||||
|
|
||||||
# Wait until process 1 finish
|
# Wait until process 1 finish
|
||||||
p1.join()
|
process_1.join()
|
||||||
|
|
||||||
# Terminate process 2 if process 1 finished
|
# Terminate process 2 if process 1 finished
|
||||||
if not p1.is_alive():
|
if not process_1.is_alive():
|
||||||
p2.terminate()
|
process_2.terminate()
|
||||||
|
|
||||||
# Restore the terminal cursor
|
# Restore the terminal cursor
|
||||||
print('\x1b[?25h', self.endc)
|
print('\x1b[?25h', self.endc)
|
||||||
|
|
|
@ -36,16 +36,16 @@ class Downloader(Configs):
|
||||||
|
|
||||||
def download(self) -> None:
|
def download(self) -> None:
|
||||||
""" Starting the processing for downloading. """
|
""" Starting the processing for downloading. """
|
||||||
process: list = []
|
processes: list = []
|
||||||
|
|
||||||
if self.parallel_downloads or self.option_for_parallel:
|
if self.parallel_downloads or self.option_for_parallel:
|
||||||
for url in self.urls:
|
for url in self.urls:
|
||||||
p1 = Process(target=self.tools, args=(url,))
|
proc = Process(target=self.tools, args=(url,))
|
||||||
process.append(p1)
|
processes.append(proc)
|
||||||
p1.start()
|
proc.start()
|
||||||
|
|
||||||
for proc in process:
|
for process in processes:
|
||||||
proc.join()
|
process.join()
|
||||||
else:
|
else:
|
||||||
for url in self.urls:
|
for url in self.urls:
|
||||||
self.tools(url)
|
self.tools(url)
|
||||||
|
|
|
@ -34,19 +34,19 @@ class MultiProcess(Configs):
|
||||||
self.stdout = subprocess.DEVNULL
|
self.stdout = subprocess.DEVNULL
|
||||||
|
|
||||||
# Starting multiprocessing
|
# Starting multiprocessing
|
||||||
p1 = Process(target=self.utils.process, args=(command, self.stderr, self.stdout))
|
process_1 = Process(target=self.utils.process, args=(command, self.stderr, self.stdout))
|
||||||
p2 = Process(target=self.progress.progress_bar, args=(progress_message, filename))
|
process_2 = Process(target=self.progress.progress_bar, args=(progress_message, filename))
|
||||||
|
|
||||||
p1.start()
|
process_1.start()
|
||||||
p2.start()
|
process_2.start()
|
||||||
|
|
||||||
# Wait until process 1 finish
|
# Wait until process 1 finish
|
||||||
p1.join()
|
process_1.join()
|
||||||
|
|
||||||
# Terminate process 2 if process 1 finished
|
# Terminate process 2 if process 1 finished
|
||||||
if not p1.is_alive():
|
if not process_1.is_alive():
|
||||||
p2.terminate()
|
process_2.terminate()
|
||||||
if p1.exitcode != 0:
|
if process_1.exitcode != 0:
|
||||||
print(f"\r{'':>2}{self.bred}{self.ascii.bullet}{self.endc} {filename} {failed}{' ' * 17}", end='\r')
|
print(f"\r{'':>2}{self.bred}{self.ascii.bullet}{self.endc} {filename} {failed}{' ' * 17}", end='\r')
|
||||||
else:
|
else:
|
||||||
print(f"\r{'':>2}{self.bgreen}{self.ascii.bullet}{self.endc} {filename} {done}{' ' * 17}", end='\r')
|
print(f"\r{'':>2}{self.bgreen}{self.ascii.bullet}{self.endc} {filename} {done}{' ' * 17}", end='\r')
|
||||||
|
|
|
@ -619,18 +619,18 @@ class UpdateRepository(Configs):
|
||||||
message: str = 'Checking for news, please wait...'
|
message: str = 'Checking for news, please wait...'
|
||||||
|
|
||||||
# Starting multiprocessing
|
# Starting multiprocessing
|
||||||
p1 = Process(target=self.check_for_updates, args=(queue,))
|
process_1 = Process(target=self.check_for_updates, args=(queue,))
|
||||||
p2 = Process(target=self.progress.progress_bar, args=(message,))
|
process_2 = Process(target=self.progress.progress_bar, args=(message,))
|
||||||
|
|
||||||
p1.start()
|
process_1.start()
|
||||||
p2.start()
|
process_2.start()
|
||||||
|
|
||||||
# Wait until process 1 finish
|
# Wait until process 1 finish
|
||||||
p1.join()
|
process_1.join()
|
||||||
|
|
||||||
# Terminate process 2 if process 1 finished
|
# Terminate process 2 if process 1 finished
|
||||||
if not p1.is_alive():
|
if not process_1.is_alive():
|
||||||
p2.terminate()
|
process_2.terminate()
|
||||||
|
|
||||||
# Restore the terminal cursor
|
# Restore the terminal cursor
|
||||||
print('\x1b[?25h', self.endc, end='')
|
print('\x1b[?25h', self.endc, end='')
|
||||||
|
|
Loading…
Add table
Reference in a new issue