From 77cfcbc2f83146be4134a226c596563435e24afa Mon Sep 17 00:00:00 2001 From: HappyZ Date: Fri, 30 Nov 2018 10:00:07 -0600 Subject: [PATCH] bug fix --- python_api/libInteractive.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/python_api/libInteractive.py b/python_api/libInteractive.py index 4ec5606..3b60797 100644 --- a/python_api/libInteractive.py +++ b/python_api/libInteractive.py @@ -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))