Files
wehub-resource-sync 4e0f4422d0
Check Markdown links / markdown-link-check (push) Waiting to run
Pytest / test (3.11) (push) Waiting to run
Pytest / test (3.12) (push) Waiting to run
build-docs / deploy (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:25:42 +08:00

36 lines
795 B
Python

#!/usr/bin/env python3
from __future__ import annotations
import time
class InteractiveDummyCommand:
PROMPT = "(dummy) "
def start(self):
print("Started interactive dummy command")
def send(self, input: str):
print(f"Received input: {input}")
time.sleep(0.5)
def stop(self):
print("Stopped interactive dummy command")
def __call__(self):
self.start()
while True:
input = input(self.PROMPT)
cmd, _, args = input.partition(" ")
if cmd == "stop":
self.stop()
break
if cmd == "send":
self.send(args)
else:
print(f"Unknown command: {cmd}")
if __name__ == "__main__":
InteractiveDummyCommand()()