Skip to content

Commit f8a020d

Browse files
committed
code format and pylint
1 parent f37d405 commit f8a020d

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

adafruit_wiznet5k/adafruit_wiznet5k.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ def socket_write(self, socket_num, buffer, timeout=0):
748748
self._write_sntx_wr(socket_num, ptr)
749749

750750
cntl_byte = 0x14 + (socket_num << 5)
751-
txbuf = buffer[:ret] # <- use ret
751+
txbuf = buffer[:ret] # <- use ret
752752
self.write(dst_addr, cntl_byte, txbuf)
753753

754754
self._write_sncr(socket_num, CMD_SOCK_SEND)

examples/wiznet5k_wsgiserver_test.py

+13-14
Original file line numberDiff line numberDiff line change
@@ -20,36 +20,35 @@
2020
import busio
2121
import digitalio
2222
import neopixel
23-
import time
2423

2524
import adafruit_requests as requests
25+
from adafruit_wsgi.wsgi_app import WSGIApp
2626
from adafruit_wiznet5k.adafruit_wiznet5k import WIZNET5K
2727
import adafruit_wiznet5k.adafruit_wiznet5k_socket as socket
2828
import adafruit_wiznet5k.adafruit_wiznet5k_wsgiserver as server
29-
from adafruit_wsgi.wsgi_app import WSGIApp
3029

3130

3231
print("Wiznet5k Web Server Test")
3332

3433

35-
def get_mac(i2c):
34+
def get_mac(_i2c):
3635
"Read MAC from 24AA02E48 chip and return it"
37-
mac = bytearray(6)
38-
while not i2c.try_lock():
36+
_mac = bytearray(6)
37+
while not _i2c.try_lock():
3938
pass
40-
i2c.writeto(0x50, bytearray((0xFA,)))
41-
i2c.readfrom_into(0x50, mac, start=0, end=6)
42-
i2c.unlock()
43-
return mac
39+
_i2c.writeto(0x50, bytearray((0xFA,)))
40+
_i2c.readfrom_into(0x50, _mac, start=0, end=6)
41+
_i2c.unlock()
42+
return _mac
4443

4544

4645
def get_static_file(filename):
4746
"Static file generator"
4847
with open(filename, "rb") as f:
49-
bytes = None
50-
while bytes is None or len(bytes) == 2048:
51-
bytes = f.read(2048)
52-
yield bytes
48+
_bytes = None
49+
while _bytes is None or len(_bytes) == 2048:
50+
_bytes = f.read(2048)
51+
yield _bytes
5352

5453

5554
# Status LED
@@ -113,7 +112,7 @@ def code(request): # pylint: disable=unused-argument
113112

114113

115114
@web_app.route("/btc")
116-
def btc(request):
115+
def btc(request): # pylint: disable=unused-argument
117116
print("BTC handler")
118117
r = requests.get("http://api.coindesk.com/v1/bpi/currentprice/USD.json")
119118
result = r.text

0 commit comments

Comments
 (0)