Skip to content

Commit f2cae93

Browse files
committed
3.7 support
1 parent ffbeeca commit f2cae93

File tree

2 files changed

+11
-27
lines changed

2 files changed

+11
-27
lines changed

commands2/coroutinecommand.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ def commandify(coroutine: Coroutineable, /) -> Callable[..., CoroutineCommand]:
116116

117117
def commandify(
118118
coroutine: Optional[Coroutineable] = None,
119-
/,
120119
*,
121120
requirements: Optional[List[Subsystem]] = None,
122121
runs_when_disabled: bool = False,

commands2/trigger.py

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def debounce(self, debounceTime: float, type: Debouncer.DebounceType) -> "Trigge
110110
111111
:returns: The debounced trigger.
112112
"""
113-
return Trigger(_Trigger.debounce(debounceTime, type))
113+
return Trigger(self._trigger.debounce(debounceTime, type))
114114

115115
def cancelWhenActive(self, command: Command) -> None:
116116
"""
@@ -123,7 +123,7 @@ def cancelWhenActive(self, command: Command) -> None:
123123
self._trigger.cancelWhenActive(command)
124124

125125
@overload
126-
def whenActive(self, command: Command, /, interruptible: bool = True) -> None:
126+
def whenActive(self, command_or_coroutine: Command, interruptible: bool = True) -> None:
127127
"""
128128
Binds a command to start when the trigger becomes active.
129129
@@ -134,8 +134,7 @@ def whenActive(self, command: Command, /, interruptible: bool = True) -> None:
134134
@overload
135135
def whenActive(
136136
self,
137-
coroutine: Union[Coroutine, Coroutineable],
138-
/,
137+
command_or_coroutine: Union[Coroutine, Coroutineable],
139138
*,
140139
interruptible: bool = True,
141140
requirements: Optional[List[Subsystem]] = None,
@@ -153,7 +152,6 @@ def whenActive(
153152
@overload
154153
def whenActive(
155154
self,
156-
/,
157155
*,
158156
interruptible: bool = True,
159157
requirements: Optional[List[Subsystem]] = None,
@@ -171,7 +169,6 @@ def whenActive(
171169
def whenActive(
172170
self,
173171
command_or_coroutine: Optional[Union[Command, Coroutine, Coroutineable]] = None,
174-
/,
175172
interruptible: bool = True,
176173
requirements: Optional[List[Subsystem]] = None,
177174
runs_when_disabled: bool = False,
@@ -199,7 +196,7 @@ def wrapper(coroutine: Coroutineable) -> None:
199196
return
200197

201198
@overload
202-
def whenInactive(self, command: Command, /, interruptible: bool = True) -> None:
199+
def whenInactive(self, command_or_coroutine: Command, interruptible: bool = True) -> None:
203200
"""
204201
Binds a command to start when the trigger becomes inactive.
205202
@@ -210,8 +207,7 @@ def whenInactive(self, command: Command, /, interruptible: bool = True) -> None:
210207
@overload
211208
def whenInactive(
212209
self,
213-
coroutine: Union[Coroutine, Coroutineable],
214-
/,
210+
command_or_coroutine: Union[Coroutine, Coroutineable],
215211
*,
216212
interruptible: bool = True,
217213
requirements: Optional[List[Subsystem]] = None,
@@ -229,7 +225,6 @@ def whenInactive(
229225
@overload
230226
def whenInactive(
231227
self,
232-
/,
233228
*,
234229
interruptible: bool = True,
235230
requirements: Optional[List[Subsystem]] = None,
@@ -247,7 +242,6 @@ def whenInactive(
247242
def whenInactive(
248243
self,
249244
command_or_coroutine: Optional[Union[Command, Coroutine, Coroutineable]] = None,
250-
/,
251245
interruptible: bool = True,
252246
requirements: Optional[List[Subsystem]] = None,
253247
runs_when_disabled: bool = False,
@@ -276,7 +270,7 @@ def wrapper(coroutine: Coroutineable) -> None:
276270

277271
@overload
278272
def whileActiveContinous(
279-
self, command: Command, /, interruptible: bool = True
273+
self, command_or_coroutine: Command, interruptible: bool = True
280274
) -> None:
281275
"""
282276
Binds a command to be started repeatedly while the trigger is active, and
@@ -289,8 +283,7 @@ def whileActiveContinous(
289283
@overload
290284
def whileActiveContinous(
291285
self,
292-
coroutine: Union[Coroutine, Coroutineable],
293-
/,
286+
command_or_coroutine: Union[Coroutine, Coroutineable],
294287
*,
295288
interruptible: bool = True,
296289
requirements: Optional[List[Subsystem]] = None,
@@ -309,7 +302,6 @@ def whileActiveContinous(
309302
@overload
310303
def whileActiveContinous(
311304
self,
312-
/,
313305
*,
314306
interruptible: bool = True,
315307
requirements: Optional[List[Subsystem]] = None,
@@ -328,7 +320,6 @@ def whileActiveContinous(
328320
def whileActiveContinous(
329321
self,
330322
command_or_coroutine: Optional[Union[Command, Coroutine, Coroutineable]] = None,
331-
/,
332323
interruptible: bool = True,
333324
requirements: Optional[List[Subsystem]] = None,
334325
runs_when_disabled: bool = False,
@@ -356,7 +347,7 @@ def wrapper(coroutine: Coroutineable) -> None:
356347
return
357348

358349
@overload
359-
def whileActiveOnce(self, command: Command, /, interruptible: bool = True) -> None:
350+
def whileActiveOnce(self, command_or_coroutine: Command, interruptible: bool = True) -> None:
360351
"""
361352
Binds a command to be started when the trigger becomes active, and
362353
canceled when it becomes inactive.
@@ -368,8 +359,7 @@ def whileActiveOnce(self, command: Command, /, interruptible: bool = True) -> No
368359
@overload
369360
def whileActiveOnce(
370361
self,
371-
coroutine: Union[Coroutine, Coroutineable],
372-
/,
362+
command_or_coroutine: Union[Coroutine, Coroutineable],
373363
*,
374364
interruptible: bool = True,
375365
requirements: Optional[List[Subsystem]] = None,
@@ -388,7 +378,6 @@ def whileActiveOnce(
388378
@overload
389379
def whileActiveOnce(
390380
self,
391-
/,
392381
*,
393382
interruptible: bool = True,
394383
requirements: Optional[List[Subsystem]] = None,
@@ -407,7 +396,6 @@ def whileActiveOnce(
407396
def whileActiveOnce(
408397
self,
409398
command_or_coroutine: Optional[Union[Command, Coroutine, Coroutineable]] = None,
410-
/,
411399
interruptible: bool = True,
412400
requirements: Optional[List[Subsystem]] = None,
413401
runs_when_disabled: bool = False,
@@ -435,7 +423,7 @@ def wrapper(coroutine: Coroutineable) -> None:
435423
return
436424

437425
@overload
438-
def toggleWhenActive(self, command: Command, /, interruptible: bool = True) -> None:
426+
def toggleWhenActive(self, command_or_coroutine: Command, interruptible: bool = True) -> None:
439427
"""
440428
Binds a command to start when the trigger becomes active, and be canceled
441429
when it again becomes active.
@@ -448,8 +436,7 @@ def toggleWhenActive(self, command: Command, /, interruptible: bool = True) -> N
448436
@overload
449437
def toggleWhenActive(
450438
self,
451-
coroutine: Union[Coroutine, Coroutineable],
452-
/,
439+
command_or_coroutine: Union[Coroutine, Coroutineable],
453440
*,
454441
interruptible: bool = True,
455442
requirements: Optional[List[Subsystem]] = None,
@@ -468,7 +455,6 @@ def toggleWhenActive(
468455
@overload
469456
def toggleWhenActive(
470457
self,
471-
/,
472458
*,
473459
interruptible: bool = True,
474460
requirements: Optional[List[Subsystem]] = None,
@@ -487,7 +473,6 @@ def toggleWhenActive(
487473
def toggleWhenActive(
488474
self,
489475
command_or_coroutine: Optional[Union[Command, Coroutine, Coroutineable]] = None,
490-
/,
491476
interruptible: bool = True,
492477
requirements: Optional[List[Subsystem]] = None,
493478
runs_when_disabled: bool = False,

0 commit comments

Comments
 (0)