PEATDB/PEATApp.py
def updateLabbooksMenu(self ):
        """Add existing laboooks to tools menu"""
        import string, types

        self.labbookmenu.delete(0, self.labbookmenu.index('last'))
        self.labbookmenu.add_command(label='New Labbook', command=self.addLabbook)
        self.labbookmenu.add_command(label='Manage Labbooks', command=self.manageLabbooks)

        if not hasattr(self.DB.meta,'labbooks'):
            return
        self.labbookmenu.add_separator()
        for name in self.DB.meta.labbooks.keys():
            def func(**kwargs):
                def new():
                   self.startLabbook(**kwargs)
                return new
            self.labbookmenu.add_command(label=name, command=func(protein=name) )
        return
Add existing laboooks to tools menu
Add existing laboooks to tools menu
Add existing laboooks to tools menu
def updateLabbooksMenu(self ):
        import string, types
        self.labbookmenu.delete(0, self.labbookmenu.index('last'))
        self.labbookmenu.add_command(label='New Labbook', command=self.addLabbook)
        self.labbookmenu.add_command(label='Manage Labbooks', command=self.manageLabbooks)
        if not hasattr(self.DB.meta,'labbooks'):
            return
        self.labbookmenu.add_separator()
        for name in self.DB.meta.labbooks.keys():
            def func(**kwargs):
                def new():
                   self.startLabbook(**kwargs)
                return new
            self.labbookmenu.add_command(label=name, command=func(protein=name) )
        return
def updateLabbooksMenu ( self ) : import string , types self . labbookmenu . delete ( 0 , self . labbookmenu . index ( 'last' ) ) self . labbookmenu . add_command ( label = 'New Labbook' , command = self . addLabbook ) self . labbookmenu . add_command ( label = 'Manage Labbooks' , command = self . manageLabbooks ) if not hasattr ( self . DB . meta , 'labbooks' ) : return self . labbookmenu . add_separator ( ) for name in self . DB . meta . labbooks . keys ( ) : def func ( ** kwargs ) : def new ( ) : self . startLabbook ( ** kwargs ) return new self . labbookmenu . add_command ( label = name , command = func ( protein = name ) ) return
Add existing laboooks to tools menu
Add existing laboooks to tools menu
"""Add existing laboooks to tools menu"""
self