summaryrefslogtreecommitdiff
path: root/extmod/webrepl/webrepl_setup.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2020-02-27 15:36:53 +1100
committerDamien George <damien.p.george@gmail.com>2020-02-28 10:33:03 +1100
commit69661f3343bedf86e514337cff63d96cc42f8859 (patch)
treeaf5dfb380ffdb75dda84828f63cf9d840d992f0f /extmod/webrepl/webrepl_setup.py
parent3f39d18c2b884d32f0443e2e8114ff9d7a14d718 (diff)
all: Reformat C and Python source code with tools/codeformat.py.
This is run with uncrustify 0.70.1, and black 19.10b0.
Diffstat (limited to 'extmod/webrepl/webrepl_setup.py')
-rw-r--r--extmod/webrepl/webrepl_setup.py12
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()