Skip to content

Commit a080872

Browse files
jimmodpgeorge
authored andcommitted
top: Update Python formatting to black "2023 stable style".
See https://black.readthedocs.io/en/stable/the_black_code_style/index.html Signed-off-by: Jim Mussared <[email protected]>
1 parent c1526d2 commit a080872

File tree

20 files changed

+9
-23
lines changed

20 files changed

+9
-23
lines changed

micropython/bluetooth/aioble/aioble/client.py

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
_FLAG_NOTIFY = const(0x0010)
3535
_FLAG_INDICATE = const(0x0020)
3636

37+
3738
# Forward IRQs directly to static methods on the type that handles them and
3839
# knows how to map handles to instances. Note: We copy all uuid and data
3940
# params here for safety, but a future optimisation might be able to avoid

micropython/bluetooth/aioble/multitests/ble_write_order.py

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
CHAR_FIRST_UUID = bluetooth.UUID("00000000-1111-2222-3333-444444444444")
2222
CHAR_SECOND_UUID = bluetooth.UUID("00000000-1111-2222-3333-555555555555")
2323

24+
2425
# Acting in peripheral role.
2526
async def instance0_task():
2627
service = aioble.Service(SERVICE_UUID)

micropython/drivers/codec/wm8960/wm8960.py

-12
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,6 @@ def __setitem__(self, reg, value):
244244

245245

