Commit 7a77678d by tarokkk

laborgui: Fixed error message

parent 2bd43c4c
...@@ -27,6 +27,7 @@ class RDP: ...@@ -27,6 +27,7 @@ class RDP:
# window.set_title("Message dialogs") # window.set_title("Message dialogs")
md = gtk.MessageDialog(parent=None, type=gtk.MESSAGE_INFO, buttons=gtk.BUTTONS_CLOSE, message_format=text) md = gtk.MessageDialog(parent=None, type=gtk.MESSAGE_INFO, buttons=gtk.BUTTONS_CLOSE, message_format=text)
md.run() md.run()
print "After run"
md.destroy() md.destroy()
def connect(self): def connect(self):
...@@ -45,6 +46,7 @@ class RDP: ...@@ -45,6 +46,7 @@ class RDP:
#p.terminate() #p.terminate()
if self.global_vars.pid > 0: if self.global_vars.pid > 0:
os.kill(self.global_vars.pid, signal.SIGKILL) os.kill(self.global_vars.pid, signal.SIGKILL)
#print "Join"
p.join() p.join()
elif self.scheme == "nx": elif self.scheme == "nx":
self.connect_nx() self.connect_nx()
...@@ -72,19 +74,11 @@ class RDP: ...@@ -72,19 +74,11 @@ class RDP:
def connect_rdp(self,global_vars): def connect_rdp(self,global_vars):
rdp_command = ["rdesktop", "-khu", "-E", "-P", "-0", "-f", "-u", self.username, "-p", self.password, self.host+":"+self.port] rdp_command = ["rdesktop", "-khu", "-E", "-P", "-0", "-f", "-u", self.username, "-p", self.password, self.host+":"+self.port]
try:
proc = subprocess.Popen(rdp_command, stdout = subprocess.PIPE) proc = subprocess.Popen(rdp_command, stdout = subprocess.PIPE)
global_vars.pid = proc.pid global_vars.pid = proc.pid
proc.wait() proc.wait()
except subprocess.CalledProcessError as e:
if e.returncode != 1:
print e
self.dialog_box("Unable to connect to host: "+self.host+" at port "+self.port)
finally:
#print "Finally: "
#print self.box
global_vars.pid = 0
self.box.response(-5) self.box.response(-5)
global_vars.pid = 0
def connect_nx(self): def connect_nx(self):
#Generate temproary config #Generate temproary config
......
from setuptools import setup, find_packages from setuptools import setup, find_packages
setup( setup(
name = "CloudGUI", name = "CloudGUI",
version = "0.1", version = "0.2",
packages = ['cloudgui',], packages = ['cloudgui',],
scripts = ['cloud','rdp',], scripts = ['cloud','rdp',],
) )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment