PEATDB/PEATApp.py
def loadDB(self, DB):
        """Load peat db and display it in a table"""
        #createtableframe should be optimised for reading large dbs
        self.DB = DB
        self.removeBlankCanvas()
        self.createSidePane()
        self.tablemodel = PEATTableModel(DB)
        self.tableframe = Frame(self.masterframe, bd=1,relief=RAISED)
        self.table = PEATTable(self.tableframe, self.tablemodel, parentapp=self)
        self.table.loadPrefs(self.preferences)
        self.table.createTableFrame()
        if self.preferences.get('thumbsize') == '':
            self.preferences.set('thumbsize',200)
        self.table.thumbsize = int(self.preferences.get('thumbsize'))
        #we are using a panedwindow
        self.masterframe.paneconfigure(self.tableframe,
                                       width=850,
                                       sticky='news')
        self.masterframe.add(self.tableframe)
        self.setTitle()
        self.recordEvent('Loaded db ok')
        #print self.project
        if self.DB.meta.info['project'] == '':
            if self.project!='':
                self.DB.meta.info['project'] = self.project
        name = self.DB.meta.info['project']
        if not name in self.currentDBs.keys():
            self.addDB(name, self.DB)

        self.updateStatusPane()
        self.toggleMenus('normal')
        self.updateMenus(load=True)
        return True
Load peat db and display it in a table
Load peat db and display it in a table
Load peat db and display it in a table
def loadDB(self, DB):
        self.DB = DB
        self.removeBlankCanvas()
        self.createSidePane()
        self.tablemodel = PEATTableModel(DB)
        self.tableframe = Frame(self.masterframe, bd=1,relief=RAISED)
        self.table = PEATTable(self.tableframe, self.tablemodel, parentapp=self)
        self.table.loadPrefs(self.preferences)
        self.table.createTableFrame()
        if self.preferences.get('thumbsize') == '':
            self.preferences.set('thumbsize',200)
        self.table.thumbsize = int(self.preferences.get('thumbsize'))
        self.masterframe.paneconfigure(self.tableframe,
                                       width=850,
                                       sticky='news')
        self.masterframe.add(self.tableframe)
        self.setTitle()
        self.recordEvent('Loaded db ok')
        if self.DB.meta.info['project'] == '':
            if self.project!='':
                self.DB.meta.info['project'] = self.project
        name = self.DB.meta.info['project']
        if not name in self.currentDBs.keys():
            self.addDB(name, self.DB)
        self.updateStatusPane()
        self.toggleMenus('normal')
        self.updateMenus(load=True)
        return True
def loadDB ( self , DB ) : self . DB = DB self . removeBlankCanvas ( ) self . createSidePane ( ) self . tablemodel = PEATTableModel ( DB ) self . tableframe = Frame ( self . masterframe , bd = 1 , relief = RAISED ) self . table = PEATTable ( self . tableframe , self . tablemodel , parentapp = self ) self . table . loadPrefs ( self . preferences ) self . table . createTableFrame ( ) if self . preferences . get ( 'thumbsize' ) == '' : self . preferences . set ( 'thumbsize' , 200 ) self . table . thumbsize = int ( self . preferences . get ( 'thumbsize' ) ) self . masterframe . paneconfigure ( self . tableframe , width = 850 , sticky = 'news' ) self . masterframe . add ( self . tableframe ) self . setTitle ( ) self . recordEvent ( 'Loaded db ok' ) if self . DB . meta . info [ 'project' ] == '' : if self . project != '' : self . DB . meta . info [ 'project' ] = self . project name = self . DB . meta . info [ 'project' ] if not name in self . currentDBs . keys ( ) : self . addDB ( name , self . DB ) self . updateStatusPane ( ) self . toggleMenus ( 'normal' ) self . updateMenus ( load = True ) return True
Load peat db and display it in a table
Load peat db and display it in a table
"""Load peat db and display it in a table""" #createtableframe should be optimised for reading large dbs #we are using a panedwindow #print self.project
self
DB