Commit fed5d8c7 by tarokkk

laborgui: Refactor to user nxkey and rdp package

parent 9e248ce5
......@@ -4,13 +4,15 @@ import gtk
import webkit
import gobject
import base64
import subprocess
import os
import sys
import rdp
from multiprocessing import Process
### Settings ###
KEY_DIR = "/tmp/"
KEY_FILE = KEY_DIR+"/id_rsa"
class KeyGen:
"""Attributes:
private_key
......@@ -122,11 +124,6 @@ class Browser:
self.webview.execute_script("resetKey()")
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):
uri = req.get_uri()
#print "On nav: " + uri
......@@ -162,6 +159,10 @@ class Browser:
self.webview.execute_script("document.getElementById(\"mount_button\").hidden=false ;")
self.webview.execute_script("document.getElementById(\"umount_button\").hidden=true ;")
return True
elif scheme == "nx" or scheme == "rdp" or scheme == "shellterm":
connection = rdp.RDP(uri)
Process(target=connection.connect).start()
return True
else:
return False
def mount_sshfs_folder(self,neptun,host):
......@@ -176,7 +177,7 @@ class Browser:
self.webview.open("https://login.bme.hu/admin/")
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):
self.webview.execute_script('document.getElementsByTagName("a")[0].target="";')
#uri = frame.get_uri()
......
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