diff --git a/chaineTV.py b/chaineTV.py index 3cea000..d8b217a 100644 --- a/chaineTV.py +++ b/chaineTV.py @@ -119,27 +119,31 @@ class Interface: def click(self): print(self.value.get()) + Arrayvalue=self.value.get().split(" ") + for value in Arrayvalue: - try: - strlink=geturlprogrammetv(self.data[self.value.get()]) - link= Labbelink(self.resultframe.interior,self.data[self.value.get()],strlink) - link.pack() - self.resultframe.update() - print(self.data[self.value.get()]) - emision=parse_emmission(strlink) - if emision: - if emision == "can't find show": - Label(self.resultframe.interior,text="impssible de parser cette chaine").pack() + + try: + strlink=geturlprogrammetv(self.data[value]) + link= Labbelink(self.resultframe.interior,self.data[value],strlink) + link.pack() + self.resultframe.update() + print(self.data[value]) + emision=parse_emmission(strlink) + if emision: + if emision == "can't find show": + Label(self.resultframe.interior,text="impssible de parser cette chaine").pack() + else: + emmisionGUI(self.resultframe.interior,**emision).pack() else: - emmisionGUI(self.resultframe.interior,**emision).pack() - else: - Label(self.resultframe.interior,text="pas de connection internet impossible de determiner l'émission du soir").pack() - + Label(self.resultframe.interior,text="pas de connection internet impossible de determiner l'émission du soir").pack() + + + except KeyError: + print("numero de chaine inconnue") + unknow=Label(self.resultframe.interior, text="numero de chaine inconnue") + unknow.pack() - except KeyError: - print("numero de chaine inconnue") - unknow=Label(self.resultframe.interior, text="numero de chaine inconnue") - unknow.pack() self.value.set("") def click_reset(self):