246246
class WM8960:
247-
248247
_bit_clock_divider_table = {
249248
2: 0,
250249
3: 1,
@@ -399,7 +398,6 @@ def __init__(
399398
self.config_data_format(sysclk, sample_rate, bits)
400399

401400
def deinit(self):
402-
403401
self.set_module(MODULE_ADC, False)
404402
self.set_module(MODULE_DAC, False)
405403
self.set_module(MODULE_VREF, False)
@@ -467,33 +465,28 @@ def set_speaker_clock(self, sysclk):
467465
)
468466

469467
def set_module(self, module, is_enabled):
470-
471468
is_enabled = 1 if is_enabled else 0
472469
regs = self.regs
473470

474471
if module == MODULE_ADC:
475-
476472
regs[_POWER1] = (
477473
_POWER1_ADCL_MASK | _POWER1_ADCR_MASK,
478474
(_POWER1_ADCL_MASK | _POWER1_ADCR_MASK) * is_enabled,
479475
)
480476

481477
elif module == MODULE_DAC:
482-
483478
regs[_POWER2] = (
484479
_POWER2_DACL_MASK | _POWER2_DACR_MASK,
485480
(_POWER2_DACL_MASK | _POWER2_DACR_MASK) * is_enabled,
486481
)
487482

488483
elif module == MODULE_VREF:
489-
490484
regs[_POWER1] = (
491485
_POWER1_VREF_MASK,
492486
(is_enabled << _POWER1_VREF_SHIFT),
493487
)
494488

495489
elif module == MODULE_LINE_IN:
496-
497490
regs[_POWER1] = (
498491
_POWER1_AINL_MASK | _POWER1_AINR_MASK,
499492
(_POWER1_AINL_MASK | _POWER1_AINR_MASK) * is_enabled,
@@ -504,36 +497,31 @@ def set_module(self, module, is_enabled):
504497
)
505498

506499
elif module == MODULE_LINE_OUT:
507-
508500
regs[_POWER2] = (
509501
_POWER2_LOUT1_MASK | _POWER2_ROUT1_MASK,
510502
(_POWER2_LOUT1_MASK | _POWER2_ROUT1_MASK) * is_enabled,
511503
)
512504

513505
elif module == MODULE_MIC_BIAS:
514-
515506
regs[_POWER1] = (
516507
_POWER1_MICB_MASK,
517508
(is_enabled << _POWER1_MICB_SHIFT),
518509
)
519510

520511
elif module == MODULE_SPEAKER:
521-
522512
regs[_POWER2] = (
523513
_POWER2_SPKL_MASK | _POWER2_SPKR_MASK,
524514
(_POWER2_SPKL_MASK | _POWER2_SPKR_MASK) * is_enabled,
525515
)
526516
regs[_CLASSD1] = 0xF7
527517

528518
elif module == MODULE_OMIX:
529-
530519
regs[_POWER3] = (
531520
_POWER3_LOMIX_MASK | _POWER3_ROMIX_MASK,
532521
(_POWER3_LOMIX_MASK | _POWER3_ROMIX_MASK) * is_enabled,
533522
)
534523

535524
elif module == MODULE_MONO_OUT:
536-
537525
regs[_MONOMIX1] = regs[_MONOMIX2] = is_enabled << 7
538526
regs[_MONO] = is_enabled << 6
539527

micropython/drivers/display/ssd1306/ssd1306.py

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
SET_VCOM_DESEL = const(0xDB)
2525
SET_CHARGE_PUMP = const(0x8D)
2626

27+
2728
# Subclassing FrameBuffer provides support for graphics primitives
2829
# http://docs.micropython.org/en/latest/pyboard/library/framebuf.html
2930
class SSD1306(framebuf.FrameBuffer):

micropython/drivers/storage/sdcard/sdcard.py

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ def init_spi(self, baudrate):
6464
self.spi.init(master, baudrate=baudrate, phase=0, polarity=0)
6565

6666
def init_card(self, baudrate):
67-
6867
# init CS pin
6968
self.cs.init(self.cs.OUT, value=1)
7069

micropython/umqtt.robust/umqtt/robust.py

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44

55
class MQTTClient(simple.MQTTClient):
6-
76
DELAY = 2
87
DEBUG = False
98

micropython/umqtt.simple/example_sub.py

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# Publish test messages e.g. with:
55
# mosquitto_pub -t foo_topic -m hello
66

7+
78
# Received messages from subscriptions will be delivered to this callback
89
def sub_cb(topic, msg):
910
print((topic, msg))

python-stdlib/contextlib/tests.py

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ def test_suppress(self):
3737

3838

3939
class TestExitStack(unittest.TestCase):
40-
4140
# @support.requires_docstrings
4241
def _test_instance_docs(self):
4342
# Issue 19330: ensure context manager instances have good docstrings

python-stdlib/copy/copy.py

+1
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ def _reconstruct(x, info, deep, memo=None):
374374

375375
del types
376376

377+
377378
# Helper for instance creation without calling __init__
378379
class _EmptyClass:
379380
pass

python-stdlib/json/json/encoder.py

-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ def _make_iterencode(
294294
str=str,
295295
tuple=tuple,
296296
):
297-
298297
if _indent is not None and not isinstance(_indent, str):
299298
_indent = " " * _indent
300299

python-stdlib/logging/examples/example_logging_2.py

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
except:
3838
logger.error("Some trouble (%s)", "expected")
3939

40+
4041
# Custom handler example
4142
class MyHandler(logging.Handler):
4243
def emit(self, record):

python-stdlib/textwrap/textwrap.py

-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@ def _wrap_chunks(self, chunks):
248248
chunks.reverse()
249249

250250
while chunks:
251-
252251
# Start the list of chunks that will make up the current line.
253252
# cur_len is just the length of all the chunks in cur_line.
254253
cur_line = []

python-stdlib/unittest/tests/test_assertions.py

-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ def testSkip(self):
112112
self.fail("this should be skipped")
113113

114114
def testAssert(self):
115-
116115
e1 = None
117116
try:
118117

unix-ffi/email.internal/email/_encoded_words.py

-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ def decode_q(encoded):
7474

7575
# dict mapping bytes to their encoded form
7676
class _QByteMap(dict):
77-
7877
safe = b"-!*+/" + ascii_letters.encode("ascii") + digits.encode("ascii")
7978

8079
def __missing__(self, key):

unix-ffi/email.internal/email/_policybase.py

-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ def _extend_docstrings(cls):
115115

116116

117117
class Policy(_PolicyBase): # , metaclass=abc.ABCMeta):
118-
119118
r"""Controls for how messages are interpreted and formatted.
120119
121120
Most of the classes and many of the methods in the email package accept

unix-ffi/email.utils/email/utils.py

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
# source with undecodable characters.
5959
_has_surrogates = re.compile("([^\ud800-\udbff]|\A)[\udc00-\udfff]([^\udc00-\udfff]|\Z)").search
6060

61+
6162
# How to deal with a string containing bytes before handing it to the
6263
# application through the 'normal' interface.
6364
def _sanitize(string):

unix-ffi/html.entities/html/entities.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2499,7 +2499,7 @@
24992499
# (or a character reference if the character is outside the Latin-1 range)
25002500
entitydefs = {}
25012501

2502-
for (name, codepoint) in name2codepoint.items():
2502+
for name, codepoint in name2codepoint.items():
25032503
codepoint2name[codepoint] = name
25042504
entitydefs[name] = chr(codepoint)
25052505

unix-ffi/http.client/http/client.py

-1
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,6 @@ def getcode(self):
740740

741741

742742
class HTTPConnection:
743-
744743
_http_vsn = 11
745744
_http_vsn_str = "HTTP/1.1"
746745

unix-ffi/machine/machine/pin.py

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33

44
class Pin(umachine.PinBase):
5-
65
IN = "in"
76
OUT = "out"
87

unix-ffi/urllib.parse/urllib/parse.py

+1
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ def _hostinfo(self):
332332
# retained since deprecating it isn't worth the hassle
333333
ResultBase = _NetlocResultMixinStr
334334

335+
335336
# Structured result objects for string data
336337
class DefragResult(_DefragResultBase, _ResultMixinStr):
337338
__slots__ = ()

0 commit comments

Comments
 (0)