from wrpylib.wrmwmarkup import create_sledrun_wiki, lonlat_to_json, lonlat_ele_to_json, parse_wrmap
from wrpylib.wrvalidators import rodelbahnbox_from_template, tristate_german_to_str, difficulty_german_to_str, \
- avalanches_german_to_str, public_transport_german_to_str, opt_str_opt_comment_enum_to_str, opt_lonlat_from_str, \
+ avalanches_german_to_str, public_transport_german_to_str, opt_lonlat_from_str, \
opt_uint_from_str
from pywikibot.site import Namespace
if v is not None:
sledrun_json['nightlight_possible'] = tristate_german_to_str(v)
if w is not None:
- sledrun_json['nightlight_description'] = w
+ sledrun_json['nightlight_possible_comment'] = w
v, w = rbb['Beleuchtungstage']
if v is not None:
x = []
for v in wikicode.get_sections(levels=[2], matches='Allgemeines'):
+ def _nightlight(value: str) -> Optional[str]:
+ line_iter = io.StringIO(value)
+ line = next(line_iter, None)
+ while line is not None and not line.startswith("* '''Beleuchtung''':"):
+ line = next(line_iter, None)
+ if line is None:
+ return None
+ line = line.replace("* '''Beleuchtung''':", "").strip()
+ if len(line) > 0:
+ return line
+ return None
+ w = _nightlight(str(v))
+ if w is not None:
+ sledrun_json['nightlight_description'] = w
+
def _gastronomy(value: str):
gastronomy = []
line_iter = io.StringIO(value)
from wrpylib.wrvalidators import LonLat, opt_lonlat_from_str, opt_lonlat_to_str, opt_uint_from_str, opt_uint_to_str, \
opt_str_opt_comment_enum_to_str, lift_german_to_str, webauskunft_to_str, cachet_german_to_str, \
opt_phone_comment_enum_to_str, lift_german_from_str, GASTHAUSBOX_DICT, opt_difficulty_german_from_str, \
- opt_avalanches_german_from_str, nightlightdays_from_str, opt_public_transport_german_from_str, \
+ opt_avalanches_german_from_str, opt_public_transport_german_from_str, \
opt_tristate_german_comment_from_str, rodelbahnbox_to_str, lonlat_to_str, opt_no_or_str_to_str, \
- opt_no_or_str_from_str
+ opt_no_or_str_from_str, opt_tristate_german_from_str
def split_lon_lat(value: Optional[LonLat]) -> Union[LonLat, Tuple[None, None]]:
('Aufstieg getrennt', opt_tristate_german_comment_from_str(sledrun_json.get('walkup_separate', ''))),
('Gehzeit', sledrun_json.get('walkup_time')),
('Aufstiegshilfe', aufstiegshilfe()),
- ('Beleuchtungsanlage', opt_tristate_german_comment_from_str(sledrun_json.get('nightlight_possible', ''))),
+ ('Beleuchtungsanlage', (opt_tristate_german_from_str(sledrun_json.get('nightlight_possible', '')),
+ sledrun_json.get('nightlight_possible_comment'))),
('Beleuchtungstage', (sledrun_json.get('nightlight_weekdays_count'),
sledrun_json.get('nightlight_weekdays_comment'))),
('Rodelverleih', rodelverleih()),