mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2026-04-05 06:25:10 +00:00
add line break to eMail plugin #71
This commit is contained in:
parent
f95a270177
commit
19653e5515
6 changed files with 53 additions and 39 deletions
|
|
@ -8,6 +8,10 @@ Global variables
|
|||
@author: Bastian Schroll
|
||||
"""
|
||||
|
||||
# version info
|
||||
versionNr = "2.1-dev"
|
||||
buildDate = "2015/07/28"
|
||||
|
||||
# Global variables
|
||||
config = 0
|
||||
script_path = ""
|
||||
|
|
@ -25,12 +29,4 @@ filterList = []
|
|||
# idDescribing
|
||||
fmsDescribtionList = {}
|
||||
zveiDescribtionList = {}
|
||||
ricDescribtionList = {}
|
||||
|
||||
# returns the version or build date
|
||||
# function -> read only in script
|
||||
def getVers(mode="vers"):
|
||||
if mode == "vers":
|
||||
return "2.1-dev"
|
||||
elif mode == "date":
|
||||
return "2015/07/27"
|
||||
ricDescribtionList = {}
|
||||
|
|
@ -7,6 +7,7 @@ little Helper to replace fast and easy the standard wildcards
|
|||
for direct use in plugins to save code
|
||||
|
||||
@author: Bastian Schroll
|
||||
@author: Jens Herrmann
|
||||
"""
|
||||
|
||||
import logging
|
||||
|
|
@ -14,7 +15,7 @@ import logging
|
|||
from includes.helper import timeHandler
|
||||
|
||||
|
||||
def replaceWildcards(text,data):
|
||||
def replaceWildcards(text, data, lineBrakeAllowed=False):
|
||||
"""
|
||||
Replace all official Wildcards with the Information from the data[] var
|
||||
|
||||
|
|
@ -22,6 +23,8 @@ def replaceWildcards(text,data):
|
|||
@param text: Input text with wildcards
|
||||
@type data: map
|
||||
@param data: map of data (structure see interface.txt)
|
||||
@type lineBrakeAllowed: Boolean
|
||||
@param lineBrakeAllowed: switch to allow lineBreak (%BR%) as wildcard
|
||||
|
||||
@return: text with replaced wildcards
|
||||
@exception: Exception if Error at replace
|
||||
|
|
@ -29,6 +32,12 @@ def replaceWildcards(text,data):
|
|||
try:
|
||||
# replace date and time wildcards
|
||||
text = text.replace("%TIME%", timeHandler.getTime()).replace("%DATE%", timeHandler.getDate())
|
||||
|
||||
# replace some special chars
|
||||
if lineBrakeAllowed == True:
|
||||
text = text.replace("%BR%", "\r\n")
|
||||
text = text.replace("%LPAR%", "(")
|
||||
text = text.replace("%RPAR%", ")")
|
||||
|
||||
# replace FMS data
|
||||
if "fms" in data: text = text.replace("%FMS%", data["fms"])
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ def printHeader(args):
|
|||
print " German BOS Information Script "
|
||||
print " by Bastian Schroll, Jens Herrmann "
|
||||
print ""
|
||||
print "SW Version: "+globals.getVers("vers")
|
||||
print "Build Date: "+globals.getVers("date")
|
||||
print "SW Version: "+globals.versionNr
|
||||
print "Build Date: "+globals.buildDate
|
||||
print ""
|
||||
|
||||
print "Frequency: "+args.freq
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue