changeset 23:8f93457656b4

display the command that's executed in the log viewer
author Dirk Olmes <dirk@xanthippe.ping.de>
date Fri, 26 Sep 2014 04:18:23 +0200
parents 88b0f704e2ab
children 9d7245e45379
files RemoteViewer/Viewer.py
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/RemoteViewer/Viewer.py	Fri Sep 26 04:09:37 2014 +0200
+++ b/RemoteViewer/Viewer.py	Fri Sep 26 04:18:23 2014 +0200
@@ -22,20 +22,22 @@
         self.process = None
 
     def open(self, parent):
-        command = self.buildCommand()
-        self.process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
-        self.__startLogThread(self.process.stdout)
+        self.buildCommand()
+        self.process = subprocess.Popen(self.command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+        self.__startLogThread()
         self.process.wait()
 
-    def __startLogThread(self, output):
+    def __startLogThread(self):
         logViewer = self.__createLogViewer()
-        readThread = ReadThread(output,  logViewer)
+        readThread = ReadThread(self.process.stdout, logViewer)
         readThread.start()
         logViewer.exec_()
 
     def __createLogViewer(self):
         viewer = LogViewer()
         viewer.setWindowTitle(self.connection.displayString())
+        command = 'running ' + ' '.join(self.command) + '\n'
+        viewer.append(command)
         return viewer
 
 class VncViewer(AbstractViewer):
@@ -49,8 +51,6 @@
         self.append('/t:', self.connection.displayString())
         self.append('/u:', self.connection.user)
         self.append('/size:', self.connection.geometry)
-        print(self.command)
-        return self.command
 
     def append(self, option, value):
         if value is not None: