예제 #1
0
    def __init__(self,
                 proxynode='login.plx.cineca.it',
                 user_account='',
                 remoteuser='',
                 password='',
                 pack_info=None):
        self.debug = True
        self.commandnode = ''
        self.protocol = rcm_protocol_client.get_protocol()

        def mycall(command):
            return self.prex(command)

        self.protocol.mycall = mycall

        if (not pack_info):
            self.pack_info = rcm_utils.pack_info()
        else:
            self.pack_info = pack_info
        self.basedir = self.pack_info.basedir
        self.config = dict()
        self.config['ssh'] = dict()
        self.config['vnc'] = dict()
        self.config['ssh']['win32'] = ("PLINK.EXE", " -ssh", "echo yes | ")
        self.config['vnc']['win32'] = ("vncviewer.exe", "")
        self.config['ssh']['linux2'] = ("ssh", "", "")
        self.config['vnc']['linux2'] = ("vncviewer", "")
        self.config['ssh']['darwin'] = ("ssh", "", "")
        self.config['vnc']['darwin'] = (
            "vncviewer_java/Contents/MacOS/JavaApplicationStub", "")

        self.config[
            'remote_rcm_server'] = "module load rcm; python $RCM_HOME/bin/server/rcm_new_server.py"
        #self.config['remote_rcm_server']="module load python; /om/home/cibo19/RCM_Dev/bin/server/rcm_server.py"
        #finding out the basedir, it depends if we are running as executable pyinstaler or as script
        self.sshexe = os.path.join(self.basedir, "external", sys.platform,
                                   platform.architecture()[0], "bin",
                                   self.config['ssh'][sys.platform][0])
        self.activeConnectionsList = []
        if os.path.exists(self.sshexe):
            self.ssh_command = self.config['ssh'][sys.platform][
                2] + self.sshexe + self.config['ssh'][sys.platform][1]
        else:
            self.ssh_command = "ssh"
        if (self.debug):
            module_logger.debug("ssh command1: " + self.ssh_command)

        vncexe = os.path.join(self.basedir, "external", sys.platform,
                              platform.architecture()[0], "bin",
                              self.config['vnc'][sys.platform][0])
        if os.path.exists(vncexe):
            self.vncexe = vncexe
        else:
            if (self.debug):
                module_logger.debug("VNC exec -->" + vncexe +
                                    "<-- NOT FOUND !!!")
                name = raw_input("VNC exec -->" + vncexe + "<-- NOT FOUND !!!")
            sys.exit()
        self.session_thread = []
예제 #2
0
 def __init__(self, parent, guiaction=None, pack_info=None):
    self.guiaction = guiaction
    if(not pack_info):
        self.pack_info=rcm_utils.pack_info()
    else:
        self.pack_info=pack_info 
    self.parent = parent
    self.top = Toplevel(self.parent)
    geometry = '+' + str(self.parent.winfo_x()) + '+' + str(self.parent.winfo_y())
    self.top.geometry(geometry)
    self.my_rcm_client = rcm_client.rcm_client_connection(pack_info = self.pack_info)
    parent.connections.append(self.my_rcm_client)
    self.topFrame= Frame(self.top)
    self.topFrame.pack(fill=BOTH,expand=1)
    self.frameLogin = Login(guiaction=self.ok, action=self.my_rcm_client.login_setup, master=self.topFrame)
    self.top.grab_set()
예제 #3
0
    def __init__(self,proxynode='login.plx.cineca.it', user_account='', remoteuser='',password='', pack_info=None):
        self.debug=True
        self.commandnode=''
        self.protocol=rcm_protocol_client.get_protocol()
        def mycall(command):
            return self.prex(command)
        self.protocol.mycall=mycall

        if(not pack_info):
            self.pack_info=rcm_utils.pack_info()
        else:
            self.pack_info=pack_info 
        self.basedir = self.pack_info.basedir
        self.config=dict()
        self.config['ssh']=dict()
        self.config['vnc']=dict()
        self.config['ssh']['win32']=("PLINK.EXE"," -ssh","echo yes | ")
        self.config['vnc']['win32']=("vncviewer.exe","")
        self.config['ssh']['linux2']=("ssh","","")
        self.config['vnc']['linux2']=("vncviewer","")
        self.config['ssh']['darwin']=("ssh","","")
        self.config['vnc']['darwin']=("vncviewer_java/Contents/MacOS/JavaApplicationStub","")

        self.config['remote_rcm_server']="module load rcm; python $RCM_HOME/bin/server/rcm_new_server.py"
        #self.config['remote_rcm_server']="module load python; /om/home/cibo19/RCM_Dev/bin/server/rcm_server.py"
        #finding out the basedir, it depends if we are running as executable pyinstaler or as script
        self.sshexe = os.path.join(self.basedir,"external",sys.platform,platform.architecture()[0],"bin",self.config['ssh'][sys.platform][0])
        self.activeConnectionsList = []
        if os.path.exists(self.sshexe) :
            self.ssh_command = self.config['ssh'][sys.platform][2] + self.sshexe + self.config['ssh'][sys.platform][1]
        else:
            self.ssh_command = "ssh"
        if(self.debug):
             module_logger.debug( "ssh command1: "+ self.ssh_command)
        
        vncexe = os.path.join(self.basedir,"external",sys.platform,platform.architecture()[0],"bin",self.config['vnc'][sys.platform][0])
        if os.path.exists(vncexe):
            self.vncexe=vncexe
        else:
            if(self.debug): 
                module_logger.debug( "VNC exec -->"+vncexe+"<-- NOT FOUND !!!")
                name=raw_input("VNC exec -->"+vncexe+"<-- NOT FOUND !!!")
            sys.exit()
        self.session_thread=[]
예제 #4
0
 def __init__(self, parent, guiaction=None, pack_info=None):
     self.guiaction = guiaction
     if (not pack_info):
         self.pack_info = rcm_utils.pack_info()
     else:
         self.pack_info = pack_info
     self.parent = parent
     self.top = Toplevel(self.parent)
     geometry = '+' + str(self.parent.winfo_x()) + '+' + str(
         self.parent.winfo_y())
     self.top.geometry(geometry)
     self.my_rcm_client = rcm_client.rcm_client_connection(
         pack_info=self.pack_info)
     parent.connections.append(self.my_rcm_client)
     self.topFrame = Frame(self.top)
     self.topFrame.pack(fill=BOTH, expand=1)
     self.frameLogin = Login(guiaction=self.ok,
                             action=self.my_rcm_client.login_setup,
                             master=self.topFrame)
     self.top.grab_set()
예제 #5
0
 def __init__(self):
     self.pack_info = rcm_utils.pack_info()
     self.last_used_dir = '.'
     self.n = None
예제 #6
0
 def __init__(self):
     self.pack_info=rcm_utils.pack_info()
     self.last_used_dir='.'
     self.n=None