PEATDB/PEATApp.py
def testsDialog(self):
        """Allow users to set up a test DB"""
        import zodbtest
        def createDB():
            mpDlg = MultipleValDialog(title='Create Test DB',
                                        initialvalues=('testdb.fs',
                                                       1000),
                                        labels=('filename','no. recs'),
                                        types=('string','int'),
                                        parent=self.main)

            if mpDlg.result == True:
                filename = mpDlg.results[0]
                norecs = mpDlg.results[1]
            else:
                return
            tstDB = zodbtest.createdb(filename, norecs)
            self.closeDB()
            self.loadDB(tstDB)
        def close():
            frame.destroy()
            self.resetSidePane(width=20)
            return

        if self.showDialogsinSidePane == True and self.DB!=None:
            self.resetSidePane(width=300) #clears it
            frame = Frame(master=self.sidepane)
            frame.pack(fill=BOTH)
        else:
            frame = Toplevel()
            frame.geometry('+100+450')
            frame.title('Tests')
        Button(frame,text='Create Test DB',command=createDB).pack(fill=BOTH,side=TOP)
        Button(frame,text='Close',command=close).pack(fill=BOTH,side=TOP)
        return
Allow users to set up a test DB
Allow users to set up a test DB
Allow users to set up a test DB
def testsDialog(self):
        import zodbtest
        def createDB():
            mpDlg = MultipleValDialog(title='Create Test DB',
                                        initialvalues=('testdb.fs',
                                                       1000),
                                        labels=('filename','no. recs'),
                                        types=('string','int'),
                                        parent=self.main)
            if mpDlg.result == True:
                filename = mpDlg.results[0]
                norecs = mpDlg.results[1]
            else:
                return
            tstDB = zodbtest.createdb(filename, norecs)
            self.closeDB()
            self.loadDB(tstDB)
        def close():
            frame.destroy()
            self.resetSidePane(width=20)
            return
        if self.showDialogsinSidePane == True and self.DB!=None:
            self.resetSidePane(width=300) 
            frame = Frame(master=self.sidepane)
            frame.pack(fill=BOTH)
        else:
            frame = Toplevel()
            frame.geometry('+100+450')
            frame.title('Tests')
        Button(frame,text='Create Test DB',command=createDB).pack(fill=BOTH,side=TOP)
        Button(frame,text='Close',command=close).pack(fill=BOTH,side=TOP)
        return
def testsDialog ( self ) : import zodbtest def createDB ( ) : mpDlg = MultipleValDialog ( title = 'Create Test DB' , initialvalues = ( 'testdb.fs' , 1000 ) , labels = ( 'filename' , 'no. recs' ) , types = ( 'string' , 'int' ) , parent = self . main ) if mpDlg . result == True : filename = mpDlg . results [ 0 ] norecs = mpDlg . results [ 1 ] else : return tstDB = zodbtest . createdb ( filename , norecs ) self . closeDB ( ) self . loadDB ( tstDB ) def close ( ) : frame . destroy ( ) self . resetSidePane ( width = 20 ) return if self . showDialogsinSidePane == True and self . DB != None : self . resetSidePane ( width = 300 ) frame = Frame ( master = self . sidepane ) frame . pack ( fill = BOTH ) else : frame = Toplevel ( ) frame . geometry ( '+100+450' ) frame . title ( 'Tests' ) Button ( frame , text = 'Create Test DB' , command = createDB ) . pack ( fill = BOTH , side = TOP ) Button ( frame , text = 'Close' , command = close ) . pack ( fill = BOTH , side = TOP ) return
Allow users to set up a test DB
Allow users to set up a test DB
"""Allow users to set up a test DB""" #clears it
self