From 346d5a41f669f7addf1c27e85094c661b8bc9fbc Mon Sep 17 00:00:00 2001 From: Schrolli Date: Wed, 27 May 2015 11:55:04 +0200 Subject: [PATCH] little changes for docu --- config/config.template.ini | 19 ++++++++++--------- includes/decoders/poc.py | 4 ++-- plugins/interface.txt | 28 ++++++++++++++-------------- 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/config/config.template.ini b/config/config.template.ini index 8e738e2..5c4c7fa 100644 --- a/config/config.template.ini +++ b/config/config.template.ini @@ -18,7 +18,7 @@ loglevel = 10 backupCount = 7 #Using RegEx-Filter (0|1) -#Filter-configuration in section "Filters" +#Filter-configuration in section [Filters] useRegExFilter = 1 [FMS] @@ -48,15 +48,19 @@ filter_range_end = 9999999 [Filters] #RegEX Filter Configuration +#http://www.regexr.com/ - RegEX Test Tool an Documentation #No Filter for a Typ/Plugin Combination = all Data pass #INDIVIDUAL_NAME = TYP;DATAFIELD;PLUGIN;REGEX #TYP = the Data Typ (FMS|ZVEI|POC) -#DATAFIELD = the field of the Data Array. See interface.txt for names. -#PLUGIN = the name of the Plugin to call with this Filter. +#DATAFIELD = the field of the Data Array (See interface.txt) +#PLUGIN = the name of the Plugin to call with this Filter #REGEX = the RegEX #only ZVEI to template with 25### -#testfilter = ZVEI;zvei;template;25[0-9F]{3} +#testfilter = ZVEI;zvei;template;25[0-9]{3} + +#only POCSAG to MySQL with the text "ALARM:" in the Message +#pocTest = POC;msg;MySQL;ALARM: [Plugins] @@ -106,9 +110,6 @@ poc_url = www.google.de ##### Not ready yet # ##################### - [template] -data1 = test123 -data2 = test345 -data3 = test567 -data4 = test789 \ No newline at end of file +test1 = testString +test2 = 123456 \ No newline at end of file diff --git a/includes/decoders/poc.py b/includes/decoders/poc.py index b58c8ca..c879246 100644 --- a/includes/decoders/poc.py +++ b/includes/decoders/poc.py @@ -19,14 +19,14 @@ from includes import globals # Global variables # Simple Filter def isAllowed(poc_id): """ - Simple Filter Functions (Allowed ,Denied and Range) + Simple Filter Functions (Allowed, Denied and Range) @type poc_id: string @param poc_id: POCSAG Ric @requires: Configuration has to be set in the config.ini - @return: True if the Ric is allows, other False + @return: True if the Ric is allowed, other False @exception: none """ # 1.) If allowed RICs is set, only they will path, diff --git a/plugins/interface.txt b/plugins/interface.txt index 016f079..3000604 100644 --- a/plugins/interface.txt +++ b/plugins/interface.txt @@ -1,12 +1,11 @@ -Übergabe an Plugin: - -typ = [FMS|ZVEI|POC] -freq = [FREQ(Hz)] -data = {"KEY1":"VALUE1","KEY2":"VALUE2"} als Python Dict +Handover to Plugin: +typ = [FMS|ZVEI|POC] +freq = [Freq in Hz] +data = {"KEY1":"VALUE1","KEY2":"VALUE2"} -Follgende Daten sind bei der jeweiligen Alarm-Art enthalten -und per data["OPTION"] abrufbar: +The following informations are included in the var "data". +They can be used by their Index Names: data['OPTION'] ZVEI: - zvei @@ -24,13 +23,14 @@ POCSAG: - bitrate -Es stehen folgende globale Objecte zur Verfügung: +Global Objects: -1.) import logging # Global logger -logging - Object -Nachricht ins Log per: logging.LOGLEVEL("MESSAGE") -Mögliche Loglevel: debug|info|warning|error|exception|critical +1.) +import logging # Global logger +Message into Log: logging.LOGLEVEL("MESSAGE") +Loglevel: debug|info|warning|error|exception|critical -2.) import globals # Global variables -config - Object (typ: ConfigParser, stellt config.ini bereit) +2.) +import globals # Global variables +reads Data from the config.ini VALUE = globals.config.get("SECTION", "OPTION") \ No newline at end of file