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)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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()
|
||||
@ -124,8 +129,9 @@ else:
|
||||
|
||||
if arg == True:
|
||||
for i in sys.argv[1:]:
|
||||
interface.value.set(i)
|
||||
interface.click()
|
||||
interface.value.set("")
|
||||
if i =="update":
|
||||
parsechaine(os.path.dirname(os.path.realpath(__file__))+"/chaine.json")
|
||||
else:
|
||||
cli(i)
|
||||
else:
|
||||
interface.mainloop()
|
||||
|
Loading…
Reference in New Issue
Block a user