diff options
Diffstat (limited to 'extmod/webrepl/webrepl_setup.py')
-rw-r--r-- | extmod/webrepl/webrepl_setup.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/extmod/webrepl/webrepl_setup.py b/extmod/webrepl/webrepl_setup.py index 129313a21..ffc9c77fc 100644 --- a/extmod/webrepl/webrepl_setup.py +++ b/extmod/webrepl/webrepl_setup.py @@ -1,20 +1,24 @@ import sys -#import uos as os + +# import uos as os import os import machine RC = "./boot.py" CONFIG = "./webrepl_cfg.py" + def input_choice(prompt, choices): while 1: resp = input(prompt) if resp in choices: return resp + def getpass(prompt): return input(prompt) + def input_pass(): while 1: passwd1 = getpass("New password (4-9 chars): ") @@ -77,7 +81,9 @@ def main(): if resp == "E": if exists(CONFIG): - resp2 = input_choice("Would you like to change WebREPL password? (y/n) ", ("y", "n", "")) + resp2 = input_choice( + "Would you like to change WebREPL password? (y/n) ", ("y", "n", "") + ) else: print("To enable WebREPL, you must set password for it") resp2 = "y" @@ -87,7 +93,6 @@ def main(): with open(CONFIG, "w") as f: f.write("PASS = %r\n" % passwd) - if resp not in ("D", "E") or (resp == "D" and not status) or (resp == "E" and status): print("No further action required") sys.exit() @@ -99,4 +104,5 @@ def main(): if resp == "y": machine.reset() + main() |