PEATDB/PEATApp.py
def editDictField(self, protein, field_name, default={}):
        """Edit a field that's a dict structure"""
        D = self.DB.data
        if D[protein].has_key(field_name):
            data=D[protein][field_name]
        else:
            data=default
        import types
        if not type(data) is types.DictType:
            return
        vals = data.values()
        labels = data.keys()
        types= ['string' for i in labels]
        mpDlg = MultipleValDialog(title='Edit Field Data',
                                    initialvalues=vals,
                                    labels=labels,
                                    types=types,
                                    parent=self.main)
        if mpDlg.result == True:
            for i in range(len(mpDlg.results)):
                key = labels[i]
                data[key] = mpDlg.results[i]
            self.DB.data[protein][field_name] = data
            self.table.redrawCell(recname=protein, colname=field_name)
        return
Edit a field that's a dict structure
Edit a field that's a dict structure
Edit a field that ' s a dict structure
def editDictField(self, protein, field_name, default={}):
        D = self.DB.data
        if D[protein].has_key(field_name):
            data=D[protein][field_name]
        else:
            data=default
        import types
        if not type(data) is types.DictType:
            return
        vals = data.values()
        labels = data.keys()
        types= ['string' for i in labels]
        mpDlg = MultipleValDialog(title='Edit Field Data',
                                    initialvalues=vals,
                                    labels=labels,
                                    types=types,
                                    parent=self.main)
        if mpDlg.result == True:
            for i in range(len(mpDlg.results)):
                key = labels[i]
                data[key] = mpDlg.results[i]
            self.DB.data[protein][field_name] = data
            self.table.redrawCell(recname=protein, colname=field_name)
        return
def editDictField ( self , protein , field_name , default = { } ) : D = self . DB . data if D [ protein ] . has_key ( field_name ) : data = D [ protein ] [ field_name ] else : data = default import types if not type ( data ) is types . DictType : return vals = data . values ( ) labels = data . keys ( ) types = [ 'string' for i in labels ] mpDlg = MultipleValDialog ( title = 'Edit Field Data' , initialvalues = vals , labels = labels , types = types , parent = self . main ) if mpDlg . result == True : for i in range ( len ( mpDlg . results ) ) : key = labels [ i ] data [ key ] = mpDlg . results [ i ] self . DB . data [ protein ] [ field_name ] = data self . table . redrawCell ( recname = protein , colname = field_name ) return
Edit a field that's a dict structure
Edit a field that ' s a dict structure
"""Edit a field that's a dict structure"""
self
protein
field_name
default