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()
# Hack to add colors to the command executing
if line.startswith(b"\xc2\xbb "):
if line.startswith(b"> "):
print(
Fore.YELLOW + "\xbb " + Fore.LIGHTCYAN_EX + line.decode()[2:],
Fore.YELLOW + "> " + Fore.LIGHTCYAN_EX + line.decode()[2:],
end="",
)
else:

View file

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

View file

@ -450,7 +450,7 @@ class GlobalCommon(object):
# Execute dangerzone-container
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(
args,
startupinfo=self.get_subprocess_startupinfo(),
@ -477,7 +477,7 @@ class GlobalCommon(object):
) as p:
stdout_data, _ = p.communicate()
lines = stdout_data.split(b"\n")
if b"\xbb " in lines[0]:
if b"> " in lines[0]:
stdout_data = b"\n".join(lines[1:])
# The user canceled, or permission denied

View file

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