Skip to content

Commit cdc8ffd

Browse files
committed
Remove CommandGroup
1 parent a088f5d commit cdc8ffd

21 files changed

+18
-90
lines changed

commands2/__init__.py

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,9 @@
33

44
from . import cmd
55

6-
# from .cmd import (
7-
# deadline,
8-
# either,
9-
# none,
10-
# parallel,
11-
# print_,
12-
# race,
13-
# repeatingSequence,
14-
# run,
15-
# runEnd,
16-
# runOnce,
17-
# select,
18-
# sequence,
19-
# startEnd,
20-
# waitSeconds,
21-
# waitUntil,
22-
# )
23-
from .commandgroup import CommandGroup, IllegalCommandUse
246
from .commandscheduler import CommandScheduler
257
from .conditionalcommand import ConditionalCommand
8+
from .exceptions import IllegalCommandUse
269
from .functionalcommand import FunctionalCommand
2710
from .instantcommand import InstantCommand
2811
from .notifiercommand import NotifierCommand
@@ -53,7 +36,6 @@
5336
__all__ = [
5437
"cmd",
5538
"Command",
56-
"CommandGroup",
5739
"CommandScheduler",
5840
"ConditionalCommand",
5941
"FunctionalCommand",
@@ -82,21 +64,6 @@
8264
"WaitCommand",
8365
"WaitUntilCommand",
8466
"WrapperCommand",
85-
# "none",
86-
# "runOnce",
87-
# "run",
88-
# "startEnd",
89-
# "runEnd",
90-
# "print_",
91-
# "waitSeconds",
92-
# "waitUntil",
93-
# "either",
94-
# "select",
95-
# "sequence",
96-
# "repeatingSequence",
97-
# "parallel",
98-
# "race",
99-
# "deadline",
10067
"Trigger", # was here in 2023
10168
]
10269

commands2/commandgroup.py

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

commands2/commandscheduler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from wpilib.event import EventLoop
99

1010
from .command import Command, InterruptionBehavior
11-
from .commandgroup import *
11+
from .exceptions import IllegalCommandUse
1212
from .subsystem import Subsystem
1313

1414

commands2/conditionalcommand.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from typing import Callable
44

55
from .command import Command
6-
from .commandgroup import *
76
from .commandscheduler import CommandScheduler
87

98

commands2/exceptions.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class IllegalCommandUse(Exception):
2+
"""
3+
This exception is raised when a command is used in a way that it shouldn't be.
4+
5+
You shouldn't try to catch this exception, if it occurs it means your code is
6+
doing something it probably shouldn't be doing
7+
"""

commands2/functionalcommand.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from typing import Any, Callable
44

55
from .command import Command
6-
from .commandgroup import *
76
from .subsystem import Subsystem
87

98

commands2/notifiercommand.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from wpilib import Notifier
66

77
from .command import Command
8-
from .commandgroup import *
98
from .subsystem import Subsystem
109

1110

commands2/parallelcommandgroup.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22

33
from typing import Dict
44

5-
from commands2.command import Command, InterruptionBehavior
6-
75
from .command import Command, InterruptionBehavior
8-
from .commandgroup import *
96
from .commandscheduler import CommandScheduler
7+
from .exceptions import IllegalCommandUse
108
from .util import flatten_args_commands
119

1210

13-
class ParallelCommandGroup(CommandGroup):
11+
class ParallelCommandGroup(Command):
1412
"""
1513
A command composition that runs a set of commands in parallel, ending when the last command ends.
1614

commands2/paralleldeadlinegroup.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22

33
from typing import Dict
44

5-
from commands2.command import Command, InterruptionBehavior
6-
75
from .command import Command, InterruptionBehavior
8-
from .commandgroup import *
96
from .commandscheduler import CommandScheduler
7+
from .exceptions import IllegalCommandUse
108
from .util import flatten_args_commands
119

1210

13-
class ParallelDeadlineGroup(CommandGroup):
11+
class ParallelDeadlineGroup(Command):
1412
"""
1513
A command composition that runs one of a selection of commands, either using a selector and a key
1614
to command mapping, or a supplier that returns the command directly at runtime.

commands2/parallelracegroup.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@
22

33
from typing import Set
44

5-
from commands2.command import Command, InterruptionBehavior
6-
75
from .command import Command, InterruptionBehavior
8-
from .commandgroup import *
96
from .commandscheduler import CommandScheduler
7+
from .exceptions import IllegalCommandUse
108
from .util import flatten_args_commands
119

1210

13-
class ParallelRaceGroup(CommandGroup):
11+
class ParallelRaceGroup(Command):
1412
"""
1513
A composition that runs a set of commands in parallel, ending when any one of the commands ends
1614
and interrupting all the others.

0 commit comments

Comments
 (0)