Skip to content

Commit f48b3fe

Browse files
authored
Merge pull request #27 from robotpy/pure
Port Commands to Pure Python
2 parents 28428ed + 327a29e commit f48b3fe

File tree

223 files changed

+6570
-13449
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

223 files changed

+6570
-13449
lines changed

.github/workflows/dist.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,9 @@ on:
1111

1212
jobs:
1313
ci:
14-
uses: robotpy/build-actions/.github/workflows/package-ci.yml@v2023
14+
uses: robotpy/build-actions/.github/workflows/package-pure.yml@v2024-alpha
1515
with:
1616
enable_sphinx_check: false
1717
secrets:
18-
SSH_USER: ${{ secrets.SSH_USER }}
19-
SSH_KEY: ${{ secrets.SSH_KEY }}
20-
SSH_PASSPHRASE: ${{ secrets.SSH_PASSPHRASE }}
2118
META_REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
22-
RTD_TOKEN: ${{ secrets.RTD_TOKEN }}
23-
RTD_WEBHOOK: ${{ secrets.RTD_WEBHOOK }}
2419
PYPI_API_TOKEN: ${{ secrets.PYPI_PASSWORD }}

commands2/__init__.py

Lines changed: 83 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,109 @@
1-
from . import _init_impl
1+
from .button import Trigger
2+
from .command import Command, InterruptionBehavior
23

3-
from .version import version as __version__
4+
from . import cmd
45

5-
# autogenerated by 'robotpy-build create-imports commands2 commands2._impl'
6-
from ._impl import (
7-
Command,
8-
CommandBase,
9-
CommandGroupBase,
10-
CommandScheduler,
11-
ConditionalCommand,
12-
FunctionalCommand,
13-
InstantCommand,
14-
MecanumControllerCommand,
15-
NotifierCommand,
16-
PIDCommand,
17-
PIDSubsystem,
18-
ParallelCommandGroup,
19-
ParallelDeadlineGroup,
20-
ParallelRaceGroup,
21-
PerpetualCommand,
22-
PrintCommand,
23-
ProfiledPIDCommand,
24-
ProfiledPIDSubsystem,
25-
ProxyScheduleCommand,
26-
RamseteCommand,
27-
RepeatCommand,
28-
RunCommand,
29-
ScheduleCommand,
30-
SelectCommand,
31-
SequentialCommandGroup,
32-
StartEndCommand,
33-
Subsystem,
34-
SubsystemBase,
35-
Swerve2ControllerCommand,
36-
Swerve3ControllerCommand,
37-
Swerve4ControllerCommand,
38-
Swerve6ControllerCommand,
39-
TimedCommandRobot,
40-
TrapezoidProfileCommand,
41-
TrapezoidProfileCommandRadians,
42-
TrapezoidProfileSubsystem,
43-
TrapezoidProfileSubsystemRadians,
44-
Trigger,
45-
WaitCommand,
46-
WaitUntilCommand,
47-
# button,
48-
# cmd,
49-
requirementsDisjoint,
50-
)
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
24+
from .commandscheduler import CommandScheduler
25+
from .conditionalcommand import ConditionalCommand
26+
from .functionalcommand import FunctionalCommand
27+
from .instantcommand import InstantCommand
28+
from .notifiercommand import NotifierCommand
29+
from .parallelcommandgroup import ParallelCommandGroup
30+
from .paralleldeadlinegroup import ParallelDeadlineGroup
31+
from .parallelracegroup import ParallelRaceGroup
32+
from .perpetualcommand import PerpetualCommand
33+
from .printcommand import PrintCommand
34+
from .proxycommand import ProxyCommand
35+
from .proxyschedulecommand import ProxyScheduleCommand
36+
from .repeatcommand import RepeatCommand
37+
from .runcommand import RunCommand
38+
from .schedulecommand import ScheduleCommand
39+
from .selectcommand import SelectCommand
40+
from .sequentialcommandgroup import SequentialCommandGroup
41+
from .startendcommand import StartEndCommand
42+
from .subsystem import Subsystem
43+
from .timedcommandrobot import TimedCommandRobot
44+
from .waitcommand import WaitCommand
45+
from .waituntilcommand import WaitUntilCommand
46+
from .wrappercommand import WrapperCommand
5147

