Skip to content

Commit bbbc9e4

Browse files
committed
pyproject: update black to ^23
Update for the yearly black release for 2023 and reformat code.
1 parent 969ea28 commit bbbc9e4

File tree

11 files changed

+36
-63
lines changed

11 files changed

+36
-63
lines changed

docs/_ext/availability_ext.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77

88
class Availability(Directive):
9-
109
has_content = False
1110
required_arguments = 1
1211
optional_arguments = 0

poetry.lock

Lines changed: 34 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pybricksdev/ble/lwp3/bytecodes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,6 @@ class PortInfoFormatSetupCommand(IntEnum):
977977

978978

979979
class ModeCapabilities(IntFlag):
980-
981980
OUTPUT = 1 << 0
982981
INPUT = 1 << 1
983982
LOGICAL_COMBINABLE = 1 << 2

pybricksdev/ble/lwp3/messages.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1508,7 +1508,6 @@ def __init__(
15081508
port3: Optional[PortID] = None,
15091509
feedback3: Optional[Feedback] = None,
15101510
) -> None:
1511-
15121511
length = 5
15131512

15141513
if port2 is not None:

pybricksdev/cli/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def _get_script_path(file: TextIO) -> ContextManager[PathLike]:
6262
The context manager will delete the temporary file, if applicable.
6363
"""
6464
if file is sys.stdin:
65-
6665
# Have to close the temp file so that mpy-cross can read it, so we
6766
# create our own context manager to delete the file when we are done
6867
# using it.

pybricksdev/cli/flash.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ async def reboot_official_to_bootloader(hub_kind: HubKind, device: BLEDevice) ->
167167
reboot in firmware update mode.
168168
"""
169169
async with BleakClient(device) as client:
170-
171170
# give bluetooth stack time to settle
172171
await asyncio.sleep(1)
173172

pybricksdev/connections/lego.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ async def exec_paste_mode(self, code, wait=True, print_output=True):
209209

210210
# Look for output while the program runs
211211
while not self.is_idle():
212-
213212
# Keep parsing hub data.
214213
self.parse_input()
215214

@@ -250,7 +249,6 @@ async def upload_file(self, destination, contents):
250249

251250
# Write file chunk by chunk.
252251
for data in chunk(contents, FILE_PACKET_SIZE):
253-
254252
# Send a chunk and wait for acknowledgement of receipt
255253
buffer_now = len(self.buffer)
256254
progress += self.serial.write(data)

pybricksdev/connections/pybricks.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,6 @@ async def _wait_for_user_program_stop(self):
442442
op.map(lambda s: bool(s & StatusFlag.USER_PROGRAM_RUNNING)),
443443
op.distinct_until_changed(),
444444
).subscribe(lambda s: user_program_running.put_nowait(s)):
445-
446445
# The first item in the queue is the current status. The status
447446
# could change before or after the last checksum is received,
448447
# so this could be either true or false.

pybricksdev/dfu.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ def backup_dfu(file: BinaryIO) -> None:
9595
# if libusb was not found, try using dfu-util command line tool
9696

9797
with _get_dfu_util() as dfu_util:
98-
9998
file.close()
10099

101100
# dfu-util won't overwrite existing files so we have to do that first
@@ -138,7 +137,6 @@ def restore_dfu(file: BinaryIO) -> None:
138137
# if libusb was not found, try using dfu-util command line tool
139138

140139
with _get_dfu_util() as dfu_util:
141-
142140
file.close()
143141

144142
exit(
@@ -223,7 +221,6 @@ def flash_dfu(firmware_bin: bytes, metadata: dict) -> None:
223221
# if libusb was not found, try using dfu-util command line tool
224222

225223
with _get_dfu_util() as dfu_util:
226-
227224
dev_id = _get_vid_pid(dfu_util)
228225

229226
dfu_create.build(outfile, [[target]], dev_id)

pybricksdev/flash.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ async def bootloader_request(self, request, payload=None, timeout=None):
169169
return request.parse_reply(reply)
170170

171171
async def flash(self, firmware, metadata):
172-
173172
# Firmware information
174173
firmware_io = io.BytesIO(firmware)
175174
firmware_size = len(firmware)

0 commit comments

Comments
 (0)