Skip to content

Commit 4028320

Browse files
authored
black
1 parent c977711 commit 4028320

File tree

4 files changed

+19
-6
lines changed

4 files changed

+19
-6
lines changed

commands2/button/networkbutton.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __init__(self, *args, **kwargs) -> None:
3737

3838
if not isinstance(entry, NetworkTableEntry):
3939
raise self._type_error(entry)
40-
40+
4141
super().__init__(
4242
lambda: NetworkTables.isConnected() and entry.getBoolean(False)
4343
)

commands2/button/povbutton.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ def __init__(self, joystick: Joystick, angle: int, povNumber: int = 0) -> None:
1919
:param angle: The angle of the POV corresponding to a button press.
2020
:param povNumber: The number of the POV on the joystick.
2121
"""
22-
if not isinstance(joystick, Joystick) or not isinstance(angle, int) or not isinstance(povNumber, int):
22+
if (
23+
not isinstance(joystick, Joystick)
24+
or not isinstance(angle, int)
25+
or not isinstance(povNumber, int)
26+
):
2327
raise TypeError(
2428
"POVButton.__init__(): incompatible constructor arguments. The following argument types are supported:\n"
2529
"\t1. commands2.button.POVButton(joystick: Joystick, angle: int, povNumber: int)\n"

commands2/trigger.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ def cancelWhenActive(self, command: Command) -> None:
123123
self._trigger.cancelWhenActive(command)
124124

125125
@overload
126-
def whenActive(self, command_or_coroutine: Command, interruptible: bool = True) -> None:
126+
def whenActive(
127+
self, command_or_coroutine: Command, interruptible: bool = True
128+
) -> None:
127129
"""
128130
Binds a command to start when the trigger becomes active.
129131
@@ -196,7 +198,9 @@ def wrapper(coroutine: Coroutineable) -> None:
196198
return
197199

198200
@overload
199-
def whenInactive(self, command_or_coroutine: Command, interruptible: bool = True) -> None:
201+
def whenInactive(
202+
self, command_or_coroutine: Command, interruptible: bool = True
203+
) -> None:
200204
"""
201205
Binds a command to start when the trigger becomes inactive.
202206
@@ -347,7 +351,9 @@ def wrapper(coroutine: Coroutineable) -> None:
347351
return
348352

349353
@overload
350-
def whileActiveOnce(self, command_or_coroutine: Command, interruptible: bool = True) -> None:
354+
def whileActiveOnce(
355+
self, command_or_coroutine: Command, interruptible: bool = True
356+
) -> None:
351357
"""
352358
Binds a command to be started when the trigger becomes active, and
353359
canceled when it becomes inactive.
@@ -423,7 +429,9 @@ def wrapper(coroutine: Coroutineable) -> None:
423429
return
424430

425431
@overload
426-
def toggleWhenActive(self, command_or_coroutine: Command, interruptible: bool = True) -> None:
432+
def toggleWhenActive(
433+
self, command_or_coroutine: Command, interruptible: bool = True
434+
) -> None:
427435
"""
428436
Binds a command to start when the trigger becomes active, and be canceled
429437
when it again becomes active.

tests/test_button.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from util import Counter
55
import pytest
66

7+
78
class MyButton(commands2.button.Button):
89
def __init__(self):
910
super().__init__(self.isPressed)

0 commit comments

Comments
 (0)