Skip to content

Commit 0dcb84a

Browse files
committed
Remove PerpetualCommand
1 parent 0d60445 commit 0dcb84a

File tree

5 files changed

+0
-95
lines changed

5 files changed

+0
-95
lines changed

commands2/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from .parallelcommandgroup import ParallelCommandGroup
1313
from .paralleldeadlinegroup import ParallelDeadlineGroup
1414
from .parallelracegroup import ParallelRaceGroup
15-
from .perpetualcommand import PerpetualCommand
1615
from .pidcommand import PIDCommand
1716
from .pidsubsystem import PIDSubsystem
1817
from .printcommand import PrintCommand
@@ -46,7 +45,6 @@
4645
"ParallelCommandGroup",
4746
"ParallelDeadlineGroup",
4847
"ParallelRaceGroup",
49-
"PerpetualCommand",
5048
"PIDCommand",
5149
"PIDSubsystem",
5250
"PrintCommand",

commands2/command.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from .sequentialcommandgroup import SequentialCommandGroup
1616
from .paralleldeadlinegroup import ParallelDeadlineGroup
1717
from .parallelcommandgroup import ParallelCommandGroup
18-
from .perpetualcommand import PerpetualCommand
1918
from .repeatcommand import RepeatCommand
2019
from .proxycommand import ProxyCommand
2120
from .conditionalcommand import ConditionalCommand
@@ -341,27 +340,6 @@ def raceWith(self, *parallel: Command) -> ParallelRaceGroup:
341340

342341
return ParallelRaceGroup(self, *parallel)
343342

344-
def perpetually(self) -> PerpetualCommand:
345-
"""
346-
Decorates this command to run perpetually, ignoring its ordinary end conditions. The decorated
347-
command can still be interrupted or canceled.
348-
349-
Note: This decorator works by adding this command to a composition. The command the
350-
decorator was called on cannot be scheduled independently or be added to a different
351-
composition (namely, decorators), unless it is manually cleared from the list of composed
352-
commands with CommandScheduler#removeComposedCommand(Command). The command composition
353-
returned from this method can be further decorated without issue.
354-
355-
:returns: the decorated command
356-
@deprecated PerpetualCommand violates the assumption that execute() doesn't get called after
357-
isFinished() returns true -- an assumption that should be valid. This was unsafe/undefined
358-
behavior from the start, and RepeatCommand provides an easy way to achieve similar end
359-
results with slightly different (and safe) semantics.
360-
"""
361-
from .perpetualcommand import PerpetualCommand
362-
363-
return PerpetualCommand(self)
364-
365343
def repeatedly(self) -> RepeatCommand:
366344
"""
367345
Decorates this command to run repeatedly, restarting it when it ends, until this command is

commands2/perpetualcommand.py

Lines changed: 0 additions & 43 deletions
This file was deleted.

tests/test_command_decorators.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,6 @@ def test_raceWith(scheduler: commands2.CommandScheduler):
127127
assert not group.isScheduled()
128128

129129

130-
def test_perpetually(scheduler: commands2.CommandScheduler):
131-
command = commands2.InstantCommand()
132-
perpetual = command.perpetually()
133-
scheduler.schedule(perpetual)
134-
scheduler.run()
135-
scheduler.run()
136-
scheduler.run()
137-
assert perpetual.isScheduled()
138-
139-
140130
@pytest.mark.skipif(IS_OLD_COMMANDS, reason="not in old commands")
141131
def test_unless(scheduler: commands2.CommandScheduler):
142132
unlessCondition = OOBoolean(True)

tests/test_perpetualcommand.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)