amelioration mode cli

This commit is contained in:
vincent 2018-04-10 20:46:25 +02:00
parent 8518404590
commit be9d434ee0

View File

@ -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()