aboutsummaryrefslogtreecommitdiff
path: root/command.py
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2023-02-07 01:26:41 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2023-02-07 01:26:41 +0100
commitc2109e5561299b2a120d1a669d58f6147ca40fb1 (patch)
tree1d8193f8765498bfbd209a4bfb228559cd994294 /command.py
downloadautomato-c2109e5561299b2a120d1a669d58f6147ca40fb1.tar.gz
first commit
Diffstat (limited to 'command.py')
-rw-r--r--command.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/command.py b/command.py
new file mode 100644
index 0000000..db0d261
--- /dev/null
+++ b/command.py
@@ -0,0 +1,15 @@
+import transport
+
+class Command:
+ def __init__(self, transport: transport.Transport):
+ raise NotImplemented
+
+ def execute(self, **kwargs):
+ raise NotImplemented
+
+class NotifyCommand(Command):
+ def __init__(self, transport: transport.SshTransport):
+ self._transport = transport
+
+ def execute(self, msg: str, **kwargs):
+ self._transport.execHandleStderror(f'notify-send "{msg}"')