PEATDB/Ekin/Ekin_main.py
def updateDatasetSelector(self,parent=None):
        """Updates the dataset selector to reflect current datasets"""
        if not hasattr(self, 'E'):
            return
        if parent == None:
            parent = self.dataset_menu
        if self.dataset_select_button:
            self.dataset_select_button.destroy()
        if len(self.E.datasets) == 0:
            self.currentdataset.set(None)
            self.dataset_select_button = Button(parent,text='No Data')
            self.dataset_select_button.grid(row=0,column=0,columnspan=1,padx=4,sticky='nws')
            return
        self.dataset_select_button=Menubutton(parent,
                                            textvariable=self.currentdataset,
                                            width=12,
                                            borderwidth=2, relief=GROOVE,
                                            background='#488AC7',
                                            foreground='yellow',
                                            activeforeground='red')
        self.dataset_sel_menu=Menu(self.dataset_select_button,tearoff=0)
        self.dataset_select_button['menu']=self.dataset_sel_menu

        # Add the names of all datasets
        names=self.E.datasets
        if self.sortby_var.get() == 'firstnum':
            resorted = self.sort_by_Num(names)
        else:
            names.sort()
            resorted = names
        p=0

        for keys in resorted:
            if self.sortby_var.get() == 'firstnum':
                name = keys[1]
            else:
                name = keys
            if p%30==0 and p!=0:
                self.dataset_sel_menu.add_radiobutton(label=name,
                                                  variable=self.currentdataset,
                                                  value=name,
                                                  indicatoron=0,
                                                  columnbreak=1,
                                                  command=self.updateAll)
            else:
                 self.dataset_sel_menu.add_radiobutton(label=name,
                                                  variable=self.currentdataset,
                                                  value=name,
                                                  indicatoron=0,
                                                  command=self.updateAll)

            p=p+1

        self.dataset_select_button.grid(row=0,column=0,columnspan=1,padx=4,sticky='nws')

        # Add protein name and current mode in top bar
        if self.protein!=None:
            proteinlbl=Label(parent,text=self.protein_name,fg='Blue')
            proteinlbl.grid(row=0,column=8,columnspan=1,sticky='news',padx=4,pady=2)
        if self.E.currentmode != None:
            modelbl=Label(parent,text='mode: '+self.E.currentmode,fg='Blue')
            modelbl.grid(row=0,column=6,columnspan=1,sticky='news',padx=4,pady=2)
        if self.field!=None:
            #get columnlabel
            fieldlabel = self.parent.get_field_label(self.field)
            flbl=Label(parent,text='field: '+fieldlabel,fg='Blue')
            flbl.grid(row=0,column=7,sticky='news',padx=4,pady=2)
        elif self.filename!=None:
            filenamelbl=Label(parent,text=self.filename,fg='Blue')
            filenamelbl.grid(row=0,column=8,columnspan=1,sticky='news',padx=4,pady=2)
        return
Updates the dataset selector to reflect current datasets
Updates the dataset selector to reflect current datasets
Updates the dataset selector to reflect current datasets
def updateDatasetSelector(self,parent=None):
        if not hasattr(self, 'E'):
            return
        if parent == None:
            parent = self.dataset_menu
        if self.dataset_select_button:
            self.dataset_select_button.destroy()
        if len(self.E.datasets) == 0:
            self.currentdataset.set(None)
            self.dataset_select_button = Button(parent,text='No Data')
            self.dataset_select_button.grid(row=0,column=0,columnspan=1,padx=4,sticky='nws')
            return
        self.dataset_select_button=Menubutton(parent,
                                            textvariable=self.currentdataset,
                                            width=12,
                                            borderwidth=2, relief=GROOVE,
                                            background='#488AC7',
                                            foreground='yellow',
                                            activeforeground='red')
        self.dataset_sel_menu=Menu(self.dataset_select_button,tearoff=0)
        self.dataset_select_button['menu']=self.dataset_sel_menu
        names=self.E.datasets
        if self.sortby_var.get() == 'firstnum':
            resorted = self.sort_by_Num(names)
        else:
            names.sort()
            resorted = names
        p=0
        for keys in resorted:
            if self.sortby_var.get() == 'firstnum':
                name = keys[1]
            else:
                name = keys
            if p%30==0 and p!=0:
                self.dataset_sel_menu.add_radiobutton(label=name,
                                                  variable=self.currentdataset,
                                                  value=name,
                                                  indicatoron=0,
                                                  columnbreak=1,
                                                  command=self.updateAll)
            else:
                 self.dataset_sel_menu.add_radiobutton(label=name,
                                                  variable=self.currentdataset,
                                                  value=name,
                                                  indicatoron=0,
                                                  command=self.updateAll)
            p=p+1
        self.dataset_select_button.grid(row=0,column=0,columnspan=1,padx=4,sticky='nws')
        if self.protein!=None:
            proteinlbl=Label(parent,text=self.protein_name,fg='Blue')
            proteinlbl.grid(row=0,column=8,columnspan=1,sticky='news',padx=4,pady=2)
        if self.E.currentmode != None:
            modelbl=Label(parent,text='mode: '+self.E.currentmode,fg='Blue')
            modelbl.grid(row=0,column=6,columnspan=1,sticky='news',padx=4,pady=2)
        if self.field!=None:
            fieldlabel = self.parent.get_field_label(self.field)
            flbl=Label(parent,text='field: '+fieldlabel,fg='Blue')
            flbl.grid(row=0,column=7,sticky='news',padx=4,pady=2)
        elif self.filename!=None:
            filenamelbl=Label(parent,text=self.filename,fg='Blue')
            filenamelbl.grid(row=0,column=8,columnspan=1,sticky='news',padx=4,pady=2)
        return
