From 5e516c65a6f2b2a924074a9243472c24bac9aa8f Mon Sep 17 00:00:00 2001 From: Jockel Date: Tue, 1 Nov 2016 10:18:47 +0100 Subject: [PATCH 1/2] added var for static sub ric messages --- config/config.template.ini | 7 +++++++ includes/helper/wildcardHandler.py | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/config/config.template.ini b/config/config.template.ini index fd55584..fe97270 100644 --- a/config/config.template.ini +++ b/config/config.template.ini @@ -98,6 +98,11 @@ filter_range_end = 9999999 # descriptions loaded from csv/poc.csv idDescribed = 0 +# Static Massages for Subrics. +rica = Feuer +ricb = TH +ricc = AGT +ricd = Unwetter [Filters] # RegEX Filter Configuration @@ -181,6 +186,7 @@ zvei_url = # %RIC% = Pocsag RIC # %FUNC% = Pocsac function/Subric (1-4) # %FUNCCHAR% = Pocsac function/Subric als character (a-d) +# %FUNCTEXT% = Pocsac function/Subric static massage definded in pocsag section # %MSG% = Message of the Pocsag telegram # %BITRATE% = Bitrate of the Pocsag telegram # %DESCR% = Description from csv-file @@ -237,6 +243,7 @@ zvei_message = %DATE% %TIME%: %ZVEI% # %RIC% = Pocsag RIC # %FUNC% = Pocsac function/Subric (1-4) # %FUNCCHAR% = Pocsac function/Subric als character (a-d) +# %FUNCTEXT% = Pocsac function/Subric static massage definded in pocsag section # %MSG% = Message of the Pocsag telegram # %BITRATE% = Bitrate of the Pocsag telegram # %DESCR% = Description, if description-module is used diff --git a/includes/helper/wildcardHandler.py b/includes/helper/wildcardHandler.py index d18ebe9..3f89f27 100644 --- a/includes/helper/wildcardHandler.py +++ b/includes/helper/wildcardHandler.py @@ -12,6 +12,8 @@ for direct use in plugins to save code import logging +from includes import globalVars + from includes.helper import timeHandler @@ -53,6 +55,10 @@ def replaceWildcards(text, data, lineBrakeAllowed=False): if "ric" in data: text = text.replace("%RIC%", data["ric"]) if "function" in data: text = text.replace("%FUNC%", data["function"]) if "functionChar" in data: text = text.replace("%FUNCCHAR%", data["functionChar"]) + if data["function"] == "1": text = text.replace("%FUNCTEXT%", globalVars.config.get("POC","rica")) + if data["function"] == "2": text = text.replace("%FUNCTEXT%", globalVars.config.get("POC","ricb")) + if data["function"] == "3": text = text.replace("%FUNCTEXT%", globalVars.config.get("POC","ricc")) + if data["function"] == "4": text = text.replace("%FUNCTEXT%", globalVars.config.get("POC","ricd")) if "msg" in data: text = text.replace("%MSG%", data["msg"]) if "bitrate" in data: text = text.replace("%BITRATE%", str(data["bitrate"])) From 60f7368c9db7696ee4efdf8f375c04faa67201e5 Mon Sep 17 00:00:00 2001 From: thejockel Date: Sun, 6 Nov 2016 09:17:53 +0100 Subject: [PATCH 2/2] Update README.md --- plugins/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/README.md b/plugins/README.md index 5352b47..093e510 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -158,6 +158,7 @@ defined wildcards: - `%RIC%` = Pocsag RIC - `%FUNC%` = Pocsac function/Subric (1-4) - `%FUNCCHAR%` = Pocsac function/Subric als character (a-d) +- `%FUNCTEXT%` = Pocsac function/Subric static massage definded in pocsag section - `%MSG%` = Message of the Pocsag telegram - `%BITRATE%` = Bitrate of the Pocsag telegram