mirror of
https://github.com/BOSWatch/BW3-Core.git
synced 2026-04-05 06:15:31 +00:00
add template plugin
This commit is contained in:
parent
9c824ff862
commit
d80db0d6cc
6 changed files with 68 additions and 8 deletions
|
|
@ -51,12 +51,12 @@ class Config:
|
|||
@param sharePoint: Name of the global share point
|
||||
@return True or False"""
|
||||
try:
|
||||
bool(self._sharePoints[sharePoint])
|
||||
bool(self._sharePoints[sharePoint]) # todo not a nice method to check
|
||||
logging.error("cannot share config - name is always in use: %s", sharePoint)
|
||||
return False
|
||||
except:
|
||||
self._sharePoints[sharePoint] = self._config
|
||||
logging.debug("configuration sharePoint: %s", sharePoint)
|
||||
logging.debug("add config sharePoint: %s", sharePoint)
|
||||
return True
|
||||
|
||||
def getInt(self, section, key, sharePoint=""):
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@
|
|||
import logging
|
||||
import time
|
||||
|
||||
from boswatch.utils import paths
|
||||
from boswatch.config import Config
|
||||
|
||||
logging.debug("- %s loaded", __name__)
|
||||
|
||||
|
||||
|
|
@ -43,6 +46,10 @@ class Plugin:
|
|||
self._alarmErrorCount = 0
|
||||
self._teardownErrorCount = 0
|
||||
|
||||
if paths.FileExist(paths.PLUGIN_PATH + pluginName + "/" + pluginName + ".ini"):
|
||||
self.config = Config()
|
||||
self.config.loadConfigFile(paths.PLUGIN_PATH + pluginName + "/" + pluginName + ".ini", pluginName)
|
||||
|
||||
logging.debug("[%s] onLoad()", pluginName)
|
||||
self.onLoad()
|
||||
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ BIN_PATH = ROOT_PATH + "_bin/"
|
|||
TEST_PATH = ROOT_PATH + "test/"
|
||||
|
||||
|
||||
def ifFileExist(filePath):
|
||||
pass
|
||||
def FileExist(filePath):
|
||||
return os.path.exists(filePath)
|
||||
|
||||
|
||||
def makeDirIfNotExist(dirPath):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue