Fixed for KeyboardInterrupt

This commit is contained in:
Dimitris Zlatanidis 2023-03-15 11:34:30 +02:00
parent 668453bd60
commit 00dd96bbd3
3 changed files with 13 additions and 6 deletions

View file

@ -6,6 +6,7 @@ Updated:
Fixed: Fixed:
- Summary for upgrade packages - Summary for upgrade packages
- Downloader for KeyboardInterrupt - Downloader for KeyboardInterrupt
- Build and install for KeyboardInterrupt
BugFixed: BugFixed:
- Default build path /tmp/slpkg/build - Default build path /tmp/slpkg/build

View file

@ -22,6 +22,9 @@ class ProgressBar(Configs):
""" Creating progress bar. """ """ Creating progress bar. """
spinner = PixelSpinner(f'{self.endc}{message} {filename} {self.bviolet}') spinner = PixelSpinner(f'{self.endc}{message} {filename} {self.bviolet}')
# print('\033[F', end='', flush=True) # print('\033[F', end='', flush=True)
while True: try:
time.sleep(0.1) while True:
spinner.next() time.sleep(0.1)
spinner.next()
except KeyboardInterrupt:
raise SystemExit(1)

View file

@ -340,9 +340,12 @@ class Slackbuilds(Configs):
def process(self, command: str) -> None: def process(self, command: str) -> None:
""" Processes execution. """ """ Processes execution. """
self.output = subprocess.call(command, shell=True, stderr=self.stderr, stdout=self.stdout) try:
if self.output != 0: self.output = subprocess.call(command, shell=True, stderr=self.stderr, stdout=self.stdout)
raise SystemExit(self.output) if self.output != 0:
raise SystemExit(self.output)
except KeyboardInterrupt:
raise SystemExit(1)
def print_error(self) -> None: def print_error(self) -> None:
""" Stop the process and print the error message. """ """ Stop the process and print the error message. """