5248
__all__ = [
49+
"cmd",
5350
"Command",
54-
"CommandBase",
55-
"CommandGroupBase",
51+
"CommandGroup",
5652
"CommandScheduler",
5753
"ConditionalCommand",
58-
"SelectCommand",
5954
"FunctionalCommand",
55+
"IllegalCommandUse",
6056
"InstantCommand",
61-
"MecanumControllerCommand",
57+
"InterruptionBehavior",
6258
"NotifierCommand",
63-
"PIDCommand",
64-
"PIDSubsystem",
6559
"ParallelCommandGroup",
6660
"ParallelDeadlineGroup",
6761
"ParallelRaceGroup",
6862
"PerpetualCommand",
6963
"PrintCommand",
70-
"ProfiledPIDCommand",
71-
"ProfiledPIDSubsystem",
64+
"ProxyCommand",
7265
"ProxyScheduleCommand",
73-
"RamseteCommand",
7466
"RepeatCommand",
7567
"RunCommand",
7668
"ScheduleCommand",
69+
"SelectCommand",
7770
"SequentialCommandGroup",
7871
"StartEndCommand",
7972
"Subsystem",
80-
"SubsystemBase",
81-
"Swerve2ControllerCommand",
82-
"Swerve3ControllerCommand",
83-
"Swerve4ControllerCommand",
84-
"Swerve6ControllerCommand",
8573
"TimedCommandRobot",
86-
"TrapezoidProfileCommand",
87-
"TrapezoidProfileCommandRadians",
88-
"TrapezoidProfileSubsystem",
89-
"TrapezoidProfileSubsystemRadians",
90-
"Trigger",
9174
"WaitCommand",
9275
"WaitUntilCommand",
93-
# "button",
94-
# "cmd",
95-
"requirementsDisjoint",
76+
"WrapperCommand",
77+
# "none",
78+
# "runOnce",
79+
# "run",
80+
# "startEnd",
81+
# "runEnd",
82+
# "print_",
83+
# "waitSeconds",
84+
# "waitUntil",
85+
# "either",
86+
# "select",
87+
# "sequence",
88+
# "repeatingSequence",
89+
# "parallel",
90+
# "race",
91+
# "deadline",
92+
"Trigger", # was here in 2023
9693
]
94+
95+
96+
def __getattr__(attr):
97+
if attr == "SubsystemBase":
98+
import warnings
99+
100+
warnings.warn("SubsystemBase is deprecated", DeprecationWarning, stacklevel=2)
101+
return Subsystem
102+
103+
if attr == "CommandBase":
104+
import warnings
105+
106+
warnings.warn("CommandBase is deprecated", DeprecationWarning, stacklevel=2)
107+
return Command
108+
109+
raise AttributeError("module {!r} has no attribute " "{!r}".format(__name__, attr))

commands2/button/__init__.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
# autogenerated by 'robotpy-build create-imports commands2.button commands2._impl.button'
2-
from .._impl.button import (
3-
Button,
4-
CommandGenericHID,
5-
CommandJoystick,
6-
CommandPS4Controller,
7-
CommandXboxController,
8-
JoystickButton,
9-
NetworkButton,
10-
POVButton,
11-
)
1+
from .commandgenerichid import CommandGenericHID
2+
from .commandjoystick import CommandJoystick
3+
from .commandps4controller import CommandPS4Controller
4+
from .commandxboxcontroller import CommandXboxController
5+
from .joystickbutton import JoystickButton
6+
from .networkbutton import NetworkButton
7+
from .povbutton import POVButton
8+
from .trigger import Trigger
129

1310
__all__ = [
14-
"Button",
11+
"Trigger",
1512
"CommandGenericHID",
1613
"CommandJoystick",
1714
"CommandPS4Controller",

0 commit comments

Comments
 (0)