Skip to content

Commit c7333cc

Browse files
committed
max line length
1 parent 3002d65 commit c7333cc

File tree

3 files changed

+15
-19
lines changed

3 files changed

+15
-19
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
},
99
"pylint.enabled": false,
1010
"ruff.lint.enable": true,
11+
"ruff.lint.select": ["E501"],
1112
"python.testing.pytestArgs": [
1213
"src"
1314
],

pyproject.toml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
1-
# [tool.black]
2-
# line-length = 100
3-
4-
# [tool.isort]
5-
# profile = "black"
6-
# line_length = 100
7-
8-
# [tool.pylint.messages_control]
9-
# disable = [ "missing-class-docstring",
10-
# "consider-using-f-string",
11-
# "import-error",
12-
# "missing-function-docstring"]
131
[tool.ruff]
14-
line-length = 100
2+
line-length = 100
3+
# keep normal rules and add this extra one.
4+
lint.extend-select = ["E501"]

src/wifi_manager.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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}">&nbsp;{0}</label></p>
216+
<p><input type="radio" name="ssid" value="{0}" id="{0}">
217+
<label for="{0}">&nbsp;{0}</label></p>
214218
""".format(ssid)
215219
)
216220
self.client.sendall("""
217-
<p><label for="password">Password:&nbsp;</label><input type="password" id="password" name="password"></p>
221+
<p><label for="password">Password:&nbsp;</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

Comments
 (0)