From 96b2e3cf20f331cc3cc96d785c6bd1e210deaac1 Mon Sep 17 00:00:00 2001 From: vincent Date: Wed, 22 Aug 2018 14:23:19 +0200 Subject: [PATCH] finish lclass emmissionGUi --- chaineTV.py | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/chaineTV.py b/chaineTV.py index 7380591..3cea000 100644 --- a/chaineTV.py +++ b/chaineTV.py @@ -64,9 +64,21 @@ class ScrollableCanvas(Frame): # update the inner frame's width to fill the canvas canvas.itemconfigure(interior_id, width=canvas.winfo_width()) canvas.bind('', _configure_canvas) -class emmisionGUI(frame): - def __init__(parent,**kwarg): - Frame.__init__(parent) + +class emmisionGUI(Frame): + def __init__(self,parent,**kwarg): + Frame.__init__(self,parent) + self.image=LabelImage(self,kwarg['img']) + self.image.pack() + self.LabelTitle=Labbelink(self,("emmision ce soir: "+kwarg["title"]),kwarg['href']) + self.LabelTitle.pack() + if len(kwarg['casting']) > 0: + self.LabelReal=Label(self,text="réalisateur: "+kwarg['casting'][0]) + self.LabelReal.pack() + self.labelCasting=Label(self,text="acteur: "+str(kwarg['casting'][1:])) + self.labelCasting.pack() + self.LabelSynopsys=Label(self,text="synopsys: " +kwarg['synopsis'],wraplength=350) + self.LabelSynopsys.pack() class Interface: @@ -114,20 +126,12 @@ class Interface: 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() 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() + emmisionGUI(self.resultframe.interior,**emision).pack() else: Label(self.resultframe.interior,text="pas de connection internet impossible de determiner l'émission du soir").pack()