PEATDB/Meta.py
def updateFields(self):
        """Do field entry widgets for standard meta data items of the form
           data, attrib. Other fields are not displayed but are allowed """
        gvars=self.gvars={}
        cvars=self.cvars={}
        tvars=self.tvars={}
        d=self.data
        metawin = self.metawin
        glbals = self.data
        availabletypes = [types.StringType, types.FloatType, types.IntType]

        def addwidget(frame, fname, fdata, r):
            var=None
            tvar=IntVar(); tvar.set(0)
            if type(fdata) in availabletypes:
                if type(fdata) == types.IntType:
                    var=IntVar()
                else:
                    var=StringVar()
                var.set(fdata)
                Label(frame, text=fname).grid(row=r,column=0,sticky='news',padx=4,pady=3)
                Entry(frame, textvariable=var, bg='white').grid(row=r,column=1,
                                            sticky='news',padx=4,pady=3)
            else:
                Label(frame, text=fname).grid(row=r,column=0,sticky='news',padx=4,pady=3)
                st = Pmw.ScrolledText(frame, borderframe = 1,
                                        labelpos = 'n', label_text=str(type(fdata)),
                                        text_wrap='none')
                st.grid(row=r,column=1,sticky='news',padx=4,pady=3)
                p = Utils.prettyPrint(fdata) #more readable
                st.setvalue(p)
                st.component('text').configure(height=6)
                st.component('text').configure(state=DISABLED)

            return var, tvar

        #self.keylabel.set(key)

        gf = LabelFrame(metawin, text='fields')
        gf.grid(row=1,column=0,sticky='news',padx=4,pady=3)
        gf.columnconfigure(1,weight=1)
        r=0
        for g in glbals.keys():
            var, tvars[g] = addwidget(gf, g, glbals[g], r)
            if var != None:
                gvars[g]=var
            r+=1

        return
Do field entry widgets for standard meta data items of the form
           data, attrib. Other fields are not displayed but are allowed 
Do field entry widgets for standard meta data items of the form
data, attrib. Other fields are not displayed but are allowed
Do field entry widgets for standard meta data items of the form data attrib . Other fields are not displayed but are allowed
def updateFields(self):
        gvars=self.gvars={}
        cvars=self.cvars={}
        tvars=self.tvars={}
        d=self.data
        metawin = self.metawin
        glbals = self.data
        availabletypes = [types.StringType, types.FloatType, types.IntType]
        def addwidget(frame, fname, fdata, r):
            var=None
            tvar=IntVar(); tvar.set(0)
            if type(fdata) in availabletypes:
                if type(fdata) == types.IntType:
                    var=IntVar()
                else:
                    var=StringVar()
                var.set(fdata)
                Label(frame, text=fname).grid(row=r,column=0,sticky='news',padx=4,pady=3)
                Entry(frame, textvariable=var, bg='white').grid(row=r,column=1,
                                            sticky='news',padx=4,pady=3)
            else:
                Label(frame, text=fname).grid(row=r,column=0,sticky='news',padx=4,pady=3)
                st = Pmw.ScrolledText(frame, borderframe = 1,
                                        labelpos = 'n', label_text=str(type(fdata)),
                                        text_wrap='none')
                st.grid(row=r,column=1,sticky='news',padx=4,pady=3)
                p = Utils.prettyPrint(fdata) 
                st.setvalue(p)
                st.component('text').configure(height=6)
                st.component('text').configure(state=DISABLED)
            return var, tvar
        gf = LabelFrame(metawin, text='fields')
        gf.grid(row=1,column=0,sticky='news',padx=4,pady=3)
        gf.columnconfigure(1,weight=1)
        r=0
        for g in glbals.keys():
            var, tvars[g] = addwidget(gf, g, glbals[g], r)
            if var != None:
                gvars[g]=var
            r+=1
        return
def updateFields ( self ) : gvars = self . gvars = { } cvars = self . cvars = { } tvars = self . tvars = { } d = self . data metawin = self . metawin glbals = self . data availabletypes = [ types . StringType , types . FloatType , types . IntType ] def addwidget ( frame , fname , fdata , r ) : var = None tvar = IntVar ( ) ; tvar . set ( 0 ) if type ( fdata ) in availabletypes : if type ( fdata ) == types . IntType : var = IntVar ( ) else : var = StringVar ( ) var . set ( fdata ) Label ( frame , text = fname ) . grid ( row = r , column = 0 , sticky = 'news' , padx = 4 , pady = 3 ) Entry ( frame , textvariable = var , bg = 'white' ) . grid ( row = r , column = 1 , sticky = 'news' , padx = 4 , pady = 3 ) else : Label ( frame , text = fname ) . grid ( row = r , column = 0 , sticky = 'news' , padx = 4 , pady = 3 ) st = Pmw . ScrolledText ( frame , borderframe = 1 , labelpos = 'n' , label_text = str ( type ( fdata ) ) , text_wrap = 'none' ) st . grid ( row = r , column = 1 , sticky = 'news' , padx = 4 , pady = 3 ) p = Utils . prettyPrint ( fdata ) st . setvalue ( p ) st . component ( 'text' ) . configure ( height = 6 ) st . component ( 'text' ) . configure ( state = DISABLED ) return var , tvar gf = LabelFrame ( metawin , text = 'fields' ) gf . grid ( row = 1 , column = 0 , sticky = 'news' , padx = 4 , pady = 3 ) gf . columnconfigure ( 1 , weight = 1 ) r = 0 for g in glbals . keys ( ) : var , tvars [ g ] = addwidget ( gf , g , glbals [ g ] , r ) if var != None : gvars [ g ] = var r += 1 return
Do field entry widgets for standard meta data items of the form
data, attrib.
Do field entry widgets for standard meta data items of the form data attrib .
"""Do field entry widgets for standard meta data items of the form
           data, attrib. Other fields are not displayed but are allowed """ #more readable #self.keylabel.set(key)
self