This commit is contained in:
HappyZ 2018-11-30 10:00:07 -06:00
parent 9be133e4db
commit 77cfcbc2f8
1 changed files with 6 additions and 1 deletions

View File

@ -18,10 +18,15 @@ def update_firmware(dpt):
'Please make sure you have charged your battery before this action.')
try:
resp = input('>>> Please enter the pkg file path: ')
while resp[-1] == ' ': # remove extra spaces
resp = resp[:-1]
if not os.path.isfile(resp):
dpt.err_print('File `{}` does not exist!'.format(resp))
return False
resp2 = input('>>> Pleae confirm {} is the pkg file to use [yes/no]: ')
resp2 = input(
'>>> Pleae confirm {} is the pkg file to use [yes/no]: '
.format(resp)
)
if resp2 == 'yes':
if not dpt.update_firmware(open(resp, 'rb')):
dpt.err_print('Failed to upload pkg {}'.format(resp))