@@ -17,7 +17,8 @@ def __init__(self, ssid="WifiManager", password="wifimanager", reboot=True, debu
1717 self .wlan_sta .active (True )
1818 self .wlan_ap = network .WLAN (network .AP_IF )
1919
20- # Avoids simple mistakes with wifi ssid and password lengths, but doesn't check for forbidden or unsupported characters.
20+ # Avoids simple mistakes with wifi ssid and password lengths,
21+ # but doesn't check for forbidden or unsupported characters.
2122 if len (ssid ) > 32 :
2223 raise Exception ("The SSID cannot be longer than 32 characters." )
2324 else :
@@ -34,7 +35,8 @@ def __init__(self, ssid="WifiManager", password="wifimanager", reboot=True, debu
3435 # There is no encryption, it's just a plain text archive. Be aware of this security problem!
3536 self .wifi_credentials = "wifi.dat"
3637
37- # Prevents the device from automatically trying to connect to the last saved network without first going through the steps defined in the code.
38+ # Prevents the device from automatically trying to connect to the last saved network
39+ # without first going through the steps defined in the code.
3840 self .wlan_sta .disconnect ()
3941
4042 # Change to True if you want the device to reboot after configuration.
@@ -140,7 +142,8 @@ def web_server(self):
140142 break
141143 self .request += self .client .recv (128 )
142144 except Exception as error :
143- # It's normal to receive timeout errors in this stage, we can safely ignore them.
145+ # It's normal to receive timeout errors in this stage,
146+ # we can safely ignore them.
144147 if self .debug :
145148 print (error )
146149 pass
@@ -210,11 +213,13 @@ def handle_root(self):
210213 ssid = ssid .decode ("utf-8" )
211214 self .client .sendall (
212215 """
213- <p><input type="radio" name="ssid" value="{0}" id="{0}"><label for="{0}"> {0}</label></p>
216+ <p><input type="radio" name="ssid" value="{0}" id="{0}">
217+ <label for="{0}"> {0}</label></p>
214218 """ .format (ssid )
215219 )
216220 self .client .sendall ("""
217- <p><label for="password">Password: </label><input type="password" id="password" name="password"></p>
221+ <p><label for="password">Password: </label>
222+ <input type="password" id="password" name="password"></p>
218223 <p><input type="submit" value="Connect"></p>
219224 </form>
220225 </body>
@@ -230,7 +235,7 @@ def handle_configure(self):
230235 if len (ssid ) == 0 :
231236 self .send_response (
232237 """
233- <p>SSID must be providaded !</p>
238+ <p>SSID must be provided !</p>
234239 <p>Go back and try again!</p>
235240 """ ,
236241 400 ,
0 commit comments