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:
- Summary for upgrade packages
- Downloader for KeyboardInterrupt
- Build and install for KeyboardInterrupt
BugFixed:
- Default build path /tmp/slpkg/build

View file

@ -22,6 +22,9 @@ class ProgressBar(Configs):
""" Creating progress bar. """
spinner = PixelSpinner(f'{self.endc}{message} {filename} {self.bviolet}')
# print('\033[F', end='', flush=True)
while True:
time.sleep(0.1)
spinner.next()
try:
while True:
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:
""" Processes execution. """
self.output = subprocess.call(command, shell=True, stderr=self.stderr, stdout=self.stdout)
if self.output != 0:
raise SystemExit(self.output)
try:
self.output = subprocess.call(command, shell=True, stderr=self.stderr, stdout=self.stdout)
if self.output != 0:
raise SystemExit(self.output)
except KeyboardInterrupt:
raise SystemExit(1)
def print_error(self) -> None:
""" Stop the process and print the error message. """