sharing/bday/trigger: disable by default, adjust fallback pattern
This commit is contained in:
@@ -2323,7 +2323,7 @@ Supported placeholders (data used from VCARD)
|
||||
* `{n:a}`: additional name (RFC6350#6.2.2)
|
||||
* `{nickname}`: nick name (RFC6350#6.2.3)
|
||||
|
||||
Fallback is supported if placeholders inside `{...|...}` (first successful resolved one is used)
|
||||
Fallback is supported if placeholders inside `[...|...]` (first successful resolved one is used)
|
||||
|
||||
##### conversion_bday_description_template
|
||||
|
||||
|
||||
5
config
5
config
@@ -357,13 +357,14 @@
|
||||
#default_permissions_create_map = r
|
||||
|
||||
# Global template for summary of conversion "bday"
|
||||
#conversion_bday_summary_template = "{{n:f} {n:g} {n:a}|{fn}|{nickname}} (BDAY)"
|
||||
#conversion_bday_summary_template = "[{n:f} {n:g} {n:a}|{fn}|{nickname}] (BDAY)"
|
||||
|
||||
# Global template for description of conversion "bday"
|
||||
#conversion_bday_description_template = "BDAY={year}-{month}-{day}"
|
||||
|
||||
# Global template of alarm trigger of conversion "bday"
|
||||
#conversion_bday_alarm_trigger_template = "-15H;BDAY tomorrow|9H;BDAY today"
|
||||
# Example: "-15H;BDAY tomorrow|9H;BDAY today"
|
||||
#conversion_bday_alarm_trigger_template = ""
|
||||
|
||||
[web]
|
||||
|
||||
|
||||
@@ -595,7 +595,7 @@ DEFAULT_CONFIG_SCHEMA: types.CONFIG_SCHEMA = OrderedDict([
|
||||
"help": "default permissions for map-based sharing",
|
||||
"type": rights_permission}),
|
||||
("conversion_bday_summary_template", {
|
||||
"value": "{{n:f} {n:g} {n:a}|{fn}|{nickname}} (BDAY)",
|
||||
"value": "[{n:f} {n:g} {n:a}|{fn}|{nickname}] (BDAY)",
|
||||
"help": "conversion bday summary template",
|
||||
"type": str}),
|
||||
("conversion_bday_description_template", {
|
||||
@@ -603,7 +603,7 @@ DEFAULT_CONFIG_SCHEMA: types.CONFIG_SCHEMA = OrderedDict([
|
||||
"help": "conversion bday description template",
|
||||
"type": str}),
|
||||
("conversion_bday_alarm_trigger_template", {
|
||||
"value": "-15H;BDAY tomorrow|9H;BDAY today",
|
||||
"value": "",
|
||||
"help": "conversion bday alarm trigger template",
|
||||
"type": str}),
|
||||
])),
|
||||
|
||||
@@ -509,8 +509,8 @@ class Item:
|
||||
text = text.replace(placeholder, placeholder_mapping[placeholder])
|
||||
|
||||
# resolve {..|..} recursive
|
||||
pattern = re.compile('(.*)({)([^|]+)\\|(.+)(})(.*)')
|
||||
logger.trace("item/convert_vcf_to_ics: resolve {..|..} starting with: %r", text)
|
||||
pattern = re.compile('(.*)(\\[)([^|]+)\\|(.+)(\\])(.*)')
|
||||
logger.trace("item/convert_vcf_to_ics: resolve [..|..] starting with: %r", text)
|
||||
while True:
|
||||
match = pattern.match(text)
|
||||
if not match:
|
||||
@@ -522,15 +522,15 @@ class Item:
|
||||
if '|' in match[4]:
|
||||
# further recursion required
|
||||
text = match[1] + match[2] + match[4] + match[5] + match[6]
|
||||
logger.trace("item/convert_vcf_to_ics: resolve {..|..} match/replace/continue result: %r", text)
|
||||
logger.trace("item/convert_vcf_to_ics: resolve [..|..] match/replace/continue result: %r", text)
|
||||
else:
|
||||
text = match[1] + match[4] + match[6]
|
||||
logger.trace("item/convert_vcf_to_ics: resolve {..|..} match/replace/final result: %r", text)
|
||||
logger.trace("item/convert_vcf_to_ics: resolve [..|..] match/replace/final result: %r", text)
|
||||
break
|
||||
else:
|
||||
# resolved variable
|
||||
text = match[1] + match[3] + match[6]
|
||||
logger.trace("item/convert_vcf_to_ics: resolve {..|..} match/replace(resolved) result: %r", text)
|
||||
logger.trace("item/convert_vcf_to_ics: resolve [..|..] match/replace(resolved) result: %r", text)
|
||||
return text
|
||||
|
||||
def trigger_to_timedelta(self, trigger) -> Union[datetime.timedelta, None]:
|
||||
|
||||
Reference in New Issue
Block a user