PEATDB/PEATApp.py
def connectDialog(self, event=None):
        """Get a server/port, storage and open DB"""
        backends = PDatabase.backends
        mpDlg = MultipleValDialog(title='Connect to DB',
                                    initialvalues=(self.username, self.password, self.server,
                                                   self.port, self.project,
                                                   backends),
                                    labels=('username','password','server','port','project','backend'),
                                    types=('string','password','string','int','string','list'),
                                    parent=self.main)

        if mpDlg.result == True:
            self.username = mpDlg.results[0]
            self.password = mpDlg.results[1]
            self.server = mpDlg.results[2]
            self.port = mpDlg.results[3]
            self.project = mpDlg.results[4]
            self.backend = mpDlg.results[5]
        else:
            return
        if self.server != None:
            DB = PDatabase(server=self.server, port=self.port,
                      username=self.username,
                      password=self.password,
                      project=self.project,
                      backend=self.backend)

            if DB.connection == None:
                tkMessageBox.showwarning("Connection Error",
                         'Could not connect to %s:%s.\n'
                         'Error message returned: %s'
                          %(self.project,self.server,DB.errormessage))
                self.recordEvent('Connection failure to '+self.server)
                return
            #We can try to close current db now
            '''answer = self.closeDB()
            if answer == 'cancel':
                return'''
            self.hideDB()
            self.recordEvent('Connected to '+self.server)
            result = self.loadDB(DB)
            self.addtoRecent((self.server,self.port,self.project,self.backend))

        return
Get a server/port, storage and open DB
Get a server/port, storage and open DB
Get a server / port storage and open DB
def connectDialog(self, event=None):
        backends = PDatabase.backends
        mpDlg = MultipleValDialog(title='Connect to DB',
                                    initialvalues=(self.username, self.password, self.server,
                                                   self.port, self.project,
                                                   backends),
                                    labels=('username','password','server','port','project','backend'),
                                    types=('string','password','string','int','string','list'),
                                    parent=self.main)
        if mpDlg.result == True:
            self.username = mpDlg.results[0]
            self.password = mpDlg.results[1]
            self.server = mpDlg.results[2]
            self.port = mpDlg.results[3]
            self.project = mpDlg.results[4]
            self.backend = mpDlg.results[5]
        else:
            return
        if self.server != None:
            DB = PDatabase(server=self.server, port=self.port,
                      username=self.username,
                      password=self.password,
                      project=self.project,
                      backend=self.backend)
            if DB.connection == None:
                tkMessageBox.showwarning("Connection Error",
                         'Could not connect to %s:%s.\n'
                         'Error message returned: %s'
                          %(self.project,self.server,DB.errormessage))
                self.recordEvent('Connection failure to '+self.server)
                return
            self.hideDB()
            self.recordEvent('Connected to '+self.server)
            result = self.loadDB(DB)
            self.addtoRecent((self.server,self.port,self.project,self.backend))
        return
def connectDialog ( self , event = None ) : backends = PDatabase . backends mpDlg = MultipleValDialog ( title = 'Connect to DB' , initialvalues = ( self . username , self . password , self . server , self . port , self . project , backends ) , labels = ( 'username' , 'password' , 'server' , 'port' , 'project' , 'backend' ) , types = ( 'string' , 'password' , 'string' , 'int' , 'string' , 'list' ) , parent = self . main ) if mpDlg . result == True : self . username = mpDlg . results [ 0 ] self . password = mpDlg . results [ 1 ] self . server = mpDlg . results [ 2 ] self . port = mpDlg . results [ 3 ] self . project = mpDlg . results [ 4 ] self . backend = mpDlg . results [ 5 ] else : return if self . server != None : DB = PDatabase ( server = self . server , port = self . port , username = self . username , password = self . password , project = self . project , backend = self . backend ) if DB . connection == None : tkMessageBox . showwarning ( "Connection Error" , 'Could not connect to %s:%s.\n' 'Error message returned: %s' % ( self . project , self . server , DB . errormessage ) ) self . recordEvent ( 'Connection failure to ' + self . server ) return '''answer = self.closeDB()
            if answer == 'cancel':
                return''' self . hideDB ( ) self . recordEvent ( 'Connected to ' + self . server ) result = self . loadDB ( DB ) self . addtoRecent ( ( self . server , self . port , self . project , self . backend ) ) return
Get a server/port, storage and open DB
Get a server / port storage and open DB
"""Get a server/port, storage and open DB""" #We can try to close current db now '''answer = self.closeDB()
            if answer == 'cancel':
                return'''
self
event