PEATDB/Tables.py
def loadPrefs(self, prefs=None):
        """Load table specific prefs from the prefs instance used
           if they are not present, create them."""

        if prefs==None:
            prefs=Preferences('Table',{'check_for_update':1})
        self.prefs = prefs
        defaultprefs = {'horizlines':self.horizlines, 'vertlines':self.vertlines,
                        'alternaterows':self.alternaterows,
                        'rowheight':self.rowheight,
                        'cellwidth':120,
                        'autoresizecols': 0,
                        'paging': 0, 'rowsperpage' : 50,
                        'celltextsize':11, 'celltextfont':'Arial',
                        'cellbackgr': self.cellbackgr, 'grid_color': self.grid_color,
                        'linewidth' : self.linewidth,
                        'rowselectedcolor': self.rowselectedcolor}

        for prop in defaultprefs.keys():
            try:
                self.prefs.get(prop);
            except:
                self.prefs.set(prop, defaultprefs[prop])
        #Create tkvars for dialog
        self.rowheightvar = IntVar()
        self.rowheightvar.set(self.prefs.get('rowheight'))
        self.rowheight = self.rowheightvar.get()
        self.cellwidthvar = IntVar()
        self.cellwidthvar.set(self.prefs.get('cellwidth'))
        self.cellwidth = self.cellwidthvar.get()
        self.linewidthvar = IntVar()
        self.linewidthvar.set(self.prefs.get('linewidth'))
        self.autoresizecolsvar = IntVar()
        self.autoresizecolsvar.set(self.prefs.get('autoresizecols'))
        self.horizlinesvar = IntVar()
        self.horizlinesvar.set(self.prefs.get('horizlines'))
        self.vertlinesvar = IntVar()
        self.vertlinesvar.set(self.prefs.get('vertlines'))
        self.alternaterowsvar = IntVar()
        self.alternaterowsvar.set(self.prefs.get('alternaterows'))
        self.usepagingvar = IntVar()
        self.usepagingvar.set(self.prefs.get('paging'))
        self.paging = self.usepagingvar.get()
        self.rowsperpagevar = StringVar()
        self.rowsperpagevar.set(self.prefs.get('rowsperpage'))
        self.celltextsizevar = IntVar()
        self.celltextsizevar.set(self.prefs.get('celltextsize'))
        self.celltextfontvar = StringVar()
        self.celltextfontvar.set(self.prefs.get('celltextfont'))
        self.cellbackgr = self.prefs.get('cellbackgr')
        self.grid_color = self.prefs.get('grid_color')
        self.rowselectedcolor = self.prefs.get('rowselectedcolor')        
        self.fontsize = self.celltextsizevar.get()
        self.thefont = (self.celltextfontvar.get(), self.celltextsizevar.get())
        return
Load table specific prefs from the prefs instance used
           if they are not present, create them.
Load table specific prefs from the prefs instance used
if they are not present, create them.
Load table specific prefs from the prefs instance used if they are not present create them .
def loadPrefs(self, prefs=None):
        if prefs==None:
            prefs=Preferences('Table',{'check_for_update':1})
        self.prefs = prefs
        defaultprefs = {'horizlines':self.horizlines, 'vertlines':self.vertlines,
                        'alternaterows':self.alternaterows,
                        'rowheight':self.rowheight,
                        'cellwidth':120,
                        'autoresizecols': 0,
                        'paging': 0, 'rowsperpage' : 50,
                        'celltextsize':11, 'celltextfont':'Arial',
                        'cellbackgr': self.cellbackgr, 'grid_color': self.grid_color,
                        'linewidth' : self.linewidth,
                        'rowselectedcolor': self.rowselectedcolor}
        for prop in defaultprefs.keys():
            try:
                self.prefs.get(prop);
            except:
                self.prefs.set(prop, defaultprefs[prop])
        self.rowheightvar = IntVar()
        self.rowheightvar.set(self.prefs.get('rowheight'))
        self.rowheight = self.rowheightvar.get()
        self.cellwidthvar = IntVar()
        self.cellwidthvar.set(self.prefs.get('cellwidth'))
        self.cellwidth = self.cellwidthvar.get()
        self.linewidthvar = IntVar()
        self.linewidthvar.set(self.prefs.get('linewidth'))
        self.autoresizecolsvar = IntVar()
        self.autoresizecolsvar.set(self.prefs.get('autoresizecols'))
        self.horizlinesvar = IntVar()
        self.horizlinesvar.set(self.prefs.get('horizlines'))
        self.vertlinesvar = IntVar()
        self.vertlinesvar.set(self.prefs.get('vertlines'))
        self.alternaterowsvar = IntVar()
        self.alternaterowsvar.set(self.prefs.get('alternaterows'))
        self.usepagingvar = IntVar()
        self.usepagingvar.set(self.prefs.get('paging'))
        self.paging = self.usepagingvar.get()
        self.rowsperpagevar = StringVar()
        self.rowsperpagevar.set(self.prefs.get('rowsperpage'))
        self.celltextsizevar = IntVar()
        self.celltextsizevar.set(self.prefs.get('celltextsize'))
        self.celltextfontvar = StringVar()
        self.celltextfontvar.set(self.prefs.get('celltextfont'))
        self.cellbackgr = self.prefs.get('cellbackgr')
        self.grid_color = self.prefs.get('grid_color')
        self.rowselectedcolor = self.prefs.get('rowselectedcolor')        
        self.fontsize = self.celltextsizevar.get()
        self.thefont = (self.celltextfontvar.get(), self.celltextsizevar.get())
        return