def updateDatasetSelector ( self , parent = None ) : if not hasattr ( self , 'E' ) : return if parent == None : parent = self . dataset_menu if self . dataset_select_button : self . dataset_select_button . destroy ( ) if len ( self . E . datasets ) == 0 : self . currentdataset . set ( None ) self . dataset_select_button = Button ( parent , text = 'No Data' ) self . dataset_select_button . grid ( row = 0 , column = 0 , columnspan = 1 , padx = 4 , sticky = 'nws' ) return self . dataset_select_button = Menubutton ( parent , textvariable = self . currentdataset , width = 12 , borderwidth = 2 , relief = GROOVE , background = '#488AC7' , foreground = 'yellow' , activeforeground = 'red' ) self . dataset_sel_menu = Menu ( self . dataset_select_button , tearoff = 0 ) self . dataset_select_button [ 'menu' ] = self . dataset_sel_menu names = self . E . datasets if self . sortby_var . get ( ) == 'firstnum' : resorted = self . sort_by_Num ( names ) else : names . sort ( ) resorted = names p = 0 for keys in resorted : if self . sortby_var . get ( ) == 'firstnum' : name = keys [ 1 ] else : name = keys if p % 30 == 0 and p != 0 : self . dataset_sel_menu . add_radiobutton ( label = name , variable = self . currentdataset , value = name , indicatoron = 0 , columnbreak = 1 , command = self . updateAll ) else : self . dataset_sel_menu . add_radiobutton ( label = name , variable = self . currentdataset , value = name , indicatoron = 0 , command = self . updateAll ) p = p + 1 self . dataset_select_button . grid ( row = 0 , column = 0 , columnspan = 1 , padx = 4 , sticky = 'nws' ) if self . protein != None : proteinlbl = Label ( parent , text = self . protein_name , fg = 'Blue' ) proteinlbl . grid ( row = 0 , column = 8 , columnspan = 1 , sticky = 'news' , padx = 4 , pady = 2 ) if self . E . currentmode != None : modelbl = Label ( parent , text = 'mode: ' + self . E . currentmode , fg = 'Blue' ) modelbl . grid ( row = 0 , column = 6 , columnspan = 1 , sticky = 'news' , padx = 4 , pady = 2 ) if self . field != None : fieldlabel = self . parent . get_field_label ( self . field ) flbl = Label ( parent , text = 'field: ' + fieldlabel , fg = 'Blue' ) flbl . grid ( row = 0 , column = 7 , sticky = 'news' , padx = 4 , pady = 2 ) elif self . filename != None : filenamelbl = Label ( parent , text = self . filename , fg = 'Blue' ) filenamelbl . grid ( row = 0 , column = 8 , columnspan = 1 , sticky = 'news' , padx = 4 , pady = 2 ) return
Updates the dataset selector to reflect current datasets
Updates the dataset selector to reflect current datasets
"""Updates the dataset selector to reflect current datasets""" # Add the names of all datasets # Add protein name and current mode in top bar #get columnlabel
self
parent