MCPcopy Create free account
hub / github.com/RefactoringGuru/design-patterns-python / SimpleCommand

Class SimpleCommand

src/Command/Conceptual/main.py:33–45  ·  view source on GitHub ↗

EN: Some commands can implement simple operations on their own. RU: Некоторые команды способны выполнять простые операции самостоятельно.

Source from the content-addressed store, hash-verified

31
32
33class SimpleCommand(Command):
34 """
35 EN: Some commands can implement simple operations on their own.
36
37 RU: Некоторые команды способны выполнять простые операции самостоятельно.
38 """
39
40 def __init__(self, payload: str) -> None:
41 self._payload = payload
42
43 def execute(self) -> None:
44 print(f"SimpleCommand: See, I can do simple things like printing"
45 f"({self._payload})")
46
47
48class ComplexCommand(Command):

Callers 1

main.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected