adjusted logging format, patched $DISPLAY error

This commit is contained in:
Matteo ℱan 2019-05-17 00:31:49 +02:00 committed by GitHub
parent b13d212f05
commit 750713d0cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 35 additions and 13 deletions

View file

@ -184,8 +184,11 @@ class ShellMessage(object):
# Do something with output.
toprint = self.read(0.1) # 0.1 s to let the shell output the result
# Redirect output.
from pykms_GuiBase import gui_redirect # Import after variables creation !
gui_redirect(toprint)
if sys.stdout.isatty():
print(toprint)
else:
from pykms_GuiBase import gui_redirect # Import after variables creation.
gui_redirect(toprint)
def spawn(self):
# Save everything that would otherwise go to stdout.