def loadPrefs ( self , prefs = None ) : if prefs == None : prefs = Preferences ( 'Table' , { 'check_for_update' : 1 } ) self . prefs = prefs defaultprefs = { 'horizlines' : self . horizlines , 'vertlines' : self . vertlines , 'alternaterows' : self . alternaterows , 'rowheight' : self . rowheight , 'cellwidth' : 120 , 'autoresizecols' : 0 , 'paging' : 0 , 'rowsperpage' : 50 , 'celltextsize' : 11 , 'celltextfont' : 'Arial' , 'cellbackgr' : self . cellbackgr , 'grid_color' : self . grid_color , 'linewidth' : self . linewidth , 'rowselectedcolor' : self . rowselectedcolor } for prop in defaultprefs . keys ( ) : try : self . prefs . get ( prop ) ; except : self . prefs . set ( prop , defaultprefs [ prop ] ) self . rowheightvar = IntVar ( ) self . rowheightvar . set ( self . prefs . get ( 'rowheight' ) ) self . rowheight = self . rowheightvar . get ( ) self . cellwidthvar = IntVar ( ) self . cellwidthvar . set ( self . prefs . get ( 'cellwidth' ) ) self . cellwidth = self . cellwidthvar . get ( ) self . linewidthvar = IntVar ( ) self . linewidthvar . set ( self . prefs . get ( 'linewidth' ) ) self . autoresizecolsvar = IntVar ( ) self . autoresizecolsvar . set ( self . prefs . get ( 'autoresizecols' ) ) self . horizlinesvar = IntVar ( ) self . horizlinesvar . set ( self . prefs . get ( 'horizlines' ) ) self . vertlinesvar = IntVar ( ) self . vertlinesvar . set ( self . prefs . get ( 'vertlines' ) ) self . alternaterowsvar = IntVar ( ) self . alternaterowsvar . set ( self . prefs . get ( 'alternaterows' ) ) self . usepagingvar = IntVar ( ) self . usepagingvar . set ( self . prefs . get ( 'paging' ) ) self . paging = self . usepagingvar . get ( ) self . rowsperpagevar = StringVar ( ) self . rowsperpagevar . set ( self . prefs . get ( 'rowsperpage' ) ) self . celltextsizevar = IntVar ( ) self . celltextsizevar . set ( self . prefs . get ( 'celltextsize' ) ) self . celltextfontvar = StringVar ( ) self . celltextfontvar . set ( self . prefs . get ( 'celltextfont' ) ) self . cellbackgr = self . prefs . get ( 'cellbackgr' ) self . grid_color = self . prefs . get ( 'grid_color' ) self . rowselectedcolor = self . prefs . get ( 'rowselectedcolor' ) self . fontsize = self . celltextsizevar . get ( ) self . thefont = ( self . celltextfontvar . get ( ) , self . celltextsizevar . get ( ) ) return
Load table specific prefs from the prefs instance used
if they are not present, create them.
Load table specific prefs from the prefs instance used if they are not present create them .
"""Load table specific prefs from the prefs instance used
           if they are not present, create them.""" #Create tkvars for dialog
self
prefs