esp8266/modules/webrepl_setup: Add info about allowed password length.

This patch also makes the code more concise by combining the checks for the
password length.
This commit is contained in:
Vitor Massaru Iha 2017-10-08 15:28:32 -03:00 committed by Damien George
parent b1457db002
commit 1b7d6a7951
1 changed files with 3 additions and 6 deletions

View File

@ -17,12 +17,9 @@ def getpass(prompt):
def input_pass():
while 1:
passwd1 = getpass("New password: ")
if len(passwd1) < 4:
print("Password too short")
continue
elif len(passwd1) > 9:
print("Password too long")
passwd1 = getpass("New password (4-9 chars): ")
if len(passwd1) < 4 or len(passwd1) > 9:
print("Invalid password length")
continue
passwd2 = getpass("Confirm password: ")
if passwd1 == passwd2: