index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton.feeds+github@gmail.com> | 2020-07-06 22:20:34 +0200 |
---|---|---|
committer | Anton Hvornum <anton.feeds+github@gmail.com> | 2020-07-06 22:20:34 +0200 |
commit | f7d3022cc84eb30c90f4906f68c744d8f24f2132 (patch) | |
tree | 91bb222d1f43503858a7583d38caedf1ed500ed9 /archinstall/lib/general.py | |
parent | db528d86761ac8d8e1fc13be04d5c1d2e137fd8d (diff) |
-rw-r--r-- | archinstall/lib/general.py | 19 |
diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py index 32814ddc..89c7f188 100644 --- a/archinstall/lib/general.py +++ b/archinstall/lib/general.py @@ -9,6 +9,20 @@ def log(*args, **kwargs): def gen_uid(entropy_length=256): return hashlib.sha512(os.urandom(entropy_length)).hexdigest() +def multisplit(s, splitters): + s = [s,] + for key in splitters: + ns = [] + for obj in s: + x = obj.split(key) + for index, part in enumerate(x): + if len(part): + ns.append(part) + if index < len(x)-1: + ns.append(key) + s = ns + return s + class sys_command():#Thread): """ Stolen from archinstall_gui @@ -20,7 +34,10 @@ class sys_command():#Thread): if kwargs['emulate']: log(f"Starting command '{cmd}' in emulation mode.") self.raw_cmd = cmd - self.cmd = shlex.split(cmd) + try: + self.cmd = shlex.split(cmd) + except Exception as e: + raise ValueError(f'Incorrect string to split: {cmd}\n{e}') self.args = args self.kwargs = kwargs if not 'worker' in self.kwargs: self.kwargs['worker'] = None |