PEATDB/PEATApp.py
def startLabbook(self, protein=None, field_name=None):
        """Edit a labbook style sub-table"""

        if self.DB == None:
            return
        D = self.DB.data
        tabledata = None
        info = None
        #protein is ALL means we are using the main labbook
        if protein == 'ALL':
            tabledata = self.DB.meta['labbook']
            if tabledata == {}: tabledata=None
        elif hasattr(self.DB.meta, 'labbooks') and protein in self.DB.meta.labbooks:
            tabledata = self.DB.meta.labbooks[protein]
        elif protein and field_name:
            if D[protein].has_key(field_name):
                tabledata = D[protein][field_name]
            info={}
            info['record']=protein
            info['column']=field_name

        from Labbook import LabbookApp
        if tabledata != None and isinstance(tabledata, dict):
            labbook = LabbookApp(parent=self, peatinfo=info, data=tabledata)
        else:
            labbook = LabbookApp(parent=self, peatinfo=info)
        self.master.wait_window(labbook.labbook_win)

        # did we get any data back?
        if not hasattr(self, 'templabbookdata'):
            self.templabbookdata=None
        if not self.templabbookdata is None:
            if protein == 'ALL':
                self.DB.meta['labbook'] = self.templabbookdata
            elif hasattr(self.DB.meta, 'labbooks') and protein in self.DB.meta.labbooks:
                self.DB.meta.labbooks[protein] = self.templabbookdata
                self.updateLabbooksMenu()
            else:
                D[protein][field_name] = self.templabbookdata
            delattr(self,'templabbookdata')
            #self.updateTable(protein, field_name)
            self.table.redrawCell(recname=protein, colname=field_name)
        return
Edit a labbook style sub-table
Edit a labbook style sub-table
Edit a labbook style sub - table
def startLabbook(self, protein=None, field_name=None):
        if self.DB == None:
            return
        D = self.DB.data
        tabledata = None
        info = None
        if protein == 'ALL':
            tabledata = self.DB.meta['labbook']
            if tabledata == {}: tabledata=None
        elif hasattr(self.DB.meta, 'labbooks') and protein in self.DB.meta.labbooks:
            tabledata = self.DB.meta.labbooks[protein]
        elif protein and field_name:
            if D[protein].has_key(field_name):
                tabledata = D[protein][field_name]
            info={}
            info['record']=protein
            info['column']=field_name
        from Labbook import LabbookApp
        if tabledata != None and isinstance(tabledata, dict):
            labbook = LabbookApp(parent=self, peatinfo=info, data=tabledata)
        else:
            labbook = LabbookApp(parent=self, peatinfo=info)
        self.master.wait_window(labbook.labbook_win)
        if not hasattr(self, 'templabbookdata'):
            self.templabbookdata=None
        if not self.templabbookdata is None:
            if protein == 'ALL':
                self.DB.meta['labbook'] = self.templabbookdata
            elif hasattr(self.DB.meta, 'labbooks') and protein in self.DB.meta.labbooks:
                self.DB.meta.labbooks[protein] = self.templabbookdata
                self.updateLabbooksMenu()
            else:
                D[protein][field_name] = self.templabbookdata
            delattr(self,'templabbookdata')
            self.table.redrawCell(recname=protein, colname=field_name)
        return
def startLabbook ( self , protein = None , field_name = None ) : if self . DB == None : return D = self . DB . data tabledata = None info = None if protein == 'ALL' : tabledata = self . DB . meta [ 'labbook' ] if tabledata == { } : tabledata = None elif hasattr ( self . DB . meta , 'labbooks' ) and protein in self . DB . meta . labbooks : tabledata = self . DB . meta . labbooks [ protein ] elif protein and field_name : if D [ protein ] . has_key ( field_name ) : tabledata = D [ protein ] [ field_name ] info = { } info [ 'record' ] = protein info [ 'column' ] = field_name from Labbook import LabbookApp if tabledata != None and isinstance ( tabledata , dict ) : labbook = LabbookApp ( parent = self , peatinfo = info , data = tabledata ) else : labbook = LabbookApp ( parent = self , peatinfo = info ) self . master . wait_window ( labbook . labbook_win ) if not hasattr ( self , 'templabbookdata' ) : self . templabbookdata = None if not self . templabbookdata is None : if protein == 'ALL' : self . DB . meta [ 'labbook' ] = self . templabbookdata elif hasattr ( self . DB . meta , 'labbooks' ) and protein in self . DB . meta . labbooks : self . DB . meta . labbooks [ protein ] = self . templabbookdata self . updateLabbooksMenu ( ) else : D [ protein ] [ field_name ] = self . templabbookdata delattr ( self , 'templabbookdata' ) self . table . redrawCell ( recname = protein , colname = field_name ) return
Edit a labbook style sub-table
Edit a labbook style sub - table
"""Edit a labbook style sub-table""" #protein is ALL means we are using the main labbook # did we get any data back? #self.updateTable(protein, field_name)
self
protein
field_name