PEATDB/Ekin/Meta.py
def add(self, fieldname, data, attrib='', dataset=None):
        """Add a new field, if no dataset name is provided, the field
           is global to all datasets"""
        d=self.data
        if fieldname==None or data==None:
            print 'error, provide field name and data'
            return
        if dataset==None:
            if not d.has_key('glob'):
                self.glob = {}
            self.glob[fieldname]={}
            self.glob[fieldname]['data'] = data
            self.glob[fieldname]['attrib'] = attrib
        else:
            if not d.has_key(dataset):
                d[dataset] = {}
            d[dataset][fieldname] = {}
            d[dataset][fieldname]['data'] = data
            d[dataset][fieldname]['attrib'] = attrib
        return
Add a new field, if no dataset name is provided, the field
           is global to all datasets
Add a new field, if no dataset name is provided, the field
is global to all datasets
Add a new field if no dataset name is provided the field is global to all datasets
def add(self, fieldname, data, attrib='', dataset=None):
        d=self.data
        if fieldname==None or data==None:
            print 'error, provide field name and data'
            return
        if dataset==None:
            if not d.has_key('glob'):
                self.glob = {}
            self.glob[fieldname]={}
            self.glob[fieldname]['data'] = data
            self.glob[fieldname]['attrib'] = attrib
        else:
            if not d.has_key(dataset):
                d[dataset] = {}
            d[dataset][fieldname] = {}
            d[dataset][fieldname]['data'] = data
            d[dataset][fieldname]['attrib'] = attrib
        return
def add ( self , fieldname , data , attrib = '' , dataset = None ) : d = self . data if fieldname == None or data == None : print 'error, provide field name and data' return if dataset == None : if not d . has_key ( 'glob' ) : self . glob = { } self . glob [ fieldname ] = { } self . glob [ fieldname ] [ 'data' ] = data self . glob [ fieldname ] [ 'attrib' ] = attrib else : if not d . has_key ( dataset ) : d [ dataset ] = { } d [ dataset ] [ fieldname ] = { } d [ dataset ] [ fieldname ] [ 'data' ] = data d [ dataset ] [ fieldname ] [ 'attrib' ] = attrib return
Add a new field, if no dataset name is provided, the field
is global to all datasets
Add a new field if no dataset name is provided the field is global to all datasets
"""Add a new field, if no dataset name is provided, the field
           is global to all datasets"""
self
fieldname
data
attrib
dataset