From 5cddcf69d74ace39847962c6d8db268d48e42b4a Mon Sep 17 00:00:00 2001 From: Schrolli Date: Mon, 18 May 2015 14:49:10 +0200 Subject: [PATCH] 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: