Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "[cmd] Add ScheduleCommand decorator" (#71) #80

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions commands2/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,22 +384,6 @@ def asProxy(self) -> ProxyCommand:

return ProxyCommand(self)

def fork(self, *commands: Command) -> ProxyCommand:
"""
Decorates this command to run "forked" by wrapping it in a ScheduleCommand. Use this for
"forking off" from command compositions when the user does not wish to extend the command's
requirements to the entire command composition. Note that if run from a composition, the
composition will not know about the status of the scheduled commands, and will treat this
command as finishing instantly. Commands can be added to this and will be scheduled in order
with this command scheduled first., see the `WPILib docs <https://docs.wpilib.org/en/stable/docs/software/commandbased/command-compositions.html#scheduling-other-commands>`_ for a full explanation.

:param other: other commands to schedule along with this one. This command is scheduled first.
:returns: the decorated command
"""
from .schedulecommand import ScheduleCommand

return ScheduleCommand(self, [self] + commands)

def unless(self, condition: Callable[[], bool]) -> ConditionalCommand:
"""
Decorates this command to only run if this condition is not met. If the command is already
Expand Down
Loading