mirror of
https://github.com/BOSWatch/BW3-Core.git
synced 2026-04-05 14:25:45 +00:00
edit comments in plugin/module base class
This commit is contained in:
parent
7d8544123b
commit
c4fa8c4898
2 changed files with 20 additions and 20 deletions
|
|
@ -23,13 +23,13 @@ logging.debug("- %s loaded", __name__)
|
|||
class Module:
|
||||
"""!Main module class"""
|
||||
|
||||
_modulesActive = 0
|
||||
_modulesActive = []
|
||||
|
||||
def __init__(self, moduleName, config):
|
||||
"""!init preload some needed locals and then call onLoad() directly"""
|
||||
self._moduleName = moduleName
|
||||
self.config = config
|
||||
self._modulesActive += 1
|
||||
self._modulesActive.append(self)
|
||||
|
||||
# for time counting
|
||||
self._cumTime = 0
|
||||
|
|
@ -46,11 +46,11 @@ class Module:
|
|||
def __del__(self):
|
||||
"""!Destructor calls onUnload() directly"""
|
||||
logging.debug("[%s] onUnload()", self._moduleName)
|
||||
self._modulesActive -= 1
|
||||
self._modulesActive.remove(self)
|
||||
self.onUnload()
|
||||
|
||||
def _run(self, bwPacket):
|
||||
"""!start an rund of the module.
|
||||
"""!start an run of the module.
|
||||
|
||||
@param bwPacket: A BOSWatch packet instance
|
||||
@return bwPacket or False"""
|
||||
|
|
@ -84,17 +84,17 @@ class Module:
|
|||
|
||||
def onLoad(self):
|
||||
"""!Called by import of the module
|
||||
Must be inherit"""
|
||||
can be inherited"""
|
||||
pass
|
||||
|
||||
def doWork(self, bwPacket):
|
||||
"""!Called module run
|
||||
Must be inherit
|
||||
can be inherited
|
||||
|
||||
@param bwPacket: bwPacket instance"""
|
||||
logging.warning("no functionality in module %s", self._moduleName)
|
||||
|
||||
def onUnload(self):
|
||||
"""!Called by destruction of the module
|
||||
Must be inherit"""
|
||||
"""!Called on shutdown of boswatch
|
||||
can be inherited"""
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue