From 02805290b04efe278ea3aacfa7960ae155e1c936 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Mon, 25 Mar 2024 00:56:59 +0100 Subject: [PATCH] Added basic plugin class definitions --- sbapp/sideband/plugins.py | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 sbapp/sideband/plugins.py diff --git a/sbapp/sideband/plugins.py b/sbapp/sideband/plugins.py new file mode 100644 index 0000000..6775bc6 --- /dev/null +++ b/sbapp/sideband/plugins.py @@ -0,0 +1,41 @@ +class SidebandPlugin(): + pass + +class SidebandCommandPlugin(SidebandPlugin): + def __init__(self, sideband_core): + self.__sideband = sideband_core + self.__started = False + self.command_name = type(self).command_name + + def start(self): + self.__started = True + + def stop(self): + self.__started = False + + def is_running(self): + return self.__started == True + + def get_sideband(self): + return self.__sideband + + def handle_command(self, arguments): + raise NotImplementedError + +class SidebandServicePlugin(SidebandPlugin): + def __init__(self, sideband_core): + self.__sideband = sideband_core + self.__started = False + self.service_name = type(self).service_name + + def start(self): + self.__started = True + + def stop(self): + self.__started = False + + def is_running(self): + return self.__started == True + + def get_sideband(self): + return self.__sideband