From 947bc9417cfe54c72fa1cf99450b8a783dbd1106 Mon Sep 17 00:00:00 2001 From: Schrolli Date: Mon, 18 May 2015 12:03:42 +0200 Subject: [PATCH 01/12] simple logging and data output with plugin --- plugin_test/boswatch.log | 43 ++++++++++++++++++++++++ plugin_test/plugin_test.py | 17 ++++++++-- plugin_test/plugins/http/__init__.py | 2 -- plugin_test/plugins/interface.txt | 26 ++++++++++++++ plugin_test/plugins/mysql/__init__.py | 2 -- plugin_test/plugins/template/__init__.py | 11 ++++-- 6 files changed, 93 insertions(+), 8 deletions(-) create mode 100644 plugin_test/boswatch.log delete mode 100644 plugin_test/plugins/http/__init__.py create mode 100644 plugin_test/plugins/interface.txt delete mode 100644 plugin_test/plugins/mysql/__init__.py diff --git a/plugin_test/boswatch.log b/plugin_test/boswatch.log new file mode 100644 index 0000000..dc860c0 --- /dev/null +++ b/plugin_test/boswatch.log @@ -0,0 +1,43 @@ +18.05.2015 12:00:39 - INFO: Alarm! +18.05.2015 12:00:39 - DEBUG: Loading plugin template +18.05.2015 12:00:39 - DEBUG: Throw Template Plugin +18.05.2015 12:00:40 - INFO: Alarm! +18.05.2015 12:00:40 - DEBUG: Loading plugin template +18.05.2015 12:00:40 - DEBUG: Throw Template Plugin +18.05.2015 12:00:41 - INFO: Alarm! +18.05.2015 12:00:41 - DEBUG: Loading plugin template +18.05.2015 12:00:41 - DEBUG: Throw Template Plugin +18.05.2015 12:00:42 - INFO: Alarm! +18.05.2015 12:00:42 - DEBUG: Loading plugin template +18.05.2015 12:00:42 - DEBUG: Throw Template Plugin +18.05.2015 12:01:58 - INFO: Alarm! +18.05.2015 12:01:58 - DEBUG: Loading plugin template +18.05.2015 12:01:58 - DEBUG: Throw Template Plugin +18.05.2015 12:01:58 - DEBUG: try 5/0 +18.05.2015 12:02:09 - INFO: Alarm! +18.05.2015 12:02:09 - DEBUG: Loading plugin template +18.05.2015 12:02:09 - DEBUG: Throw Template Plugin +18.05.2015 12:02:09 - DEBUG: try 5/0 +18.05.2015 12:02:09 - ERROR: Error in Template Plugin +Traceback (most recent call last): + File "./plugins\template\__init__.py", line 7, in run + test = 5/0 +ZeroDivisionError: division by zero +18.05.2015 12:02:10 - INFO: Alarm! +18.05.2015 12:02:10 - DEBUG: Loading plugin template +18.05.2015 12:02:10 - DEBUG: Throw Template Plugin +18.05.2015 12:02:10 - DEBUG: try 5/0 +18.05.2015 12:02:10 - ERROR: Error in Template Plugin +Traceback (most recent call last): + File "./plugins\template\__init__.py", line 7, in run + test = 5/0 +ZeroDivisionError: division by zero +18.05.2015 12:02:11 - INFO: Alarm! +18.05.2015 12:02:11 - DEBUG: Loading plugin template +18.05.2015 12:02:11 - DEBUG: Throw Template Plugin +18.05.2015 12:02:11 - DEBUG: try 5/0 +18.05.2015 12:02:11 - ERROR: Error in Template Plugin +Traceback (most recent call last): + File "./plugins\template\__init__.py", line 7, in run + test = 5/0 +ZeroDivisionError: division by zero diff --git a/plugin_test/plugin_test.py b/plugin_test/plugin_test.py index daff263..314b890 100644 --- a/plugin_test/plugin_test.py +++ b/plugin_test/plugin_test.py @@ -4,10 +4,23 @@ import time import pluginloader +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 + while True: time.sleep(1) print ("Alarm!") + logging.info("Alarm!") for i in pluginloader.getPlugins(): - print("Loading plugin " + i["name"]) + logging.debug("Loading plugin " + i["name"]) plugin = pluginloader.loadPlugin(i) - plugin.run() \ No newline at end of file + plugin.run("zvei","","","12345","","") \ No newline at end of file diff --git a/plugin_test/plugins/http/__init__.py b/plugin_test/plugins/http/__init__.py deleted file mode 100644 index 5f1887e..0000000 --- a/plugin_test/plugins/http/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -def run(): - print("throw HTTP Plugin") \ No newline at end of file diff --git a/plugin_test/plugins/interface.txt b/plugin_test/plugins/interface.txt new file mode 100644 index 0000000..6f70513 --- /dev/null +++ b/plugin_test/plugins/interface.txt @@ -0,0 +1,26 @@ +ZVEI: +===== +typ = zvei +time = datetime +frequenz= empfangsfrequenz +data1 = zvei code +data2 = +data3 = + +FMS: +==== +typ = fms +time = datetime +frequenz= empfangsfrequenz +data1 = fms kennung +data2 = status +data3 = richtung + +POCSAG 1200: +============ +typ = poc1200 +time = datetime +frequenz= empfangsfrequenz +data1 = ric +data2 = sub_ric +data3 = text \ No newline at end of file diff --git a/plugin_test/plugins/mysql/__init__.py b/plugin_test/plugins/mysql/__init__.py deleted file mode 100644 index c61db52..0000000 --- a/plugin_test/plugins/mysql/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -def run(): - print("Throw MySql Plugin") \ No newline at end of file diff --git a/plugin_test/plugins/template/__init__.py b/plugin_test/plugins/template/__init__.py index 1f27ab2..99de197 100644 --- a/plugin_test/plugins/template/__init__.py +++ b/plugin_test/plugins/template/__init__.py @@ -1,2 +1,9 @@ -def run(): - print("Throw template Plugin") \ No newline at end of file +import logging + +def run(typ,time,frequenz,data1,data2,data3): + logging.debug("Throw Template Plugin") + try: + logging.debug("try 5/0") + test = 5/0 + except: + logging.exception("Error in Template Plugin") \ No newline at end of file From 817f578f880611af349217fa4ab2802a5673f1c6 Mon Sep 17 00:00:00 2001 From: Schrolli Date: Mon, 18 May 2015 12:10:45 +0200 Subject: [PATCH 02/12] little edit in interface --- plugin_test/plugin_test.py | 2 +- plugin_test/plugins/interface.txt | 3 --- plugin_test/plugins/template/__init__.py | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/plugin_test/plugin_test.py b/plugin_test/plugin_test.py index 314b890..1dd9597 100644 --- a/plugin_test/plugin_test.py +++ b/plugin_test/plugin_test.py @@ -23,4 +23,4 @@ while True: for i in pluginloader.getPlugins(): logging.debug("Loading plugin " + i["name"]) plugin = pluginloader.loadPlugin(i) - plugin.run("zvei","","","12345","","") \ No newline at end of file + plugin.run("zvei","","12345","","") \ No newline at end of file diff --git a/plugin_test/plugins/interface.txt b/plugin_test/plugins/interface.txt index 6f70513..ebce0d1 100644 --- a/plugin_test/plugins/interface.txt +++ b/plugin_test/plugins/interface.txt @@ -1,7 +1,6 @@ ZVEI: ===== typ = zvei -time = datetime frequenz= empfangsfrequenz data1 = zvei code data2 = @@ -10,7 +9,6 @@ data3 = FMS: ==== typ = fms -time = datetime frequenz= empfangsfrequenz data1 = fms kennung data2 = status @@ -19,7 +17,6 @@ data3 = richtung POCSAG 1200: ============ typ = poc1200 -time = datetime frequenz= empfangsfrequenz data1 = ric data2 = sub_ric diff --git a/plugin_test/plugins/template/__init__.py b/plugin_test/plugins/template/__init__.py index 99de197..886f9ad 100644 --- a/plugin_test/plugins/template/__init__.py +++ b/plugin_test/plugins/template/__init__.py @@ -1,6 +1,6 @@ import logging -def run(typ,time,frequenz,data1,data2,data3): +def run(typ,frequenz,data1,data2,data3): logging.debug("Throw Template Plugin") try: logging.debug("try 5/0") From 200c0e65fa724b02711a68542e05bfa0464d5d32 Mon Sep 17 00:00:00 2001 From: Schrolli Date: Mon, 18 May 2015 12:17:06 +0200 Subject: [PATCH 03/12] logging filemode = w --- .gitignore | 3 ++- plugin_test/boswatch.log | 44 +++++--------------------------------- plugin_test/plugin_test.py | 2 +- 3 files changed, 8 insertions(+), 41 deletions(-) diff --git a/.gitignore b/.gitignore index ac7b2b5..a74980d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -*.psd \ No newline at end of file +*.psd +*.pyc \ No newline at end of file diff --git a/plugin_test/boswatch.log b/plugin_test/boswatch.log index dc860c0..d0cf339 100644 --- a/plugin_test/boswatch.log +++ b/plugin_test/boswatch.log @@ -1,42 +1,8 @@ -18.05.2015 12:00:39 - INFO: Alarm! -18.05.2015 12:00:39 - DEBUG: Loading plugin template -18.05.2015 12:00:39 - DEBUG: Throw Template Plugin -18.05.2015 12:00:40 - INFO: Alarm! -18.05.2015 12:00:40 - DEBUG: Loading plugin template -18.05.2015 12:00:40 - DEBUG: Throw Template Plugin -18.05.2015 12:00:41 - INFO: Alarm! -18.05.2015 12:00:41 - DEBUG: Loading plugin template -18.05.2015 12:00:41 - DEBUG: Throw Template Plugin -18.05.2015 12:00:42 - INFO: Alarm! -18.05.2015 12:00:42 - DEBUG: Loading plugin template -18.05.2015 12:00:42 - DEBUG: Throw Template Plugin -18.05.2015 12:01:58 - INFO: Alarm! -18.05.2015 12:01:58 - DEBUG: Loading plugin template -18.05.2015 12:01:58 - DEBUG: Throw Template Plugin -18.05.2015 12:01:58 - DEBUG: try 5/0 -18.05.2015 12:02:09 - INFO: Alarm! -18.05.2015 12:02:09 - DEBUG: Loading plugin template -18.05.2015 12:02:09 - DEBUG: Throw Template Plugin -18.05.2015 12:02:09 - DEBUG: try 5/0 -18.05.2015 12:02:09 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:02:10 - INFO: Alarm! -18.05.2015 12:02:10 - DEBUG: Loading plugin template -18.05.2015 12:02:10 - DEBUG: Throw Template Plugin -18.05.2015 12:02:10 - DEBUG: try 5/0 -18.05.2015 12:02:10 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:02:11 - INFO: Alarm! -18.05.2015 12:02:11 - DEBUG: Loading plugin template -18.05.2015 12:02:11 - DEBUG: Throw Template Plugin -18.05.2015 12:02:11 - DEBUG: try 5/0 -18.05.2015 12:02:11 - ERROR: Error in Template Plugin +18.05.2015 12:15:05 - INFO: Alarm! +18.05.2015 12:15:05 - DEBUG: Loading plugin template +18.05.2015 12:15:05 - DEBUG: Throw Template Plugin +18.05.2015 12:15:05 - DEBUG: try 5/0 +18.05.2015 12:15:05 - ERROR: Error in Template Plugin Traceback (most recent call last): File "./plugins\template\__init__.py", line 7, in run test = 5/0 diff --git a/plugin_test/plugin_test.py b/plugin_test/plugin_test.py index 1dd9597..c42e718 100644 --- a/plugin_test/plugin_test.py +++ b/plugin_test/plugin_test.py @@ -5,7 +5,7 @@ import time import pluginloader import logging -logging.basicConfig(filename='boswatch.log',level=logging.DEBUG, format='%(asctime)s - %(levelname)s: %(message)s', datefmt='%d.%m.%Y %I:%M:%S') +logging.basicConfig(filename='boswatch.log', filemode='w', 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 From bd6ae68ea35fa6259f20a65b0a8706a584bf7cbf Mon Sep 17 00:00:00 2001 From: Schrolli Date: Mon, 18 May 2015 12:28:18 +0200 Subject: [PATCH 04/12] log all in file and display errors --- plugin_test/boswatch.log | 100 +++++++++++++++++++++++++++++++++++-- plugin_test/plugin_test.py | 23 ++++++++- 2 files changed, 117 insertions(+), 6 deletions(-) diff --git a/plugin_test/boswatch.log b/plugin_test/boswatch.log index d0cf339..300ec2f 100644 --- a/plugin_test/boswatch.log +++ b/plugin_test/boswatch.log @@ -1,8 +1,98 @@ -18.05.2015 12:15:05 - INFO: Alarm! -18.05.2015 12:15:05 - DEBUG: Loading plugin template -18.05.2015 12:15:05 - DEBUG: Throw Template Plugin -18.05.2015 12:15:05 - DEBUG: try 5/0 -18.05.2015 12:15:05 - ERROR: Error in Template Plugin +18.05.2015 12:27:39 - INFO: Alarm! +18.05.2015 12:27:39 - DEBUG: Loading plugin template +18.05.2015 12:27:39 - DEBUG: Throw Template Plugin +18.05.2015 12:27:39 - DEBUG: try 5/0 +18.05.2015 12:27:39 - ERROR: Error in Template Plugin +Traceback (most recent call last): + File "./plugins\template\__init__.py", line 7, in run + test = 5/0 +ZeroDivisionError: division by zero +18.05.2015 12:27:40 - INFO: Alarm! +18.05.2015 12:27:40 - DEBUG: Loading plugin template +18.05.2015 12:27:40 - DEBUG: Throw Template Plugin +18.05.2015 12:27:40 - DEBUG: try 5/0 +18.05.2015 12:27:40 - ERROR: Error in Template Plugin +Traceback (most recent call last): + File "./plugins\template\__init__.py", line 7, in run + test = 5/0 +ZeroDivisionError: division by zero +18.05.2015 12:27:41 - INFO: Alarm! +18.05.2015 12:27:41 - DEBUG: Loading plugin template +18.05.2015 12:27:41 - DEBUG: Throw Template Plugin +18.05.2015 12:27:41 - DEBUG: try 5/0 +18.05.2015 12:27:41 - ERROR: Error in Template Plugin +Traceback (most recent call last): + File "./plugins\template\__init__.py", line 7, in run + test = 5/0 +ZeroDivisionError: division by zero +18.05.2015 12:27:42 - INFO: Alarm! +18.05.2015 12:27:42 - DEBUG: Loading plugin template +18.05.2015 12:27:42 - DEBUG: Throw Template Plugin +18.05.2015 12:27:42 - DEBUG: try 5/0 +18.05.2015 12:27:42 - ERROR: Error in Template Plugin +Traceback (most recent call last): + File "./plugins\template\__init__.py", line 7, in run + test = 5/0 +ZeroDivisionError: division by zero +18.05.2015 12:27:43 - INFO: Alarm! +18.05.2015 12:27:43 - DEBUG: Loading plugin template +18.05.2015 12:27:43 - DEBUG: Throw Template Plugin +18.05.2015 12:27:43 - DEBUG: try 5/0 +18.05.2015 12:27:43 - ERROR: Error in Template Plugin +Traceback (most recent call last): + File "./plugins\template\__init__.py", line 7, in run + test = 5/0 +ZeroDivisionError: division by zero +18.05.2015 12:27:44 - INFO: Alarm! +18.05.2015 12:27:44 - DEBUG: Loading plugin template +18.05.2015 12:27:44 - DEBUG: Throw Template Plugin +18.05.2015 12:27:44 - DEBUG: try 5/0 +18.05.2015 12:27:44 - ERROR: Error in Template Plugin +Traceback (most recent call last): + File "./plugins\template\__init__.py", line 7, in run + test = 5/0 +ZeroDivisionError: division by zero +18.05.2015 12:27:45 - INFO: Alarm! +18.05.2015 12:27:45 - DEBUG: Loading plugin template +18.05.2015 12:27:45 - DEBUG: Throw Template Plugin +18.05.2015 12:27:45 - DEBUG: try 5/0 +18.05.2015 12:27:45 - ERROR: Error in Template Plugin +Traceback (most recent call last): + File "./plugins\template\__init__.py", line 7, in run + test = 5/0 +ZeroDivisionError: division by zero +18.05.2015 12:27:46 - INFO: Alarm! +18.05.2015 12:27:46 - DEBUG: Loading plugin template +18.05.2015 12:27:46 - DEBUG: Throw Template Plugin +18.05.2015 12:27:46 - DEBUG: try 5/0 +18.05.2015 12:27:46 - ERROR: Error in Template Plugin +Traceback (most recent call last): + File "./plugins\template\__init__.py", line 7, in run + test = 5/0 +ZeroDivisionError: division by zero +18.05.2015 12:27:47 - INFO: Alarm! +18.05.2015 12:27:47 - DEBUG: Loading plugin template +18.05.2015 12:27:47 - DEBUG: Throw Template Plugin +18.05.2015 12:27:47 - DEBUG: try 5/0 +18.05.2015 12:27:47 - ERROR: Error in Template Plugin +Traceback (most recent call last): + File "./plugins\template\__init__.py", line 7, in run + test = 5/0 +ZeroDivisionError: division by zero +18.05.2015 12:27:48 - INFO: Alarm! +18.05.2015 12:27:48 - DEBUG: Loading plugin template +18.05.2015 12:27:48 - DEBUG: Throw Template Plugin +18.05.2015 12:27:48 - DEBUG: try 5/0 +18.05.2015 12:27:48 - ERROR: Error in Template Plugin +Traceback (most recent call last): + File "./plugins\template\__init__.py", line 7, in run + test = 5/0 +ZeroDivisionError: division by zero +18.05.2015 12:27:49 - INFO: Alarm! +18.05.2015 12:27:49 - DEBUG: Loading plugin template +18.05.2015 12:27:49 - DEBUG: Throw Template Plugin +18.05.2015 12:27:49 - DEBUG: try 5/0 +18.05.2015 12:27:49 - ERROR: Error in Template Plugin Traceback (most recent call last): File "./plugins\template\__init__.py", line 7, in run test = 5/0 diff --git a/plugin_test/plugin_test.py b/plugin_test/plugin_test.py index c42e718..04d7c6f 100644 --- a/plugin_test/plugin_test.py +++ b/plugin_test/plugin_test.py @@ -4,11 +4,29 @@ import time import pluginloader +#create new logger import logging -logging.basicConfig(filename='boswatch.log', filemode='w', level=logging.DEBUG, format='%(asctime)s - %(levelname)s: %(message)s', datefmt='%d.%m.%Y %I:%M:%S') +logger = logging.getLogger() +logger.setLevel(logging.DEBUG) + +#set log string format +formatter = logging.Formatter('%(asctime)s - %(levelname)s: %(message)s', '%d.%m.%Y %I:%M:%S') + +#create a file loger +fh = logging.FileHandler('boswatch.log', 'w') +fh.setLevel(logging.DEBUG) #log level >= Debug +fh.setFormatter(formatter) +logger.addHandler(fh) + +#create a display loger +ch = logging.StreamHandler() +ch.setLevel(logging.ERROR) #log level >= Error +ch.setFormatter(formatter) +logger.addHandler(ch) #https://docs.python.org/2/howto/logging.html#logging-basic-tutorial #log levels +#---------- #debug - debug messages only for log #info - only an information #warning @@ -16,6 +34,9 @@ logging.basicConfig(filename='boswatch.log', filemode='w', level=logging.DEBUG, #exception - error handler in try:exc: into the message #critical - big error, program exit + + + while True: time.sleep(1) print ("Alarm!") From 5cddcf69d74ace39847962c6d8db268d48e42b4a Mon Sep 17 00:00:00 2001 From: Schrolli Date: Mon, 18 May 2015 14:49:10 +0200 Subject: [PATCH 05/12] interface with array --- .gitignore | 3 ++- plugin_test/plugin_test.py | 7 +++-- plugin_test/plugins/interface.txt | 34 +++++++++++------------- plugin_test/plugins/template/__init__.py | 3 ++- 4 files changed, 22 insertions(+), 25 deletions(-) diff --git a/.gitignore b/.gitignore index a74980d..77b6753 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.psd -*.pyc \ No newline at end of file +*.pyc +*.log \ No newline at end of file diff --git a/plugin_test/plugin_test.py b/plugin_test/plugin_test.py index 04d7c6f..c7e54ed 100644 --- a/plugin_test/plugin_test.py +++ b/plugin_test/plugin_test.py @@ -32,16 +32,15 @@ logger.addHandler(ch) #warning #error - normal error - program goes further #exception - error handler in try:exc: into the message -#critical - big error, program exit - +#critical - critical error, program exit +daten = ["12345"] while True: time.sleep(1) - print ("Alarm!") logging.info("Alarm!") for i in pluginloader.getPlugins(): logging.debug("Loading plugin " + i["name"]) plugin = pluginloader.loadPlugin(i) - plugin.run("zvei","","12345","","") \ No newline at end of file + plugin.run("zvei","00000000",daten) \ No newline at end of file diff --git a/plugin_test/plugins/interface.txt b/plugin_test/plugins/interface.txt index ebce0d1..be2f518 100644 --- a/plugin_test/plugins/interface.txt +++ b/plugin_test/plugins/interface.txt @@ -1,23 +1,19 @@ +Übergabe an Plugin: + +Typ = FMS, ZVEI oder POC +Frequenz = Frequenz in Hz +daten[] als Python List + ZVEI: -===== -typ = zvei -frequenz= empfangsfrequenz -data1 = zvei code -data2 = -data3 = +- ZVEI code FMS: -==== -typ = fms -frequenz= empfangsfrequenz -data1 = fms kennung -data2 = status -data3 = richtung +- FMS Kennung +- Status +- Richtung +- TKI -POCSAG 1200: -============ -typ = poc1200 -frequenz= empfangsfrequenz -data1 = ric -data2 = sub_ric -data3 = text \ No newline at end of file +POCSAG: +- RIC +- Sub RIC +- Text diff --git a/plugin_test/plugins/template/__init__.py b/plugin_test/plugins/template/__init__.py index 886f9ad..2a42b03 100644 --- a/plugin_test/plugins/template/__init__.py +++ b/plugin_test/plugins/template/__init__.py @@ -1,8 +1,9 @@ import logging -def run(typ,frequenz,data1,data2,data3): +def run(typ,frequenz,daten): logging.debug("Throw Template Plugin") try: + logging.info("ZVEI: %s wurde empfangen!", daten[0]) logging.debug("try 5/0") test = 5/0 except: From d305f17cfc23e196210ddd217e970ec4f253171c Mon Sep 17 00:00:00 2001 From: Schrolli91 Date: Mon, 18 May 2015 14:49:28 +0200 Subject: [PATCH 06/12] Delete boswatch.log --- plugin_test/boswatch.log | 99 ---------------------------------------- 1 file changed, 99 deletions(-) delete mode 100644 plugin_test/boswatch.log diff --git a/plugin_test/boswatch.log b/plugin_test/boswatch.log deleted file mode 100644 index 300ec2f..0000000 --- a/plugin_test/boswatch.log +++ /dev/null @@ -1,99 +0,0 @@ -18.05.2015 12:27:39 - INFO: Alarm! -18.05.2015 12:27:39 - DEBUG: Loading plugin template -18.05.2015 12:27:39 - DEBUG: Throw Template Plugin -18.05.2015 12:27:39 - DEBUG: try 5/0 -18.05.2015 12:27:39 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:27:40 - INFO: Alarm! -18.05.2015 12:27:40 - DEBUG: Loading plugin template -18.05.2015 12:27:40 - DEBUG: Throw Template Plugin -18.05.2015 12:27:40 - DEBUG: try 5/0 -18.05.2015 12:27:40 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:27:41 - INFO: Alarm! -18.05.2015 12:27:41 - DEBUG: Loading plugin template -18.05.2015 12:27:41 - DEBUG: Throw Template Plugin -18.05.2015 12:27:41 - DEBUG: try 5/0 -18.05.2015 12:27:41 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:27:42 - INFO: Alarm! -18.05.2015 12:27:42 - DEBUG: Loading plugin template -18.05.2015 12:27:42 - DEBUG: Throw Template Plugin -18.05.2015 12:27:42 - DEBUG: try 5/0 -18.05.2015 12:27:42 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:27:43 - INFO: Alarm! -18.05.2015 12:27:43 - DEBUG: Loading plugin template -18.05.2015 12:27:43 - DEBUG: Throw Template Plugin -18.05.2015 12:27:43 - DEBUG: try 5/0 -18.05.2015 12:27:43 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:27:44 - INFO: Alarm! -18.05.2015 12:27:44 - DEBUG: Loading plugin template -18.05.2015 12:27:44 - DEBUG: Throw Template Plugin -18.05.2015 12:27:44 - DEBUG: try 5/0 -18.05.2015 12:27:44 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:27:45 - INFO: Alarm! -18.05.2015 12:27:45 - DEBUG: Loading plugin template -18.05.2015 12:27:45 - DEBUG: Throw Template Plugin -18.05.2015 12:27:45 - DEBUG: try 5/0 -18.05.2015 12:27:45 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:27:46 - INFO: Alarm! -18.05.2015 12:27:46 - DEBUG: Loading plugin template -18.05.2015 12:27:46 - DEBUG: Throw Template Plugin -18.05.2015 12:27:46 - DEBUG: try 5/0 -18.05.2015 12:27:46 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:27:47 - INFO: Alarm! -18.05.2015 12:27:47 - DEBUG: Loading plugin template -18.05.2015 12:27:47 - DEBUG: Throw Template Plugin -18.05.2015 12:27:47 - DEBUG: try 5/0 -18.05.2015 12:27:47 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:27:48 - INFO: Alarm! -18.05.2015 12:27:48 - DEBUG: Loading plugin template -18.05.2015 12:27:48 - DEBUG: Throw Template Plugin -18.05.2015 12:27:48 - DEBUG: try 5/0 -18.05.2015 12:27:48 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:27:49 - INFO: Alarm! -18.05.2015 12:27:49 - DEBUG: Loading plugin template -18.05.2015 12:27:49 - DEBUG: Throw Template Plugin -18.05.2015 12:27:49 - DEBUG: try 5/0 -18.05.2015 12:27:49 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero From a7519386ad18d28e743fc51ea9b0734bf78acec3 Mon Sep 17 00:00:00 2001 From: Schrolli Date: Mon, 18 May 2015 14:56:01 +0200 Subject: [PATCH 07/12] little change --- .gitignore | 1 + plugin_test/plugin_test.py | 4 ++-- plugin_test/plugins/template/__init__.py | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 77b6753..03d330b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.psd *.pyc +*.log *.log \ No newline at end of file diff --git a/plugin_test/plugin_test.py b/plugin_test/plugin_test.py index c7e54ed..9f2ade4 100644 --- a/plugin_test/plugin_test.py +++ b/plugin_test/plugin_test.py @@ -35,7 +35,7 @@ logger.addHandler(ch) #critical - critical error, program exit -daten = ["12345"] +data = ["12345"] while True: time.sleep(1) @@ -43,4 +43,4 @@ while True: for i in pluginloader.getPlugins(): logging.debug("Loading plugin " + i["name"]) plugin = pluginloader.loadPlugin(i) - plugin.run("zvei","00000000",daten) \ No newline at end of file + plugin.run("zvei","80000000",data) \ No newline at end of file diff --git a/plugin_test/plugins/template/__init__.py b/plugin_test/plugins/template/__init__.py index 2a42b03..994ebcf 100644 --- a/plugin_test/plugins/template/__init__.py +++ b/plugin_test/plugins/template/__init__.py @@ -1,9 +1,9 @@ import logging -def run(typ,frequenz,daten): +def run(typ,freq,data): logging.debug("Throw Template Plugin") try: - logging.info("ZVEI: %s wurde empfangen!", daten[0]) + logging.info("ZVEI: %s wurde auf %s empfangen!", data[0],freq) logging.debug("try 5/0") test = 5/0 except: From 70a45f8de755a3d92b79290bc9e358ca4a37d69a Mon Sep 17 00:00:00 2001 From: Schrolli Date: Mon, 18 May 2015 15:23:47 +0200 Subject: [PATCH 08/12] argument list to dict --- plugin_test/boswatch.log | 89 ++---------------------- plugin_test/plugin_test.py | 2 +- plugin_test/plugins/interface.txt | 18 ++--- plugin_test/plugins/template/__init__.py | 2 +- 4 files changed, 16 insertions(+), 95 deletions(-) diff --git a/plugin_test/boswatch.log b/plugin_test/boswatch.log index 300ec2f..26ae022 100644 --- a/plugin_test/boswatch.log +++ b/plugin_test/boswatch.log @@ -1,99 +1,20 @@ -18.05.2015 12:27:39 - INFO: Alarm! -18.05.2015 12:27:39 - DEBUG: Loading plugin template -18.05.2015 12:27:39 - DEBUG: Throw Template Plugin -18.05.2015 12:27:39 - DEBUG: try 5/0 -18.05.2015 12:27:39 - ERROR: Error in Template Plugin Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run + File "./plugins\template\__init__.py", line 8, in run test = 5/0 ZeroDivisionError: division by zero -18.05.2015 12:27:40 - INFO: Alarm! -18.05.2015 12:27:40 - DEBUG: Loading plugin template -18.05.2015 12:27:40 - DEBUG: Throw Template Plugin -18.05.2015 12:27:40 - DEBUG: try 5/0 -18.05.2015 12:27:40 - ERROR: Error in Template Plugin Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run + File "./plugins\template\__init__.py", line 8, in run test = 5/0 ZeroDivisionError: division by zero -18.05.2015 12:27:41 - INFO: Alarm! -18.05.2015 12:27:41 - DEBUG: Loading plugin template -18.05.2015 12:27:41 - DEBUG: Throw Template Plugin -18.05.2015 12:27:41 - DEBUG: try 5/0 -18.05.2015 12:27:41 - ERROR: Error in Template Plugin Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run + File "./plugins\template\__init__.py", line 8, in run test = 5/0 ZeroDivisionError: division by zero -18.05.2015 12:27:42 - INFO: Alarm! -18.05.2015 12:27:42 - DEBUG: Loading plugin template -18.05.2015 12:27:42 - DEBUG: Throw Template Plugin -18.05.2015 12:27:42 - DEBUG: try 5/0 -18.05.2015 12:27:42 - ERROR: Error in Template Plugin Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run + File "./plugins\template\__init__.py", line 8, in run test = 5/0 ZeroDivisionError: division by zero -18.05.2015 12:27:43 - INFO: Alarm! -18.05.2015 12:27:43 - DEBUG: Loading plugin template -18.05.2015 12:27:43 - DEBUG: Throw Template Plugin -18.05.2015 12:27:43 - DEBUG: try 5/0 -18.05.2015 12:27:43 - ERROR: Error in Template Plugin Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:27:44 - INFO: Alarm! -18.05.2015 12:27:44 - DEBUG: Loading plugin template -18.05.2015 12:27:44 - DEBUG: Throw Template Plugin -18.05.2015 12:27:44 - DEBUG: try 5/0 -18.05.2015 12:27:44 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:27:45 - INFO: Alarm! -18.05.2015 12:27:45 - DEBUG: Loading plugin template -18.05.2015 12:27:45 - DEBUG: Throw Template Plugin -18.05.2015 12:27:45 - DEBUG: try 5/0 -18.05.2015 12:27:45 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:27:46 - INFO: Alarm! -18.05.2015 12:27:46 - DEBUG: Loading plugin template -18.05.2015 12:27:46 - DEBUG: Throw Template Plugin -18.05.2015 12:27:46 - DEBUG: try 5/0 -18.05.2015 12:27:46 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:27:47 - INFO: Alarm! -18.05.2015 12:27:47 - DEBUG: Loading plugin template -18.05.2015 12:27:47 - DEBUG: Throw Template Plugin -18.05.2015 12:27:47 - DEBUG: try 5/0 -18.05.2015 12:27:47 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:27:48 - INFO: Alarm! -18.05.2015 12:27:48 - DEBUG: Loading plugin template -18.05.2015 12:27:48 - DEBUG: Throw Template Plugin -18.05.2015 12:27:48 - DEBUG: try 5/0 -18.05.2015 12:27:48 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:27:49 - INFO: Alarm! -18.05.2015 12:27:49 - DEBUG: Loading plugin template -18.05.2015 12:27:49 - DEBUG: Throw Template Plugin -18.05.2015 12:27:49 - DEBUG: try 5/0 -18.05.2015 12:27:49 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run + File "./plugins\template\__init__.py", line 8, in run test = 5/0 ZeroDivisionError: division by zero diff --git a/plugin_test/plugin_test.py b/plugin_test/plugin_test.py index 9f2ade4..b736181 100644 --- a/plugin_test/plugin_test.py +++ b/plugin_test/plugin_test.py @@ -35,7 +35,7 @@ logger.addHandler(ch) #critical - critical error, program exit -data = ["12345"] +data = { "zvei":"12345"} while True: time.sleep(1) diff --git a/plugin_test/plugins/interface.txt b/plugin_test/plugins/interface.txt index be2f518..cad7b75 100644 --- a/plugin_test/plugins/interface.txt +++ b/plugin_test/plugins/interface.txt @@ -2,18 +2,18 @@ Typ = FMS, ZVEI oder POC Frequenz = Frequenz in Hz -daten[] als Python List +daten[] als Python Dictionary ZVEI: -- ZVEI code +- zvei FMS: -- FMS Kennung -- Status -- Richtung -- TKI +- fms +- status +- direction +- tki POCSAG: -- RIC -- Sub RIC -- Text +- ric +- sub_ric +- text diff --git a/plugin_test/plugins/template/__init__.py b/plugin_test/plugins/template/__init__.py index 994ebcf..36938b1 100644 --- a/plugin_test/plugins/template/__init__.py +++ b/plugin_test/plugins/template/__init__.py @@ -3,7 +3,7 @@ import logging def run(typ,freq,data): logging.debug("Throw Template Plugin") try: - logging.info("ZVEI: %s wurde auf %s empfangen!", data[0],freq) + logging.info("ZVEI: %s wurde auf %s empfangen!", data["zvei"],freq) logging.debug("try 5/0") test = 5/0 except: From 75d422a00c619f546df2a63d8c31646b4c44b600 Mon Sep 17 00:00:00 2001 From: Schrolli Date: Mon, 18 May 2015 15:27:50 +0200 Subject: [PATCH 09/12] argument list to dict --- plugin_test/boswatch.log | 111 +++++------------------ plugin_test/plugin_test.py | 2 +- plugin_test/plugins/template/__init__.py | 2 +- 3 files changed, 23 insertions(+), 92 deletions(-) diff --git a/plugin_test/boswatch.log b/plugin_test/boswatch.log index 300ec2f..1239a8d 100644 --- a/plugin_test/boswatch.log +++ b/plugin_test/boswatch.log @@ -1,99 +1,30 @@ -18.05.2015 12:27:39 - INFO: Alarm! -18.05.2015 12:27:39 - DEBUG: Loading plugin template -18.05.2015 12:27:39 - DEBUG: Throw Template Plugin -18.05.2015 12:27:39 - DEBUG: try 5/0 -18.05.2015 12:27:39 - ERROR: Error in Template Plugin +18.05.2015 03:26:47 - INFO: Alarm! +18.05.2015 03:26:47 - DEBUG: Loading plugin template +18.05.2015 03:26:47 - DEBUG: Throw Template Plugin +18.05.2015 03:26:47 - INFO: ZVEI: 12345 wurde auf 80000000 empfangen! +18.05.2015 03:26:47 - DEBUG: try 5/0 +18.05.2015 03:26:47 - ERROR: Error in Template Plugin Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run + File "./plugins\template\__init__.py", line 8, in run test = 5/0 ZeroDivisionError: division by zero -18.05.2015 12:27:40 - INFO: Alarm! -18.05.2015 12:27:40 - DEBUG: Loading plugin template -18.05.2015 12:27:40 - DEBUG: Throw Template Plugin -18.05.2015 12:27:40 - DEBUG: try 5/0 -18.05.2015 12:27:40 - ERROR: Error in Template Plugin +18.05.2015 03:26:48 - INFO: Alarm! +18.05.2015 03:26:48 - DEBUG: Loading plugin template +18.05.2015 03:26:48 - DEBUG: Throw Template Plugin +18.05.2015 03:26:48 - INFO: ZVEI: 12345 wurde auf 80000000 empfangen! +18.05.2015 03:26:48 - DEBUG: try 5/0 +18.05.2015 03:26:48 - ERROR: Error in Template Plugin Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run + File "./plugins\template\__init__.py", line 8, in run test = 5/0 ZeroDivisionError: division by zero -18.05.2015 12:27:41 - INFO: Alarm! -18.05.2015 12:27:41 - DEBUG: Loading plugin template -18.05.2015 12:27:41 - DEBUG: Throw Template Plugin -18.05.2015 12:27:41 - DEBUG: try 5/0 -18.05.2015 12:27:41 - ERROR: Error in Template Plugin +18.05.2015 03:26:49 - INFO: Alarm! +18.05.2015 03:26:49 - DEBUG: Loading plugin template +18.05.2015 03:26:49 - DEBUG: Throw Template Plugin +18.05.2015 03:26:49 - INFO: ZVEI: 12345 wurde auf 80000000 empfangen! +18.05.2015 03:26:49 - DEBUG: try 5/0 +18.05.2015 03:26:49 - ERROR: Error in Template Plugin Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:27:42 - INFO: Alarm! -18.05.2015 12:27:42 - DEBUG: Loading plugin template -18.05.2015 12:27:42 - DEBUG: Throw Template Plugin -18.05.2015 12:27:42 - DEBUG: try 5/0 -18.05.2015 12:27:42 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:27:43 - INFO: Alarm! -18.05.2015 12:27:43 - DEBUG: Loading plugin template -18.05.2015 12:27:43 - DEBUG: Throw Template Plugin -18.05.2015 12:27:43 - DEBUG: try 5/0 -18.05.2015 12:27:43 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:27:44 - INFO: Alarm! -18.05.2015 12:27:44 - DEBUG: Loading plugin template -18.05.2015 12:27:44 - DEBUG: Throw Template Plugin -18.05.2015 12:27:44 - DEBUG: try 5/0 -18.05.2015 12:27:44 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:27:45 - INFO: Alarm! -18.05.2015 12:27:45 - DEBUG: Loading plugin template -18.05.2015 12:27:45 - DEBUG: Throw Template Plugin -18.05.2015 12:27:45 - DEBUG: try 5/0 -18.05.2015 12:27:45 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:27:46 - INFO: Alarm! -18.05.2015 12:27:46 - DEBUG: Loading plugin template -18.05.2015 12:27:46 - DEBUG: Throw Template Plugin -18.05.2015 12:27:46 - DEBUG: try 5/0 -18.05.2015 12:27:46 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:27:47 - INFO: Alarm! -18.05.2015 12:27:47 - DEBUG: Loading plugin template -18.05.2015 12:27:47 - DEBUG: Throw Template Plugin -18.05.2015 12:27:47 - DEBUG: try 5/0 -18.05.2015 12:27:47 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:27:48 - INFO: Alarm! -18.05.2015 12:27:48 - DEBUG: Loading plugin template -18.05.2015 12:27:48 - DEBUG: Throw Template Plugin -18.05.2015 12:27:48 - DEBUG: try 5/0 -18.05.2015 12:27:48 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run - test = 5/0 -ZeroDivisionError: division by zero -18.05.2015 12:27:49 - INFO: Alarm! -18.05.2015 12:27:49 - DEBUG: Loading plugin template -18.05.2015 12:27:49 - DEBUG: Throw Template Plugin -18.05.2015 12:27:49 - DEBUG: try 5/0 -18.05.2015 12:27:49 - ERROR: Error in Template Plugin -Traceback (most recent call last): - File "./plugins\template\__init__.py", line 7, in run + File "./plugins\template\__init__.py", line 8, in run test = 5/0 ZeroDivisionError: division by zero diff --git a/plugin_test/plugin_test.py b/plugin_test/plugin_test.py index 9f2ade4..01b86be 100644 --- a/plugin_test/plugin_test.py +++ b/plugin_test/plugin_test.py @@ -35,7 +35,7 @@ logger.addHandler(ch) #critical - critical error, program exit -data = ["12345"] +data = {"zvei":"12345"} while True: time.sleep(1) diff --git a/plugin_test/plugins/template/__init__.py b/plugin_test/plugins/template/__init__.py index 994ebcf..36938b1 100644 --- a/plugin_test/plugins/template/__init__.py +++ b/plugin_test/plugins/template/__init__.py @@ -3,7 +3,7 @@ import logging def run(typ,freq,data): logging.debug("Throw Template Plugin") try: - logging.info("ZVEI: %s wurde auf %s empfangen!", data[0],freq) + logging.info("ZVEI: %s wurde auf %s empfangen!", data["zvei"],freq) logging.debug("try 5/0") test = 5/0 except: From 2a02964c08acb63e1f0f67a286104e7eb97ca07a Mon Sep 17 00:00:00 2001 From: Schrolli Date: Mon, 18 May 2015 15:29:41 +0200 Subject: [PATCH 10/12] edit interface info --- plugin_test/plugins/interface.txt | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/plugin_test/plugins/interface.txt b/plugin_test/plugins/interface.txt index be2f518..f43a204 100644 --- a/plugin_test/plugins/interface.txt +++ b/plugin_test/plugins/interface.txt @@ -1,19 +1,19 @@ Übergabe an Plugin: -Typ = FMS, ZVEI oder POC -Frequenz = Frequenz in Hz -daten[] als Python List +typ = FMS, ZVEI oder POC +freq = Frequenz in Hz +daten[] als Python Dict ZVEI: -- ZVEI code +- zvei FMS: -- FMS Kennung -- Status -- Richtung -- TKI +- fms +- status +- direction +- tki POCSAG: -- RIC -- Sub RIC -- Text +- ric +- sub_ric +- text From 8de8beb5f9c0ba79cd6c5c307e91e1af5f3da92e Mon Sep 17 00:00:00 2001 From: Schrolli Date: Mon, 18 May 2015 15:32:06 +0200 Subject: [PATCH 11/12] little changes --- plugin_test/boswatch.log | 56 ++++++++++++++++-------- plugin_test/plugin_test.py | 2 +- plugin_test/plugins/template/__init__.py | 2 +- 3 files changed, 40 insertions(+), 20 deletions(-) diff --git a/plugin_test/boswatch.log b/plugin_test/boswatch.log index 1239a8d..0564611 100644 --- a/plugin_test/boswatch.log +++ b/plugin_test/boswatch.log @@ -1,29 +1,49 @@ -18.05.2015 03:26:47 - INFO: Alarm! -18.05.2015 03:26:47 - DEBUG: Loading plugin template -18.05.2015 03:26:47 - DEBUG: Throw Template Plugin -18.05.2015 03:26:47 - INFO: ZVEI: 12345 wurde auf 80000000 empfangen! -18.05.2015 03:26:47 - DEBUG: try 5/0 -18.05.2015 03:26:47 - ERROR: Error in Template Plugin +18.05.2015 03:30:59 - INFO: Alarm! +18.05.2015 03:30:59 - DEBUG: Loading plugin template +18.05.2015 03:30:59 - DEBUG: Throw Template Plugin +18.05.2015 03:30:59 - INFO: ZVEI: 12345 wurde auf 80000000 empfangen! +18.05.2015 03:30:59 - DEBUG: try 5/0 +18.05.2015 03:30:59 - ERROR: Error in Template Plugin Traceback (most recent call last): File "./plugins\template\__init__.py", line 8, in run test = 5/0 ZeroDivisionError: division by zero -18.05.2015 03:26:48 - INFO: Alarm! -18.05.2015 03:26:48 - DEBUG: Loading plugin template -18.05.2015 03:26:48 - DEBUG: Throw Template Plugin -18.05.2015 03:26:48 - INFO: ZVEI: 12345 wurde auf 80000000 empfangen! -18.05.2015 03:26:48 - DEBUG: try 5/0 -18.05.2015 03:26:48 - ERROR: Error in Template Plugin +18.05.2015 03:31:00 - INFO: Alarm! +18.05.2015 03:31:00 - DEBUG: Loading plugin template +18.05.2015 03:31:00 - DEBUG: Throw Template Plugin +18.05.2015 03:31:00 - INFO: ZVEI: 12345 wurde auf 80000000 empfangen! +18.05.2015 03:31:00 - DEBUG: try 5/0 +18.05.2015 03:31:00 - ERROR: Error in Template Plugin Traceback (most recent call last): File "./plugins\template\__init__.py", line 8, in run test = 5/0 ZeroDivisionError: division by zero -18.05.2015 03:26:49 - INFO: Alarm! -18.05.2015 03:26:49 - DEBUG: Loading plugin template -18.05.2015 03:26:49 - DEBUG: Throw Template Plugin -18.05.2015 03:26:49 - INFO: ZVEI: 12345 wurde auf 80000000 empfangen! -18.05.2015 03:26:49 - DEBUG: try 5/0 -18.05.2015 03:26:49 - ERROR: Error in Template Plugin +18.05.2015 03:31:01 - INFO: Alarm! +18.05.2015 03:31:01 - DEBUG: Loading plugin template +18.05.2015 03:31:01 - DEBUG: Throw Template Plugin +18.05.2015 03:31:01 - INFO: ZVEI: 12345 wurde auf 80000000 empfangen! +18.05.2015 03:31:01 - DEBUG: try 5/0 +18.05.2015 03:31:01 - ERROR: Error in Template Plugin +Traceback (most recent call last): + File "./plugins\template\__init__.py", line 8, in run + test = 5/0 +ZeroDivisionError: division by zero +18.05.2015 03:31:02 - INFO: Alarm! +18.05.2015 03:31:02 - DEBUG: Loading plugin template +18.05.2015 03:31:02 - DEBUG: Throw Template Plugin +18.05.2015 03:31:02 - INFO: ZVEI: 12345 wurde auf 80000000 empfangen! +18.05.2015 03:31:02 - DEBUG: try 5/0 +18.05.2015 03:31:02 - ERROR: Error in Template Plugin +Traceback (most recent call last): + File "./plugins\template\__init__.py", line 8, in run + test = 5/0 +ZeroDivisionError: division by zero +18.05.2015 03:31:03 - INFO: Alarm! +18.05.2015 03:31:03 - DEBUG: Loading plugin template +18.05.2015 03:31:03 - DEBUG: Throw Template Plugin +18.05.2015 03:31:03 - INFO: ZVEI: 12345 wurde auf 80000000 empfangen! +18.05.2015 03:31:03 - DEBUG: try 5/0 +18.05.2015 03:31:03 - ERROR: Error in Template Plugin Traceback (most recent call last): File "./plugins\template\__init__.py", line 8, in run test = 5/0 diff --git a/plugin_test/plugin_test.py b/plugin_test/plugin_test.py index 01b86be..b85c5c2 100644 --- a/plugin_test/plugin_test.py +++ b/plugin_test/plugin_test.py @@ -41,6 +41,6 @@ while True: time.sleep(1) logging.info("Alarm!") for i in pluginloader.getPlugins(): - logging.debug("Loading plugin " + i["name"]) + logging.debug("Load Plugin: " + i["name"]) plugin = pluginloader.loadPlugin(i) plugin.run("zvei","80000000",data) \ No newline at end of file diff --git a/plugin_test/plugins/template/__init__.py b/plugin_test/plugins/template/__init__.py index 36938b1..bd86c59 100644 --- a/plugin_test/plugins/template/__init__.py +++ b/plugin_test/plugins/template/__init__.py @@ -1,7 +1,7 @@ import logging def run(typ,freq,data): - logging.debug("Throw Template Plugin") + logging.debug("Strat Plugin: template") try: logging.info("ZVEI: %s wurde auf %s empfangen!", data["zvei"],freq) logging.debug("try 5/0") From 10602eac92d503b5a40b289c1506482da132b1da Mon Sep 17 00:00:00 2001 From: Schrolli Date: Mon, 18 May 2015 15:33:34 +0200 Subject: [PATCH 12/12] edit interface info --- plugin_test/plugins/interface.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin_test/plugins/interface.txt b/plugin_test/plugins/interface.txt index f43a204..6d487c8 100644 --- a/plugin_test/plugins/interface.txt +++ b/plugin_test/plugins/interface.txt @@ -2,7 +2,7 @@ typ = FMS, ZVEI oder POC freq = Frequenz in Hz -daten[] als Python Dict +data = {"KEY":"VALUE"} als Python Dict ZVEI: - zvei