removed lineBrakeAllowed

This commit is contained in:
Jockel 2017-04-25 10:52:03 +02:00
parent 4b296f1a39
commit 80a9cdb6f4
3 changed files with 8 additions and 11 deletions

View file

@ -17,7 +17,7 @@ from includes import globalVars
from includes.helper import timeHandler
def replaceWildcards(text, data, lineBrakeAllowed=False):
def replaceWildcards(text, data):
"""
Replace all official Wildcards with the Information from the data[] var
@ -25,8 +25,6 @@ def replaceWildcards(text, data, lineBrakeAllowed=False):
@param text: Input text with wildcards
@type data: map
@param data: map of data (structure see readme.md in plugin folder)
@type lineBrakeAllowed: Boolean
@param lineBrakeAllowed: switch to allow lineBreak (%BR%) as wildcard
@return: text with replaced wildcards
@exception: Exception if Error at replace
@ -36,8 +34,7 @@ def replaceWildcards(text, data, lineBrakeAllowed=False):
text = text.replace("%TIME%", timeHandler.getTime(data["timestamp"])).replace("%DATE%", timeHandler.getDate(data["timestamp"]))
# replace some special chars
if lineBrakeAllowed == True:
text = text.replace("%BR%", "\r\n")
text = text.replace("%BR%", "\r\n")
text = text.replace("%LPAR%", "(")
text = text.replace("%RPAR%", ")")

View file

@ -83,7 +83,7 @@ def run(typ,freq,data):
logging.debug("Compose output from POCSAG-message")
# compose message content
text = globalVars.config.get("Telegram","poc_message")
text = wildcardHandler.replaceWildcards(text, data, lineBrakeAllowed=True)
text = wildcardHandler.replaceWildcards(text, data)
# Initiate Telegram Bot
logging.debug("Initiate Telegram BOT")
bot = telegram.Bot(token='%s' % BOTTokenAPIKey)
@ -118,7 +118,7 @@ def run(typ,freq,data):
logging.debug("Compose output from FMS-message")
# compose message content
text = globalVars.config.get("Telegram","fms_message")
text = wildcardHandler.replaceWildcards(text, data, lineBrakeAllowed=True)
text = wildcardHandler.replaceWildcards(text, data)
# Initiate Telegram Bot
logging.debug("Initiate Telegram BOT")
@ -130,7 +130,7 @@ def run(typ,freq,data):
logging.debug("Compose output from ZVEI-message")
# compose message content
text = globalVars.config.get("Telegram","zvei_message")
text = wildcardHandler.replaceWildcards(text, data, lineBrakeAllowed=True)
text = wildcardHandler.replaceWildcards(text, data)
# Initiate Telegram Bot
logging.debug("Initiate Telegram BOT")

View file

@ -137,7 +137,7 @@ def run(typ,freq,data):
# read mailtext-structure from config.ini
mailtext = globalVars.config.get("eMail", "fms_message")
# replace wildcards with helper function
mailtext = wildcardHandler.replaceWildcards(mailtext, data, lineBrakeAllowed=True)
mailtext = wildcardHandler.replaceWildcards(mailtext, data)
# send eMail
doSendmail(server, subject, mailtext)
@ -157,7 +157,7 @@ def run(typ,freq,data):
# read mailtext-structure from config.ini
mailtext = globalVars.config.get("eMail", "zvei_message")
# replace wildcards with helper function
mailtext = wildcardHandler.replaceWildcards(mailtext, data, lineBrakeAllowed=True)
mailtext = wildcardHandler.replaceWildcards(mailtext, data)
# send eMail
doSendmail(server, subject, mailtext)
@ -177,7 +177,7 @@ def run(typ,freq,data):
# read mailtext-structure from config.ini
mailtext = globalVars.config.get("eMail", "poc_message")
# replace wildcards with helper function
mailtext = wildcardHandler.replaceWildcards(mailtext, data, lineBrakeAllowed=True)
mailtext = wildcardHandler.replaceWildcards(mailtext, data)
# send eMail
doSendmail(server, subject, mailtext)