docuReplacements = {'¶ms;': pagegenerators.parameterHelp}
-def str_or_none(value: Any) -> Optional[str]:
- if value is not None:
- return str(value)
- return None
-
-
def template_to_json(value: Template) -> dict:
parameter = []
for p in value.params:
def wikilink_to_json(value: Wikilink) -> dict:
wl = {'title': str(value.title)}
- text = str_or_none(value.text)
- if text is not None:
- wl['text'] = text
+ if value.text is not None:
+ wl['text'] = str(value.text)
return wl
z = node.get(2, None)
if z is not None:
ya['name_local'] = str(z)
- za = str_or_none(node.get(3, None))
- zb = str_or_none(node.get(4, None))
+ za = str(node.get(3, '')).strip()
+ zb = str(node.get(4, '')).strip()
z = lonlat_ele_to_json(opt_lonlat_from_str(za), opt_uint_from_str(zb))
if len(z) > 0:
ya['position'] = z
x = []
for w in v.ifilter_templates(matches='Parkplatz'):
- za = str_or_none(w.get(1, None))
- zb = str_or_none(w.get(2, None))
+ za = str(w.get(1, '')).strip()
+ zb = str(w.get(2, '')).strip()
z = lonlat_ele_to_json(opt_lonlat_from_str(za), opt_uint_from_str(zb))
if len(z) > 0:
x.append({'position': z})