Change subprocess bullet character to ">" to remove all the headaches

This commit is contained in:
Micah Lee 2021-06-17 11:40:38 -07:00
parent 77ac8e7d54
commit 13adda0af5
4 changed files with 7 additions and 7 deletions

View file

@ -20,9 +20,9 @@ def exec_container(global_common, args):
output += line.decode() output += line.decode()
# Hack to add colors to the command executing # Hack to add colors to the command executing
if line.startswith(b"\xc2\xbb "): if line.startswith(b"> "):
print( print(
Fore.YELLOW + "\xbb " + Fore.LIGHTCYAN_EX + line.decode()[2:], Fore.YELLOW + "> " + Fore.LIGHTCYAN_EX + line.decode()[2:],
end="", end="",
) )
else: else:

View file

@ -25,7 +25,7 @@ def exec_container(args):
args = [container_runtime] + args args = [container_runtime] + args
args_str = " ".join(pipes.quote(s) for s in args) args_str = " ".join(pipes.quote(s) for s in args)
print("\xbb " + args_str) print("> " + args_str)
sys.stdout.flush() sys.stdout.flush()
with subprocess.Popen( with subprocess.Popen(

View file

@ -450,7 +450,7 @@ class GlobalCommon(object):
# Execute dangerzone-container # Execute dangerzone-container
args_str = " ".join(pipes.quote(s) for s in args) args_str = " ".join(pipes.quote(s) for s in args)
print(Fore.YELLOW + "\xbb " + Fore.CYAN + args_str) print(Fore.YELLOW + "> " + Fore.CYAN + args_str))
return subprocess.Popen( return subprocess.Popen(
args, args,
startupinfo=self.get_subprocess_startupinfo(), startupinfo=self.get_subprocess_startupinfo(),
@ -477,7 +477,7 @@ class GlobalCommon(object):
) as p: ) as p:
stdout_data, _ = p.communicate() stdout_data, _ = p.communicate()
lines = stdout_data.split(b"\n") lines = stdout_data.split(b"\n")
if b"\xbb " in lines[0]: if b"> " in lines[0]:
stdout_data = b"\n".join(lines[1:]) stdout_data = b"\n".join(lines[1:])
# The user canceled, or permission denied # The user canceled, or permission denied

View file

@ -19,9 +19,9 @@ class TaskBase(QtCore.QThread):
for line in p.stdout: for line in p.stdout:
output += line.decode() output += line.decode()
if line.startswith(b"\xc2\xbb "): if line.startswith(b"> "):
print( print(
Fore.YELLOW + "\xbb " + Fore.LIGHTCYAN_EX + line.decode()[2:], Fore.YELLOW + "> " + Fore.LIGHTCYAN_EX + line.decode()[2:],
end="", end="",
) )
else: else: