Skip to content

Commit 39d6675

Browse files
committed
fix more linting issues
1 parent 87ce5bc commit 39d6675

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

pybricksdev/cli/__init__.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ def is_pybricks_usb(dev):
237237
"Recompile and Run",
238238
"Recompile and Download",
239239
"Exit",
240-
]
240+
]
241241
while True:
242242
try:
243243
response = await hub.race_user_program_start(
@@ -250,8 +250,8 @@ def is_pybricks_usb(dev):
250250

251251
async def reconnect_hub():
252252
if await questionary.confirm(
253-
"\nThe hub has been disconnected. Would you like to re-connect?"
254-
).ask_async():
253+
"\nThe hub has been disconnected. Would you like to re-connect?"
254+
).ask_async():
255255
if args.conntype == "ble":
256256
print(
257257
f"Searching for {args.name or 'any hub with Pybricks service'}..."
@@ -273,15 +273,17 @@ async def reconnect_hub():
273273
else:
274274
exit()
275275

276-
if (hub.status_observable.value
276+
if (
277+
hub.status_observable.value
277278
& StatusFlag.POWER_BUTTON_PRESSED
278279
):
279280
try:
280281
await hub._wait_for_user_program_stop(2.1)
281282
continue
282283

283284
except RuntimeError as e:
284-
if (hub.connection_state_observable.value
285+
if (
286+
hub.connection_state_observable.value
285287
== ConnectionState.DISCONNECTED
286288
):
287289
hub = await reconnect_hub()
@@ -290,7 +292,8 @@ async def reconnect_hub():
290292
else:
291293
raise e
292294

293-
elif (hub.connection_state_observable.value
295+
elif (
296+
hub.connection_state_observable.value
294297
== ConnectionState.DISCONNECTED
295298
):
296299
# let terminal cool off before making a new prompt

pybricksdev/connections/pybricks.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ def handle_power_button_press(status: StatusFlag):
715715
power_button_press_event.set()
716716

717717
with self.status_observable.subscribe(
718-
handle_power_button_press
718+
handle_power_button_press
719719
) and self.connection_state_observable.subscribe(handle_disconnect):
720720
done, pending = await asyncio.wait(
721721
{awaitable_task, power_button_press_task, disconnect_task},
@@ -748,7 +748,8 @@ async def _wait_for_user_program_stop(self, program_start_timeout=1):
748748
# for it to start
749749
try:
750750
await asyncio.wait_for(
751-
self.race_disconnect(user_program_running.get()), program_start_timeout
751+
self.race_disconnect(user_program_running.get()),
752+
program_start_timeout
752753
)
753754
except asyncio.TimeoutError:
754755
# if it doesn't start, assume it was a very short lived

0 commit comments

Comments
 (0)