PEATDB/DNAtool/DNAtool.py
def assess_status(self):
        """Figures out which buttons to activate/deactivate"""

        # Update the PEATDB_record information
        if self.data.has_key('PEAT_DBrecord'):
            self.PEAT_DBrecord.set(self.data['PEAT_DBrecord'])

        # Do we have an open project?
        if self.data['Project filename']:
            self.file_menu.entryconfigure(0,state=DISABLED) # Open project
            self.file_menu.entryconfigure(1,state=NORMAL) # Close project
            self.file_menu.entryconfigure(3,state=NORMAL) # Save project as

            # Is the current project saved?
            if not self.data['Project saved']:
                self.file_menu.entryconfigure(2,state=NORMAL) # Save Project
            else:
                self.file_menu.entryconfigure(2,state=DISABLED) # Save Project
        else:

            # No project
            self.file_menu.entryconfigure(1,state=DISABLED) # Close project
            self.file_menu.entryconfigure(2,state=DISABLED) # Save Project
            self.file_menu.entryconfigure(3,state=DISABLED) # Save project as

        # Do we have a DNA sequence?
        if self.data['DNAseq']:
            self.ORFbutton.configure(state=NORMAL)     # ORF button
            # Sequence menu
            states={'Open':None,
                    'Save':1,
                    'Save As':1,
                    'Complementary':1,
                    'Inverse':1,
                    'Find':1}
            self.set_pulldown_and_shortcut_states(states,self.seqmenu)
            # Primer menu
            self.primer_menu.entryconfigure(0,state=ACTIVE) # PCR primer
            # .
            self.file_menu.entryconfigure(0,state=DISABLED) # Open project
            self.file_menu.entryconfigure(3,state=NORMAL) # Save project as
        else:
            # No DNA
            states={'Open':1,
                    'Save':None,
                    'Save As':None,
                    'Complementary':None,
                    'Inverse':None,
                    'Find':None,
                    'Cut':None,
                    'Copy':None,
                    'Paste':None,
                    'Delete':None}
            self.set_pulldown_and_shortcut_states(states,self.seqmenu)

            # Primer menu
            self.primer_menu.entryconfigure(0,state=DISABLED) # PCR primers
            self.primer_menu.entryconfigure(1,state=DISABLED) # Mutagenic primer

        # Has an ORF been selected?
        if self.data.has_key('ORF_selected'):
            self.primer_menu.entryconfigure(1,state=ACTIVE) # Mutagenic primer

            start=self.data['ORF_selected']['start']
            stop=self.data['ORF_selected']['stop']
        return
Figures out which buttons to activate/deactivate
Figures out which buttons to activate/deactivate
Figures out which buttons to activate / deactivate
def assess_status(self):
        if self.data.has_key('PEAT_DBrecord'):
            self.PEAT_DBrecord.set(self.data['PEAT_DBrecord'])
        if self.data['Project filename']:
            self.file_menu.entryconfigure(0,state=DISABLED) 
            self.file_menu.entryconfigure(1,state=NORMAL) 
            self.file_menu.entryconfigure(3,state=NORMAL) 
            if not self.data['Project saved']:
                self.file_menu.entryconfigure(2,state=NORMAL) 
            else:
                self.file_menu.entryconfigure(2,state=DISABLED) 
        else:
            self.file_menu.entryconfigure(1,state=DISABLED) 
            self.file_menu.entryconfigure(2,state=DISABLED) 
            self.file_menu.entryconfigure(3,state=DISABLED) 
        if self.data['DNAseq']:
            self.ORFbutton.configure(state=NORMAL)     
            states={'Open':None,
                    'Save':1,
                    'Save As':1,
                    'Complementary':1,
                    'Inverse':1,
                    'Find':1}
            self.set_pulldown_and_shortcut_states(states,self.seqmenu)
            self.primer_menu.entryconfigure(0,state=ACTIVE) 
            self.file_menu.entryconfigure(0,state=DISABLED) 
            self.file_menu.entryconfigure(3,state=NORMAL) 
        else:
            states={'Open':1,
                    'Save':None,
                    'Save As':None,
                    'Complementary':None,
                    'Inverse':None,
                    'Find':None,
                    'Cut':None,
                    'Copy':None,
                    'Paste':None,
                    'Delete':None}
            self.set_pulldown_and_shortcut_states(states,self.seqmenu)
            self.primer_menu.entryconfigure(0,state=DISABLED) s
            self.primer_menu.entryconfigure(1,state=DISABLED) 
        if self.data.has_key('ORF_selected'):
            self.primer_menu.entryconfigure(1,state=ACTIVE) 
            start=self.data['ORF_selected']['start']
            stop=self.data['ORF_selected']['stop']
        return
def assess_status ( self ) : if self . data . has_key ( 'PEAT_DBrecord' ) : self . PEAT_DBrecord . set ( self . data [ 'PEAT_DBrecord' ] ) if self . data [ 'Project filename' ] : self . file_menu . entryconfigure ( 0 , state = DISABLED ) self . file_menu . entryconfigure ( 1 , state = NORMAL ) self . file_menu . entryconfigure ( 3 , state = NORMAL ) if not self . data [ 'Project saved' ] : self . file_menu . entryconfigure ( 2 , state = NORMAL ) else : self . file_menu . entryconfigure ( 2 , state = DISABLED ) else : self . file_menu . entryconfigure ( 1 , state = DISABLED ) self . file_menu . entryconfigure ( 2 , state = DISABLED ) self . file_menu . entryconfigure ( 3 , state = DISABLED ) if self . data [ 'DNAseq' ] : self . ORFbutton . configure ( state = NORMAL ) states = { 'Open' : None , 'Save' : 1 , 'Save As' : 1 , 'Complementary' : 1 , 'Inverse' : 1 , 'Find' : 1 } self . set_pulldown_and_shortcut_states ( states , self . seqmenu ) self . primer_menu . entryconfigure ( 0 , state = ACTIVE ) self . file_menu . entryconfigure ( 0 , state = DISABLED ) self . file_menu . entryconfigure ( 3 , state = NORMAL ) else : states = { 'Open' : 1 , 'Save' : None , 'Save As' : None , 'Complementary' : None , 'Inverse' : None , 'Find' : None , 'Cut' : None , 'Copy' : None , 'Paste' : None , 'Delete' : None } self . set_pulldown_and_shortcut_states ( states , self . seqmenu ) self . primer_menu . entryconfigure ( 0 , state = DISABLED ) self . primer_menu . entryconfigure ( 1 , state = DISABLED ) if self . data . has_key ( 'ORF_selected' ) : self . primer_menu . entryconfigure ( 1 , state = ACTIVE ) start = self . data [ 'ORF_selected' ] [ 'start' ] stop = self . data [ 'ORF_selected' ] [ 'stop' ] return
Figures out which buttons to activate/deactivate
Figures out which buttons to activate / deactivate
"""Figures out which buttons to activate/deactivate""" # Update the PEATDB_record information # Do we have an open project? # Open project # Close project # Save project as # Is the current project saved? # Save Project # Save Project # No project # Close project # Save Project # Save project as # Do we have a DNA sequence? # ORF button # Sequence menu # Primer menu # PCR primer # . # Open project # Save project as # No DNA # Primer menu # PCR primers # Mutagenic primer # Has an ORF been selected? # Mutagenic primer
self