mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11:43 +00:00
[robotpy] Mirror robotpy's commands-v2 (#8369)
Project import generated by Copybara. GitOrigin-RevId: 715c8e8372d936f447f2937aab6b1a22dc619126
This commit is contained in:
21
commandsv2/src/main/python/commands2/printcommand.py
Normal file
21
commandsv2/src/main/python/commands2/printcommand.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# validated: 2024-01-19 DS 8ac45f20bb47 PrintCommand.java
|
||||
from __future__ import annotations
|
||||
|
||||
from .instantcommand import InstantCommand
|
||||
|
||||
|
||||
class PrintCommand(InstantCommand):
|
||||
"""
|
||||
A command that prints a string when initialized.
|
||||
"""
|
||||
|
||||
def __init__(self, message: str):
|
||||
"""
|
||||
Creates a new a PrintCommand.
|
||||
|
||||
:param message: the message to print
|
||||
"""
|
||||
super().__init__(lambda: print(message))
|
||||
|
||||
def runsWhenDisabled(self) -> bool:
|
||||
return True
|
||||
Reference in New Issue
Block a user