Merge branch 'develop' into patch-1

This commit is contained in:
Bastian Schroll 2024-01-08 08:52:19 +01:00 committed by GitHub
commit 37a1d0835d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 327 additions and 327 deletions

View file

@ -1,6 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""!
r"""!
____ ____ ______ __ __ __ _____
/ __ )/ __ \/ ___/ | / /___ _/ /______/ /_ |__ /
/ __ / / / /\__ \| | /| / / __ `/ __/ ___/ __ \ /_ <
@ -26,19 +26,19 @@ logging.debug("- %s loaded", __name__)
class BoswatchModule(ModuleBase):
"""!Adds descriptions to bwPackets"""
r"""!Adds descriptions to bwPackets"""
def __init__(self, config):
"""!Do not change anything here!"""
r"""!Do not change anything here!"""
super().__init__(__name__, config) # you can access the config class on 'self.config'
def onLoad(self):
"""!Called by import of the plugin"""
r"""!Called by import of the plugin"""
for descriptor in self.config:
if descriptor.get("wildcard", default=None):
self.registerWildcard(descriptor.get("wildcard"), descriptor.get("descrField"))
def doWork(self, bwPacket):
"""!start an run of the module.
r"""!start an run of the module.
@param bwPacket: A BOSWatch packet instance"""
for descriptor in self.config:
@ -54,5 +54,5 @@ class BoswatchModule(ModuleBase):
return bwPacket
def onUnload(self):
"""!Called by destruction of the plugin"""
r"""!Called by destruction of the plugin"""
pass

View file

@ -1,6 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""!
r"""!
____ ____ ______ __ __ __ _____
/ __ )/ __ \/ ___/ | / /___ _/ /______/ /_ |__ /
/ __ / / / /\__ \| | /| / / __ `/ __/ ___/ __ \ /_ <
@ -26,21 +26,21 @@ logging.debug("- %s loaded", __name__)
class BoswatchModule(ModuleBase):
"""!Description of the Module"""
r"""!Description of the Module"""
def __init__(self, config):
"""!Do not change anything here!"""
r"""!Do not change anything here!"""
super().__init__(__name__, config) # you can access the config class on 'self.config'
self._filterLists = {}
logging.debug("Configured ignoreTime: %d", self.config.get("ignoreTime", default=10))
logging.debug("Configured maxEntry: %d", self.config.get("maxEntry", default=10))
def onLoad(self):
"""!Called by import of the plugin
r"""!Called by import of the plugin
Remove if not implemented"""
pass
def doWork(self, bwPacket):
"""!start an run of the module.
r"""!start an run of the module.
@param bwPacket: A BOSWatch packet instance"""
if bwPacket.get("mode") == "fms":
@ -62,7 +62,7 @@ class BoswatchModule(ModuleBase):
return self._check(bwPacket, filterFields)
def onUnload(self):
"""!Called by destruction of the plugin
r"""!Called by destruction of the plugin
Remove if not implemented"""
pass

View file

@ -1,6 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""!
r"""!
____ ____ ______ __ __ __ _____
/ __ )/ __ \/ ___/ | / /___ _/ /______/ /_ |__ /
/ __ / / / /\__ \| | /| / / __ `/ __/ ___/ __ \ /_ <
@ -26,17 +26,17 @@ logging.debug("- %s loaded", __name__)
class BoswatchModule(ModuleBase):
"""!Filter of specific bwPacket mode"""
r"""!Filter of specific bwPacket mode"""
def __init__(self, config):
"""!Do not change anything here!"""
r"""!Do not change anything here!"""
super().__init__(__name__, config) # you can access the config class on 'self.config'
def onLoad(self):
"""!Called by import of the plugin"""
r"""!Called by import of the plugin"""
pass
def doWork(self, bwPacket):
"""!start an run of the module.
r"""!start an run of the module.
@param bwPacket: A BOSWatch packet instance"""
@ -48,5 +48,5 @@ class BoswatchModule(ModuleBase):
return False
def onUnload(self):
"""!Called by destruction of the plugin"""
r"""!Called by destruction of the plugin"""
pass

View file

@ -1,6 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""!
r"""!
____ ____ ______ __ __ __ _____
/ __ )/ __ \/ ___/ | / /___ _/ /______/ /_ |__ /
/ __ / / / /\__ \| | /| / / __ `/ __/ ___/ __ \ /_ <
@ -26,17 +26,17 @@ logging.debug("- %s loaded", __name__)
class BoswatchModule(ModuleBase):
"""!Regex based filter mechanism"""
r"""!Regex based filter mechanism"""
def __init__(self, config):
"""!Do not change anything here!"""
r"""!Do not change anything here!"""
super().__init__(__name__, config) # you can access the config class on 'self.config'
def onLoad(self):
"""!Called by import of the plugin"""
r"""!Called by import of the plugin"""
pass
def doWork(self, bwPacket):
"""!start an run of the module.
r"""!start an run of the module.
@param bwPacket: A BOSWatch packet instance"""
for regexFilter in self.config:
@ -61,5 +61,5 @@ class BoswatchModule(ModuleBase):
return False # False -> Router will stop further processing
def onUnload(self):
"""!Called by destruction of the plugin"""
r"""!Called by destruction of the plugin"""
pass

View file

@ -1,6 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""!
r"""!
____ ____ ______ __ __ __ _____
/ __ )/ __ \/ ___/ | / /___ _/ /______/ /_ |__ /
/ __ / / / /\__ \| | /| / / __ `/ __/ ___/ __ \ /_ <
@ -27,13 +27,13 @@ logging.debug("- %s loaded", __name__)
class BoswatchModule(ModuleBase):
"""!Description of the Module"""
r"""!Description of the Module"""
def __init__(self, config):
"""!Do not change anything here!"""
r"""!Do not change anything here!"""
super().__init__(__name__, config) # you can access the config class on 'self.config'
def doWork(self, bwPacket):
"""!start an run of the module.
r"""!start an run of the module.
@param bwPacket: A BOSWatch packet instance"""
if bwPacket.get("mode") == "pocsag":
@ -42,7 +42,7 @@ class BoswatchModule(ModuleBase):
return bwPacket
def geocode(self, bwPacket):
"""!find address in message and get latitude and longitude
r"""!find address in message and get latitude and longitude
@param bwPacket: A BOSWatch packet instance"""
try:

View file

@ -1,6 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""!
r"""!
____ ____ ______ __ __ __ _____
/ __ )/ __ \/ ___/ | / /___ _/ /______/ /_ |__ /
/ __ / / / /\__ \| | /| / / __ `/ __/ ___/ __ \ /_ <
@ -24,12 +24,12 @@ logging.debug("- %s loaded", __name__)
class ModuleBase(ABC):
"""!Main module class"""
r"""!Main module class"""
_modulesActive = []
def __init__(self, moduleName, config):
"""!init preload some needed locals and then call onLoad() directly"""
r"""!init preload some needed locals and then call onLoad() directly"""
self._moduleName = moduleName
self.config = config
self._modulesActive.append(self)
@ -46,13 +46,13 @@ class ModuleBase(ABC):
self.onLoad()
def _cleanup(self):
"""!Cleanup routine calls onUnload() directly"""
r"""!Cleanup routine calls onUnload() directly"""
logging.debug("[%s] onUnload()", self._moduleName)
self._modulesActive.remove(self)
self.onUnload()
def _run(self, bwPacket):
"""!start an run of the module.
r"""!start an run of the module.
@param bwPacket: A BOSWatch packet instance
@return bwPacket or False"""
@ -75,7 +75,7 @@ class ModuleBase(ABC):
return bwPacket
def _getStatistics(self):
"""!Returns statistical information's from last module run
r"""!Returns statistical information's from last module run
@return Statistics as pyton dict"""
stats = {"type": "module",
@ -86,25 +86,25 @@ class ModuleBase(ABC):
return stats
def onLoad(self):
"""!Called by import of the module
r"""!Called by import of the module
can be inherited"""
pass
def doWork(self, bwPacket):
"""!Called module run
r"""!Called module run
can be inherited
@param bwPacket: bwPacket instance"""
logging.warning("no functionality in module %s", self._moduleName)
def onUnload(self):
"""!Called on shutdown of boswatch
r"""!Called on shutdown of boswatch
can be inherited"""
pass
@staticmethod
def registerWildcard(newWildcard, bwPacketField):
"""!Register a new wildcard
r"""!Register a new wildcard
@param newWildcard: wildcard where parser searching for
@param bwPacketField: field from bwPacket where holds replacement data"""

View file

@ -1,6 +1,6 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""!
r"""!
____ ____ ______ __ __ __ _____
/ __ )/ __ \/ ___/ | / /___ _/ /______/ /_ |__ /
/ __ / / / /\__ \| | /| / / __ `/ __/ ___/ __ \ /_ <
@ -26,18 +26,18 @@ logging.debug("- %s loaded", __name__)
class BoswatchModule(ModuleBase):
"""!Description of the Module"""
r"""!Description of the Module"""
def __init__(self, config):
"""!Do not change anything here!"""
r"""!Do not change anything here!"""
super().__init__(__name__, config) # you can access the config class on 'self.config'
def onLoad(self):
"""!Called by import of the plugin
r"""!Called by import of the plugin
Remove if not implemented"""
pass
def doWork(self, bwPacket):
"""!start an run of the module.
r"""!start an run of the module.
@param bwPacket: A BOSWatch packet instance"""
if bwPacket.get("mode") == "fms":
@ -52,6 +52,6 @@ class BoswatchModule(ModuleBase):
return bwPacket
def onUnload(self):
"""!Called by destruction of the plugin
r"""!Called by destruction of the plugin
Remove if not implemented"""
pass