2015-05-18 09:04:16 +02:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
# -*- coding: cp1252 -*-
|
|
|
|
|
|
|
|
|
|
import time
|
|
|
|
|
import pluginloader
|
|
|
|
|
|
2015-05-18 12:03:42 +02:00
|
|
|
import logging
|
|
|
|
|
logging.basicConfig(filename='boswatch.log',level=logging.DEBUG, format='%(asctime)s - %(levelname)s: %(message)s', datefmt='%d.%m.%Y %I:%M:%S')
|
|
|
|
|
|
|
|
|
|
#https://docs.python.org/2/howto/logging.html#logging-basic-tutorial
|
|
|
|
|
#log levels
|
|
|
|
|
#debug - debug messages only for log
|
|
|
|
|
#info - only an information
|
|
|
|
|
#warning
|
|
|
|
|
#error - normal error - program goes further
|
|
|
|
|
#exception - error handler in try:exc: into the message
|
|
|
|
|
#critical - big error, program exit
|
|
|
|
|
|
2015-05-18 09:04:16 +02:00
|
|
|
while True:
|
|
|
|
|
time.sleep(1)
|
|
|
|
|
print ("Alarm!")
|
2015-05-18 12:03:42 +02:00
|
|
|
logging.info("Alarm!")
|
2015-05-18 09:04:16 +02:00
|
|
|
for i in pluginloader.getPlugins():
|
2015-05-18 12:03:42 +02:00
|
|
|
logging.debug("Loading plugin " + i["name"])
|
2015-05-18 09:04:16 +02:00
|
|
|
plugin = pluginloader.loadPlugin(i)
|
2015-05-18 12:03:42 +02:00
|
|
|
plugin.run("zvei","","","12345","","")
|