PEATDB/DNAtool/DNAtool.py
def quit(self,event=None):
        """
        Exit or return to DB_Main.
        If going to DB_Main, make sure that we save the primer_dict in the Database.
        Make sure that we close the primer database window.
        """

        #Make sure that we close the primer database window if open
        if self.pDB_open:
            self.pDB_open.close_pDB()
            self.pDB_open=None
        if self.sequ_win:
            self.sequ_win.close()
            self.sequ_win=None

        # Close the design_mutagenic primer window if open
        if getattr(self,'primer_win',None):
            self.primer_win.destroy()

        # Manage the data transfer - or simply exit
        if self.parent:
            # Check if the altered flag is set
            if self.data['DNAseq_status']=='ALTERED':
                # DNA sequence is altered - we have to ask if a new PEAT_DB record should be created

                import tkMessageBox
                if not tkMessageBox.askyesno('DNA sequence altered',
                                             'The DNA sequence has been altered.'
                                             'Do you want to create a new mutant record?',
                                             parent=self.master):

                    # Show another warning
                    self.data['DNAseq_status']='MODIFY RECORD'
                else:

                    # Create a new PEAT_DB record
                    self.data['DNAseq_status']='ADD NEW RECORD'

            elif self.data['DNAseq_status']!='ALTERED' and self.data['DNAseq_status']=='ORF_CHANGED' and self.data.has_key('ORF_selected'):
                # Only the ORF is altered, ask if we want to save
                import tkMessageBox
                if tkMessageBox.askyesno('ORF shifted',
                                         'The ORF has been moved. Do you want to try to modify the record?',
                                          parent=self.master):
                    self.data['DNAseq_status']='MODIFY ORF'

            elif self.data['DNAseq_status']=='NEW SEQ':
                #this only happens when it has no previous sequence
                pass

            import copy
            if self.parent.DB.data:
            #if self.parent.data['DBinstance']:

                # Record the changes in the primer database
                # First delete everything in the old parent version of the primer db

                self.parent.DB.meta['DNAtool_primers']={}
                # Now add the current primers to the parent instance of the db
                for primer in self.data['primer_dict'].keys():
                    self.parent.DB.meta['DNAtool_primers'][primer]={'sequence':self.data['primer_dict'][primer]['sequence']}
                    self.parent.DB.meta['DNAtool_primers'][primer]['description']=self.data['primer_dict'][primer]['description']

                    if not self.data['primer_dict'][primer].has_key('description'):
                        self.data['primer_dict'][primer]['description']='None entered'

                del self.data['primer_dict']
                self.parent.DNAtool_state = copy.deepcopy(self.data)

            self.master.destroy()
        else:
            import os
            os._exit(0)
        return

        Exit or return to DB_Main.
        If going to DB_Main, make sure that we save the primer_dict in the Database.
        Make sure that we close the primer database window.
        
Exit or return to DB_Main.
If going to DB_Main, make sure that we save the primer_dict in the Database.
Make sure that we close the primer database window.
Exit or return to DB_Main . If going to DB_Main make sure that we save the primer_dict in the Database . Make sure that we close the primer database window .
def quit(self,event=None):
        if self.pDB_open:
            self.pDB_open.close_pDB()
            self.pDB_open=None
        if self.sequ_win:
            self.sequ_win.close()
            self.sequ_win=None
        if getattr(self,'primer_win',None):
            self.primer_win.destroy()
        if self.parent:
            if self.data['DNAseq_status']=='ALTERED':
                import tkMessageBox
                if not tkMessageBox.askyesno('DNA sequence altered',
                                             'The DNA sequence has been altered.'
                                             'Do you want to create a new mutant record?',
                                             parent=self.master):
                    self.data['DNAseq_status']='MODIFY RECORD'
                else:
                    self.data['DNAseq_status']='ADD NEW RECORD'
            elif self.data['DNAseq_status']!='ALTERED' and self.data['DNAseq_status']=='ORF_CHANGED' and self.data.has_key('ORF_selected'):
                import tkMessageBox
                if tkMessageBox.askyesno('ORF shifted',
                                         'The ORF has been moved. Do you want to try to modify the record?',
                                          parent=self.master):
                    self.data['DNAseq_status']='MODIFY ORF'
            elif self.data['DNAseq_status']=='NEW SEQ':
                pass
            import copy
            if self.parent.DB.data:
                self.parent.DB.meta['DNAtool_primers']={}
                for primer in self.data['primer_dict'].keys():
                    self.parent.DB.meta['DNAtool_primers'][primer]={'sequence':self.data['primer_dict'][primer]['sequence']}
                    self.parent.DB.meta['DNAtool_primers'][primer]['description']=self.data['primer_dict'][primer]['description']
                    if not self.data['primer_dict'][primer].has_key('description'):
                        self.data['primer_dict'][primer]['description']='None entered'
                del self.data['primer_dict']
                self.parent.DNAtool_state = copy.deepcopy(self.data)
            self.master.destroy()
        else:
            import os
            os._exit(0)
        return
