PEATDB/PEATApp.py
def edit_notes(self, protein, field_name):
        """edit notes in a text frame"""
        D = self.DB.data
        if D[protein].has_key(field_name):
            data=D[protein][field_name]
        else:
            data=None

        info={}
        info['record']=protein
        info['column']=field_name
        import textFrame
        self.notesframe=textFrame.textFrame(parent=self,title=protein+' notes',parent_info=info)
        if data!=None:
            self.notesframe.load_text(data['text'])
        self.master.wait_window(self.notesframe.frame)

        # did we get any data back?
        if not getattr(self,'notesdata',None):
            self.notesdata=None
        if self.notesdata:
            if self.notesdata.has_key('parent_info'):
                notes_info=self.notesdata['parent_info']
                protein=notes_info['record']
                column=notes_info['column']
                newnotes=self.notesdata['text']
                del self.notesdata['parent_info']
            # Got the record and column - add the data
            self.DB.data[protein][field_name]  = self.notesdata
            delattr(self,'notesdata')
            self.table.redrawCell(recname=protein, colname=field_name)
        return
edit notes in a text frame
edit notes in a text frame
edit notes in a text frame
def edit_notes(self, protein, field_name):
        D = self.DB.data
        if D[protein].has_key(field_name):
            data=D[protein][field_name]
        else:
            data=None
        info={}
        info['record']=protein
        info['column']=field_name
        import textFrame
        self.notesframe=textFrame.textFrame(parent=self,title=protein+' notes',parent_info=info)
        if data!=None:
            self.notesframe.load_text(data['text'])
        self.master.wait_window(self.notesframe.frame)
        if not getattr(self,'notesdata',None):
            self.notesdata=None
        if self.notesdata:
            if self.notesdata.has_key('parent_info'):
                notes_info=self.notesdata['parent_info']
                protein=notes_info['record']
                column=notes_info['column']
                newnotes=self.notesdata['text']
                del self.notesdata['parent_info']
            self.DB.data[protein][field_name]  = self.notesdata
            delattr(self,'notesdata')
            self.table.redrawCell(recname=protein, colname=field_name)
        return
def edit_notes ( self , protein , field_name ) : D = self . DB . data if D [ protein ] . has_key ( field_name ) : data = D [ protein ] [ field_name ] else : data = None info = { } info [ 'record' ] = protein info [ 'column' ] = field_name import textFrame self . notesframe = textFrame . textFrame ( parent = self , title = protein + ' notes' , parent_info = info ) if data != None : self . notesframe . load_text ( data [ 'text' ] ) self . master . wait_window ( self . notesframe . frame ) if not getattr ( self , 'notesdata' , None ) : self . notesdata = None if self . notesdata : if self . notesdata . has_key ( 'parent_info' ) : notes_info = self . notesdata [ 'parent_info' ] protein = notes_info [ 'record' ] column = notes_info [ 'column' ] newnotes = self . notesdata [ 'text' ] del self . notesdata [ 'parent_info' ] self . DB . data [ protein ] [ field_name ] = self . notesdata delattr ( self , 'notesdata' ) self . table . redrawCell ( recname = protein , colname = field_name ) return
edit notes in a text frame
edit notes in a text frame
"""edit notes in a text frame""" # did we get any data back? # Got the record and column - add the data
self
protein
field_name