diff --git a/slpkg/check_updates.py b/slpkg/check_updates.py index cb67b620..307bf06a 100644 --- a/slpkg/check_updates.py +++ b/slpkg/check_updates.py @@ -144,18 +144,18 @@ class CheckUpdates(Configs): message: str = 'Checking for news, please wait...' # Starting multiprocessing - p1 = Process(target=self.check_for_updates) - p2 = Process(target=self.progress.progress_bar, args=(message,)) + process_1 = Process(target=self.check_for_updates) + process_2 = Process(target=self.progress.progress_bar, args=(message,)) - p1.start() - p2.start() + process_1.start() + process_2.start() # Wait until process 1 finish - p1.join() + process_1.join() # Terminate process 2 if process 1 finished - if not p1.is_alive(): - p2.terminate() + if not process_1.is_alive(): + process_2.terminate() # Restore the terminal cursor print('\x1b[?25h', self.endc) diff --git a/slpkg/downloader.py b/slpkg/downloader.py index 7c246858..a5ceb2dc 100644 --- a/slpkg/downloader.py +++ b/slpkg/downloader.py @@ -36,16 +36,16 @@ class Downloader(Configs): def download(self) -> None: """ Starting the processing for downloading. """ - process: list = [] + processes: list = [] if self.parallel_downloads or self.option_for_parallel: for url in self.urls: - p1 = Process(target=self.tools, args=(url,)) - process.append(p1) - p1.start() + proc = Process(target=self.tools, args=(url,)) + processes.append(proc) + proc.start() - for proc in process: - proc.join() + for process in processes: + process.join() else: for url in self.urls: self.tools(url) diff --git a/slpkg/multi_process.py b/slpkg/multi_process.py index dfbaa05a..cd686e77 100644 --- a/slpkg/multi_process.py +++ b/slpkg/multi_process.py @@ -34,19 +34,19 @@ class MultiProcess(Configs): self.stdout = subprocess.DEVNULL # Starting multiprocessing - p1 = Process(target=self.utils.process, args=(command, self.stderr, self.stdout)) - p2 = Process(target=self.progress.progress_bar, args=(progress_message, filename)) + process_1 = Process(target=self.utils.process, args=(command, self.stderr, self.stdout)) + process_2 = Process(target=self.progress.progress_bar, args=(progress_message, filename)) - p1.start() - p2.start() + process_1.start() + process_2.start() # Wait until process 1 finish - p1.join() + process_1.join() # Terminate process 2 if process 1 finished - if not p1.is_alive(): - p2.terminate() - if p1.exitcode != 0: + if not process_1.is_alive(): + process_2.terminate() + if process_1.exitcode != 0: print(f"\r{'':>2}{self.bred}{self.ascii.bullet}{self.endc} {filename} {failed}{' ' * 17}", end='\r') else: print(f"\r{'':>2}{self.bgreen}{self.ascii.bullet}{self.endc} {filename} {done}{' ' * 17}", end='\r') diff --git a/slpkg/update_repository.py b/slpkg/update_repository.py index 6f900e66..605c9676 100644 --- a/slpkg/update_repository.py +++ b/slpkg/update_repository.py @@ -619,18 +619,18 @@ class UpdateRepository(Configs): message: str = 'Checking for news, please wait...' # Starting multiprocessing - p1 = Process(target=self.check_for_updates, args=(queue,)) - p2 = Process(target=self.progress.progress_bar, args=(message,)) + process_1 = Process(target=self.check_for_updates, args=(queue,)) + process_2 = Process(target=self.progress.progress_bar, args=(message,)) - p1.start() - p2.start() + process_1.start() + process_2.start() # Wait until process 1 finish - p1.join() + process_1.join() # Terminate process 2 if process 1 finished - if not p1.is_alive(): - p2.terminate() + if not process_1.is_alive(): + process_2.terminate() # Restore the terminal cursor print('\x1b[?25h', self.endc, end='')