def quit ( self , event = None ) : if self . pDB_open : self . pDB_open . close_pDB ( ) self . pDB_open = None if self . sequ_win : self . sequ_win . close ( ) self . sequ_win = None if getattr ( self , 'primer_win' , None ) : self . primer_win . destroy ( ) if self . parent : if self . data [ 'DNAseq_status' ] == 'ALTERED' : import tkMessageBox if not tkMessageBox . askyesno ( 'DNA sequence altered' , 'The DNA sequence has been altered.' 'Do you want to create a new mutant record?' , parent = self . master ) : self . data [ 'DNAseq_status' ] = 'MODIFY RECORD' else : self . data [ 'DNAseq_status' ] = 'ADD NEW RECORD' elif self . data [ 'DNAseq_status' ] != 'ALTERED' and self . data [ 'DNAseq_status' ] == 'ORF_CHANGED' and self . data . has_key ( 'ORF_selected' ) : import tkMessageBox if tkMessageBox . askyesno ( 'ORF shifted' , 'The ORF has been moved. Do you want to try to modify the record?' , parent = self . master ) : self . data [ 'DNAseq_status' ] = 'MODIFY ORF' elif self . data [ 'DNAseq_status' ] == 'NEW SEQ' : pass import copy if self . parent . DB . data : self . parent . DB . meta [ 'DNAtool_primers' ] = { } for primer in self . data [ 'primer_dict' ] . keys ( ) : self . parent . DB . meta [ 'DNAtool_primers' ] [ primer ] = { 'sequence' : self . data [ 'primer_dict' ] [ primer ] [ 'sequence' ] } self . parent . DB . meta [ 'DNAtool_primers' ] [ primer ] [ 'description' ] = self . data [ 'primer_dict' ] [ primer ] [ 'description' ] if not self . data [ 'primer_dict' ] [ primer ] . has_key ( 'description' ) : self . data [ 'primer_dict' ] [ primer ] [ 'description' ] = 'None entered' del self . data [ 'primer_dict' ] self . parent . DNAtool_state = copy . deepcopy ( self . data ) self . master . destroy ( ) else : import os os . _exit ( 0 ) return
Exit or return to DB_Main.
Exit or return to DB_Main .
"""
        Exit or return to DB_Main.
        If going to DB_Main, make sure that we save the primer_dict in the Database.
        Make sure that we close the primer database window.
        """ #Make sure that we close the primer database window if open # Close the design_mutagenic primer window if open # Manage the data transfer - or simply exit # Check if the altered flag is set # DNA sequence is altered - we have to ask if a new PEAT_DB record should be created # Show another warning # Create a new PEAT_DB record # Only the ORF is altered, ask if we want to save #this only happens when it has no previous sequence #if self.parent.data['DBinstance']: # Record the changes in the primer database # First delete everything in the old parent version of the primer db # Now add the current primers to the parent instance of the db
self
event