Updater: Cleaning
This commit is contained in:
parent
b43feb922d
commit
ed0364eb7a
13
Updater.py
Normal file → Executable file
13
Updater.py
Normal file → Executable file
@ -1,6 +1,8 @@
|
||||
#!/usr/bin/env python
|
||||
from tkinter import *
|
||||
from tkinter import filedialog
|
||||
from tkinter.messagebox import *
|
||||
|
||||
import subprocess
|
||||
|
||||
file = None
|
||||
@ -12,15 +14,16 @@ def Install():
|
||||
|
||||
if file != None:
|
||||
subprocess.call(["python", "espota.py", "-i", ip, "-f", file])
|
||||
else:
|
||||
showerror("Error", "Select a firmware first")
|
||||
|
||||
|
||||
def askopenfile():
|
||||
global file
|
||||
filename = filedialog.askopenfile(mode='r', filetypes=[('binaries', '*.bin')])
|
||||
file = filename.name
|
||||
file = filedialog.askopenfilename(title='Select Firmware', filetypes=[('binaries', '*.bin')])
|
||||
|
||||
root = Tk()
|
||||
Ip = Text(root)
|
||||
root.title("Firmware Updater")
|
||||
|
||||
button_opt = {'fill': constants.BOTH, 'padx': 5, 'pady': 5}
|
||||
Button(root, text='Select firmware', command=askopenfile).pack(**button_opt)
|
||||
@ -30,8 +33,6 @@ 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)
|
||||
|
||||
Button(root, text = 'Install', command = Install).pack(pady=20)
|
||||
|
||||
root.mainloop()
|
Loading…
Reference in New Issue
Block a user