Beispiel #1
0
 def checkSub(self, top, e, list):
     from gui import Gui
     if len(e[0].get()) != 0 and len(e[1].get()) != 0:
         self.conf.addToSub((e[0].get(),e[1].get()))
         Gui.addElToList(list, (e[0].get(),e[1].get()))
         Gui.destroyTop(top)
     else:
         Gui.alertErr("Error", "Both fields are obligatory", top)
Beispiel #2
0
    def fillCompField(self, e, l, list):
        from gui import Gui
        inex = self.listOfComp[list.curselection()[0]]
        Ctrl.setText(e[0], inex.getName())
        Ctrl.setText(e[1], inex.getPath()) 

        if len(inex.getOpt1()) > 0:
            for el in inex.getOpt1():
                Gui.addElToList(l[0], el)
                self.tmpOpt1.append(el)
        if len(inex.getOpt2()) > 0:
            for el in inex.getOpt2():
                Gui.addElToList(l[1], el)
                self.tmpOpt2.append(el)
Beispiel #3
0
    def updateComp(self, top, e, list, index):
        comp = Comp()
        if len(e[0].get()) != 0 and len(e[1].get()) != 0:
            from gui import Gui
            comp.setName(e[0].get())
            comp.setPath(e[1].get())
            
            for t in self.tmpOpt1:
                comp.addOpt1(t)
            for t in self.tmpOpt2:
                comp.addOpt2(t)

            self.tmpOpt1 = []
            self.tmpOpt2 = []

            self.listOfComp[index] = comp
            Gui.remFromList(list, index)        
            Gui.addElToList(list, str(comp), index)
            Gui.destroyTop(top)
Beispiel #4
0
    def checkComp(self, top, e, list):
        from gui import Gui
        comp = Comp()
        if len(e[0].get()) != 0 and len(e[1].get()) != 0:
            comp.setName(e[0].get())
            comp.setPath(e[1].get())

            for t in self.tmpOpt1:
                comp.addOpt1(t)
            for t in self.tmpOpt2:
                comp.addOpt2(t)

            self.tmpOpt1 = []
            self.tmpOpt2 = []   

            self.listOfComp.append(comp)        
            Gui.addElToList(list, str(comp))
            Gui.destroyTop(top)
        else:
            Gui.alertErr("Error", "Fill obligatory fields", top)
Beispiel #5
0
    def checkOption(self, e, l, index, root):
        from gui import Gui
        if len(e[0].get()) > 0:
            t = None
            if len(e[1].get()) > 0:
                if len(e[2].get()) > 0:
                    t = (e[0].get(), e[1].get().split(e[2].get()))
                    Gui.addElToList(l, t)
                else:
                    t = (e[0].get(), e[1].get().split(None))
                    Gui.addElToList(l, t)               
            else:
                t = (e[0].get(),[])
                Gui.addElToList(l, t)
            if index == 0:
                self.tmpOpt1.append(t)
            else:
                self.tmpOpt2.append(t)
        else:
            Gui.alertErr("Error", "Option name is obligatory", root)


        Ctrl.emptyText(e[0])
        Ctrl.emptyText(e[1])
        Ctrl.emptyText(e[2])