Add a ugly gui for espota

This commit is contained in:
Mathieu 2016-09-21 18:44:41 +02:00
parent 738ccfd14a
commit b43feb922d
1 changed files with 37 additions and 0 deletions

37
Updater.py Normal file
View File

@ -0,0 +1,37 @@
#!/usr/bin/env python
from tkinter import *
from tkinter import filedialog
import subprocess
file = None
def Install():
ip = e.get()
print ("Installing ",file)
print ("At ip ", ip)
if file != None:
subprocess.call(["python", "espota.py", "-i", ip, "-f", file])
def askopenfile():
global file
filename = filedialog.askopenfile(mode='r', filetypes=[('binaries', '*.bin')])
file = filename.name
root = Tk()
Ip = Text(root)
button_opt = {'fill': constants.BOTH, 'padx': 5, 'pady': 5}
Button(root, text='Select firmware', command=askopenfile).pack(**button_opt)
e = Entry(root)
e.pack()
e.delete(0, END)
e.insert(0, "192.168.0.XX")
buttonInstall = Button(root, text = 'Install', command = Install)
buttonInstall.pack(pady=20, padx = 20)
root.mainloop()