mirror of
https://github.com/BOSWatch/BW3-Core.git
synced 2025-12-06 07:12:04 +01:00
add ABC
This commit is contained in:
parent
e61ffb4b5b
commit
c7d7231959
|
|
@ -17,11 +17,12 @@
|
||||||
import time
|
import time
|
||||||
import logging
|
import logging
|
||||||
import threading
|
import threading
|
||||||
|
from abc import ABC, abstractmethod
|
||||||
|
|
||||||
logging.debug("- %s loaded", __name__)
|
logging.debug("- %s loaded", __name__)
|
||||||
|
|
||||||
|
|
||||||
class InputBase:
|
class InputBase(ABC):
|
||||||
"""!Base class for handling inout sources"""
|
"""!Base class for handling inout sources"""
|
||||||
|
|
||||||
def __init__(self, inputQueue, inputConfig, decoderConfig):
|
def __init__(self, inputQueue, inputConfig, decoderConfig):
|
||||||
|
|
@ -45,10 +46,9 @@ class InputBase:
|
||||||
self._inputThread.daemon = True
|
self._inputThread.daemon = True
|
||||||
self._inputThread.start()
|
self._inputThread.start()
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
def _runThread(self, dataQueue, sdrConfig, decoderConfig):
|
def _runThread(self, dataQueue, sdrConfig, decoderConfig):
|
||||||
"""!Thread routine of the input source has to be inherit"""
|
"""!Thread routine of the input source has to be inherit"""
|
||||||
logging.fatal("input thread routine not implemented")
|
|
||||||
exit(1)
|
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
"""!Stop the input source thread"""
|
"""!Stop the input source thread"""
|
||||||
|
|
|
||||||
|
|
@ -16,13 +16,14 @@
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
|
from abc import ABC, abstractmethod
|
||||||
|
|
||||||
from boswatch import wildcard
|
from boswatch import wildcard
|
||||||
|
|
||||||
logging.debug("- %s loaded", __name__)
|
logging.debug("- %s loaded", __name__)
|
||||||
|
|
||||||
|
|
||||||
class ModuleBase:
|
class ModuleBase(ABC):
|
||||||
"""!Main module class"""
|
"""!Main module class"""
|
||||||
|
|
||||||
_modulesActive = []
|
_modulesActive = []
|
||||||
|
|
|
||||||
|
|
@ -16,13 +16,14 @@
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
|
from abc import ABC, abstractmethod
|
||||||
|
|
||||||
from boswatch import wildcard
|
from boswatch import wildcard
|
||||||
|
|
||||||
logging.debug("- %s loaded", __name__)
|
logging.debug("- %s loaded", __name__)
|
||||||
|
|
||||||
|
|
||||||
class PluginBase:
|
class PluginBase(ABC):
|
||||||
"""!Main plugin class"""
|
"""!Main plugin class"""
|
||||||
|
|
||||||
_pluginsActive = []
|
_pluginsActive = []
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue