amelioration mode cli
This commit is contained in:
parent
8518404590
commit
be9d434ee0
18
chaineTV.py
18
chaineTV.py
@ -110,9 +110,14 @@ def parsechaine(file):
|
|||||||
json.dump(liste_chaine, f, indent=4)
|
json.dump(liste_chaine, f, indent=4)
|
||||||
|
|
||||||
|
|
||||||
|
def cli(num):
|
||||||
|
datafilepath=os.path.dirname(os.path.realpath(__file__))+"/chaine.json"
|
||||||
|
data = load_jsonfile(datafilepath)
|
||||||
|
print(num)
|
||||||
|
try:
|
||||||
|
print(data[num])
|
||||||
|
except KeyError:
|
||||||
|
print("numero de chaine inconnue")
|
||||||
|
|
||||||
|
|
||||||
interface = Interface()
|
interface = Interface()
|
||||||
@ -124,8 +129,9 @@ else:
|
|||||||
|
|
||||||
if arg == True:
|
if arg == True:
|
||||||
for i in sys.argv[1:]:
|
for i in sys.argv[1:]:
|
||||||
interface.value.set(i)
|
if i =="update":
|
||||||
interface.click()
|
parsechaine(os.path.dirname(os.path.realpath(__file__))+"/chaine.json")
|
||||||
interface.value.set("")
|
else:
|
||||||
|
cli(i)
|
||||||
else:
|
else:
|
||||||
interface.mainloop()
|
interface.mainloop()
|
||||||
|
Loading…
Reference in New Issue
Block a user