mirror of
https://github.com/markqvist/Sideband.git
synced 2025-07-14 10:39:29 -04:00
Added basic plugin class definitions
This commit is contained in:
parent
301053a949
commit
02805290b0
1 changed files with 41 additions and 0 deletions
41
sbapp/sideband/plugins.py
Normal file
41
sbapp/sideband/plugins.py
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue