From fe0d5a4954f32bd88ca2383543d674395d4b314f Mon Sep 17 00:00:00 2001 From: vincent Date: Wed, 22 Aug 2018 13:06:52 +0200 Subject: [PATCH] add multi chaine to gui --- chaineTV.py | 52 +++++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/chaineTV.py b/chaineTV.py index b4cb3a6..8746567 100644 --- a/chaineTV.py +++ b/chaineTV.py @@ -102,35 +102,37 @@ class Interface: def click(self): print(self.value.get()) + Arrayvalue=self.value.get().split(" ") + for value in Arrayvalue: + try: + strlink=geturlprogrammetv(self.data[value]) + link= Labbelink(self.resultframe.interior,self.data[value],strlink) + link.pack() + self.resultframe.update() + print(self.data[value]) - 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) + emision=parse_emmission(strlink) - if emision: - if emision == "can't find show": - Label(self.resultframe.interior,text="impssible de parser cette chaine").pack() + if emision: + if emision == "can't find show": + Label(self.resultframe.interior,text="impssible de parser cette chaine").pack() + else: + image=LabelImage(self.resultframe.interior,emision['img']) + image.pack() + Labbelink(self.resultframe.interior,("emmision ce soir: "+emision["title"]),emision['href']).pack() + if len(emision['casting']) > 0: + Label(self.resultframe.interior,text="réalisateur: "+emision['casting'][0]).pack() + Label(self.resultframe.interior,text="acteur: "+str(emision['casting'][1:])).pack() + Label(self.resultframe.interior,text="synopsys: " +emision['synopsis'],wraplength=350).pack() else: - image=LabelImage(self.resultframe.interior,emision['img']) - image.pack() - Labbelink(self.resultframe.interior,("emmision ce soir: "+emision["title"]),emision['href']).pack() - if len(emision['casting']) > 0: - Label(self.resultframe.interior,text="réalisateur: "+emision['casting'][0]).pack() - Label(self.resultframe.interior,text="acteur: "+str(emision['casting'][1:])).pack() - Label(self.resultframe.interior,text="synopsys: " +emision['synopsis'],wraplength=350).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):