some litle fix
This commit is contained in:
parent
86ccdbee75
commit
755876ec64
20
chaineTV.py
20
chaineTV.py
@ -1,4 +1,4 @@
|
|||||||
from tkinter import *
|
from tkinter import Label,Button,Frame,Tk,Entry,StringVar,LEFT,RIGHT
|
||||||
import json
|
import json
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
@ -6,7 +6,7 @@ import unicodedata
|
|||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
import webbrowser
|
import webbrowser
|
||||||
import urllib.request
|
import urllib.request
|
||||||
|
import re
|
||||||
|
|
||||||
class Labbelink (Label):
|
class Labbelink (Label):
|
||||||
|
|
||||||
@ -15,8 +15,8 @@ class Labbelink (Label):
|
|||||||
self.link=link
|
self.link=link
|
||||||
self.bind("<Button-1>",self._openlink)
|
self.bind("<Button-1>",self._openlink)
|
||||||
|
|
||||||
def _openlink(self,event):
|
def _openlink(self,evt):
|
||||||
webbrowser.open(self.link)
|
webbrowser.open(self.link)
|
||||||
|
|
||||||
class Interface:
|
class Interface:
|
||||||
|
|
||||||
@ -57,7 +57,6 @@ class Interface:
|
|||||||
|
|
||||||
def click(self):
|
def click(self):
|
||||||
print(self.value.get())
|
print(self.value.get())
|
||||||
labellink = Label(self.resultframe, text="")
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
link= Labbelink(self.resultframe,self.data[self.value.get()],geturlprogrammetv(self.data[self.value.get()]))
|
link= Labbelink(self.resultframe,self.data[self.value.get()],geturlprogrammetv(self.data[self.value.get()]))
|
||||||
@ -127,8 +126,8 @@ def parsechaine(file):
|
|||||||
if RepresentsInt(num):
|
if RepresentsInt(num):
|
||||||
|
|
||||||
if RepresentsInt(firstTD.find_next().string):
|
if RepresentsInt(firstTD.find_next().string):
|
||||||
#print(firstTD.find_next().find_next().text)
|
#print(firstTD.find_next().find_next().text)
|
||||||
liste_chaine[int(num)] = firstTD.find_next().find_next().text
|
liste_chaine[int(num)] = firstTD.find_next().find_next().text
|
||||||
else:
|
else:
|
||||||
#print(firstTD.find_next().string)
|
#print(firstTD.find_next().string)
|
||||||
liste_chaine[int(num)] = firstTD.find_next().text
|
liste_chaine[int(num)] = firstTD.find_next().text
|
||||||
@ -176,7 +175,7 @@ def cli(num):
|
|||||||
data = load_jsonfile(datafilepath)
|
data = load_jsonfile(datafilepath)
|
||||||
print(num)
|
print(num)
|
||||||
try:
|
try:
|
||||||
print(data[num])
|
print(data[num])
|
||||||
except KeyError:
|
except KeyError:
|
||||||
print("numero de chaine inconnue")
|
print("numero de chaine inconnue")
|
||||||
return
|
return
|
||||||
@ -202,6 +201,5 @@ if len(sys.argv) > 1:
|
|||||||
else:
|
else:
|
||||||
cli(i)
|
cli(i)
|
||||||
else:
|
else:
|
||||||
interface = Interface()
|
Interface().mainloop()
|
||||||
interface.value.set("")
|
|
||||||
interface.mainloop()
|
|
||||||
|
Loading…
Reference in New Issue
Block a user