Commit fed5d8c7 by tarokkk

laborgui: Refactor to user nxkey and rdp package

parent 9e248ce5
...@@ -4,13 +4,15 @@ import gtk ...@@ -4,13 +4,15 @@ import gtk
import webkit import webkit
import gobject import gobject
import base64 import base64
import subprocess
import os import os
import sys
import rdp
from multiprocessing import Process
### Settings ### ### Settings ###
KEY_DIR = "/tmp/" KEY_DIR = "/tmp/"
KEY_FILE = KEY_DIR+"/id_rsa" KEY_FILE = KEY_DIR+"/id_rsa"
class KeyGen: class KeyGen:
"""Attributes: """Attributes:
private_key private_key
...@@ -122,11 +124,6 @@ class Browser: ...@@ -122,11 +124,6 @@ class Browser:
self.webview.execute_script("resetKey()") self.webview.execute_script("resetKey()")
gtk.main_quit() gtk.main_quit()
def parse_remote_login(uri):
#rdp:cloud:qYSv3eQJYY:152.66.243.62:23037
scheme, user, password, host, port = uri.split(':',4)
def on_navigation_requested(self, view, frame, req, data=None): def on_navigation_requested(self, view, frame, req, data=None):
uri = req.get_uri() uri = req.get_uri()
#print "On nav: " + uri #print "On nav: " + uri
...@@ -162,6 +159,10 @@ class Browser: ...@@ -162,6 +159,10 @@ class Browser:
self.webview.execute_script("document.getElementById(\"mount_button\").hidden=false ;") self.webview.execute_script("document.getElementById(\"mount_button\").hidden=false ;")
self.webview.execute_script("document.getElementById(\"umount_button\").hidden=true ;") self.webview.execute_script("document.getElementById(\"umount_button\").hidden=true ;")
return True return True
elif scheme == "nx" or scheme == "rdp" or scheme == "shellterm":
connection = rdp.RDP(uri)
Process(target=connection.connect).start()
return True
else: else:
return False return False
def mount_sshfs_folder(self,neptun,host): def mount_sshfs_folder(self,neptun,host):
...@@ -176,7 +177,7 @@ class Browser: ...@@ -176,7 +177,7 @@ class Browser:
self.webview.open("https://login.bme.hu/admin/") self.webview.open("https://login.bme.hu/admin/")
def store(self, widget): def store(self, widget):
self.webview.open("https://cloud.ik.bme.hu/store/gui/") self.webview.open("https://cloud.ik.bme.hu/")
def load_committed_cb(self,web_view, frame): def load_committed_cb(self,web_view, frame):
self.webview.execute_script('document.getElementsByTagName("a")[0].target="";') self.webview.execute_script('document.getElementsByTagName("a")[0].target="";')
#uri = frame.get_uri() #uri = frame.get_uri()
...@@ -186,7 +187,7 @@ class Browser: ...@@ -186,7 +187,7 @@ class Browser:
def main(self): def main(self):
gtk.main() gtk.main()
if __name__ == "__main__": if __name__ == "__main__":
browser = Browser() browser = Browser()
browser.main() browser.main()
......
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