index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton@hvornum.se> | 2021-05-12 10:58:46 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-12 10:58:46 +0000 |
commit | df6c4e77f721da2b03a510548d281992b25987b2 (patch) | |
tree | fc5556c89356cf19140c236d64ba34a368565e63 /archinstall/lib/general.py | |
parent | 0ef8cc579eba15803f542947c56a15ab9807b09c (diff) | |
parent | af3d65cc98632042b3b0ef62cfc27553261ec3b0 (diff) |
-rw-r--r-- | archinstall/lib/general.py | 9 |
diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py index eb0c5d14..72f8677f 100644 --- a/archinstall/lib/general.py +++ b/archinstall/lib/general.py @@ -5,6 +5,7 @@ from subprocess import Popen, STDOUT, PIPE, check_output from select import epoll, EPOLLIN, EPOLLHUP from .exceptions import * from .output import log +from typing import Optional, Union def gen_uid(entropy_length=256): return hashlib.sha512(os.urandom(entropy_length)).hexdigest() @@ -160,16 +161,15 @@ class sys_command():#Thread): 'exit_code': self.exit_code } - def peak(self, output :str): + def peak(self, output : Union[str, bytes]) -> bool: if type(output) == bytes: try: output = output.decode('UTF-8') except UnicodeDecodeError: - return None - + return False output = output.strip('\r\n ') if len(output) <= 0: - return None + return False if self.peak_output: from .user_interaction import get_terminal_width @@ -191,6 +191,7 @@ class sys_command():#Thread): # And print the new output we're peaking on: sys.stdout.write(output) sys.stdout.flush() + return True def run(self): self.status = 'running' |