+def wikipage_to_wrsleddingcache1_2(page_id, page_title, page_text):
+ """Converts a wiki page about a sledding route to a wradmin.model.WrSleddingCache1_2 class
+ that can be inserted to the wradmin.model.wrsleddingcache1_2_table.
+ It needs the wiki page id, the wiki page title and the page text ("old_text") as they come from the database."""
+ sl = model.WrSleddingCache1_2()
+ sl.page_id = page_id
+ sl.page_title = to_title(page_title)
+
+ # Match Rodelbahnbox
+ wikitext = page_text
+ regexp = re.compile(u"\{\{(Rodelbahnbox[^\}]*)\}\}", re.DOTALL)
+ match = regexp.search(wikitext)
+ if not match:
+ raise Exception(u"No 'Rodelbahnbox' found")
+ box = match.group(1)
+
+ # Process Rodelbahnbox
+ for property in box.split('|'):
+ property = property.strip()
+ if property == u'Rodelbahnbox': continue
+ key_value = property.split('=')
+ if len(key_value) != 2:
+ raise Exception(u"Property '%s' has unexpected format" % key_value)
+ key = key_value[0].strip()
+ value = key_value[1].strip()
+ if key == u'Rodelbahnnummer': pass
+ elif key == u'Länge': sl.length = conv(to_unsigned, value, u'Länge')
+ elif key == u'Gehzeit': sl.walktime = conv(to_unsigned, value, u'Gehzeit')
+ elif key == u'Höhe oben': sl.height_top = conv(to_unsigned, value, u'Höhe oben')
+ elif key == u'Höhe unten': sl.height_bottom = conv(to_unsigned, value, u'Höhe unten')
+ elif key == u'Aufstieg getrennt': sl.walkup_separate = conv(to_bool, value, u'Aufstieg getrennt')
+ elif key == u'Lift': sl.lift = conv(to_bool, value, u'Lift')
+ elif key == u'Beleuchtung': sl.night_light = conv(to_bool, value, u'Beleuchtung')
+ elif key == u'Rodelverleih': sl.sledge_rental = conv(to_bool, value, u'Rodelverleih')
+ elif key == u'Öffentliche Anreise': sl.public_transport = conv(to_bool, value, u'Öffentliche Anreise')
+ elif key == u'Bild': sl.image = conv(to_string, value, key)
+ elif key == u'Position': (sl.position_latitude, sl.position_longitude) = conv(to_geo, value, u'Position') # '47.583333 N 15.75 E'
+ elif key == u'Auskunft': sl.information = conv(to_phone_info, value, u'Auskunft')
+ elif key == u'In Übersichtskarte': sl.show_in_overview = conv(to_bool, value, u'In Übersichtskarte')
+ elif key == u'Aufnahmedatum': sl.creation_date = conv(to_date, value, u'Aufnahmedatum') # '2006-03-15'
+ elif key == u'Lawinengefahr':
+ # sl.avalanches is not part of the 1.2 sleddingcache table. We store it in the WrSleddingCache1_2 anyway.
+ sl.avalanches = conv(model.validators.GermanAvalanches().to_python, value, key)
+ else: raise formencode.Invalid(u"Unbekannte Eigenschaft der Rodelbahnbox: '%s' (mit Wert '%s')" % (key, value), value, None)
+ sl.under_construction = None
+
+ # Match Forumlink (e.g. {{Forumlink|68}})
+ match = re.search(u"\{\{Forumlink\|(\d+)\}\}", wikitext)
+ if match: sl.forum_id = match.group(1)
+
+ return sl
+
+
+def wikipage_to_wrsleddingcache(wiki_page):
+ """Converts a sled-route wiki page (wradmin.model.page_table)
+ to a sledding route wrsleddingcache database record (wradmin.model.wrsleddingcache_table).
+ Raises a RuntimeError if the format is not OK
+ sledding_wiki is a column of tabe "page".
+ Returns the WrSleddingCache class"""
+ sl = model.WrSleddingCache()
+ sl.page_id = wiki_page.page_id
+ sl.page_title = to_title(wiki_page.page_title)
+ errors = [] # List of errors with localized messages
+
+ # Match Rodelbahnbox
+ wikitext = wiki_page.old_text
+ regexp = re.compile(u"\{\{(Rodelbahnbox[^\}]*)\}\}", re.DOTALL)
+ match = regexp.search(wikitext)
+ if not match:
+ raise RuntimeError(_(u"No 'Rodelbahnbox' found"))
+ box = match.group(1)
+
+ # Process Rodelbahnbox
+ for property in box.split('|'):
+ property = property.strip()
+ if property == u'Rodelbahnbox': continue
+ key_value = property.split('=')
+ if len(key_value) != 2:
+ raise RuntimeError(_(u"Property '%s' has unexpected format") % key_value)
+ key = key_value[0].strip()
+ value = key_value[1].strip()
+ if key in [u'Rodelbahnnummer', u'Lift']:
+ errors.append(_("Property '%s' is not supported anymore, see %s.") % (key, 'http://www.winterrodeln.org/wiki/Vorlage:Rodelbahnbox'))
+ elif key == u'Position': (sl.position_latitude, sl.position_longitude) = conv(to_geo, value, key) # '47.583333 N 15.75 E'
+ elif key == u'Position oben': (sl.top_latitude, sl.top_longitude) = conv(to_geo, value, key) # '47.583333 N 15.75 E'
+ elif key == u'Höhe oben': sl.top_elevation = conv(to_unsigned, value, key) # '2000'
+ elif key == u'Position unten': (sl.bottom_latitude, sl.bottom_longitude) = conv(to_geo, value, key) # '47.583333 N 15.75 E'
+ elif key == u'Höhe unten': sl.bottom_elevation = conv(to_unsigned, value, key) # '1200'
+ elif key == u'Länge': sl.length = conv(to_unsigned, value, key) # 3500
+ elif key == u'Schwierigkeit': sl.difficulty = conv(model.validators.GermanDifficulty().to_python, value, key) # 'mittel'
+ elif key == u'Lawinen': sl.avalanches = conv(model.validators.GermanAvalanches().to_python, value, key) # 'kaum'
+ elif key == u'Betreiber': sl.operator = value # 'Max Mustermann'
+ elif key == u'Öffentliche Anreise': sl.public_transport = conv(model.validators.GermanPublicTransport().to_python, value, key) # 'Mittelmäßig'
+ elif key == u'Gehzeit': sl.walkup_time = conv(to_unsigned, value, key) # 90
+ elif key == u'Aufstieg getrennt': sl.walkup_separate, sl.walkup_separate_comment = conv(to_walkup_separate, value, key) # 'Ja'
+ elif key == u'Aufstiegshilfe': sl.lift, sl.lift_comment = conv(to_lift, value, key) # 'Gondel (unterer Teil)'
+ elif key == u'Beleuchtungsanlage': sl.night_light, sl.night_light_comment = conv(to_night_light, value, key)
+ elif key == u'Beleuchtungstage': sl.night_light_days, sl.night_light_days_comment = conv(to_night_light_days, value, key) # '3 (Montag, Mittwoch, Freitag)'
+ elif key == u'Rodelverleih': sl.sled_rental, sl.sled_rental_comment = conv(to_sled_rental, value, key) # 'Talstation Serlesbahnan'
+ elif key == u'Gütesiegel': sl.cachet = conv(to_cachet, value, key) # 'Tiroler Naturrodelbahn-Gütesiegel 2009 mittel'
+ elif key == u'Webauskunft': sl.information_web = conv(to_information_web, value, key) # 'http://www.nösslachhütte.at/page9.php'
+ elif key == u'Telefonauskunft': sl.information_phone = conv(to_information_phone, value, key) # '+43-664-5487520 (Mitterer Alm)'
+ elif key == u'Bild': sl.image = conv(to_string, value, key)
+ elif key == u'In Übersichtskarte': sl.show_in_overview = conv(to_bool, value, key)
+ elif key == u'Forumid': sl.forum_id = conv(to_forum_id, value, key)
+ else: raise formencode.Invalid(u"Unbekannte Eigenschaft der Rodelbahnbox: '%s' (mit Wert '%s')" % (key, value), value, None)
+ sl.under_construction = None
+ return sl
+
+
+def wrSleddingCache1_2_to_WrSleddingCache(wrSleddingCache1_2):
+ """Converts the old WrSleddingCache format (1.2) WrSleddingCache1_2
+ to the new format (1.3) WrSleddingCache."""
+ wrSleddingCache = model.WrSleddingCache() # Create an object in the new format
+ wrSleddingCache.page_id = wrSleddingCache1_2.page_id
+ wrSleddingCache.page_title = wrSleddingCache1_2.page_id
+ wrSleddingCache.position_latitude = wrSleddingCache1_2.position_latitude
+ wrSleddingCache.position_longitude = wrSleddingCache1_2.position_longitude
+ wrSleddingCache.top_latitude = None
+ wrSleddingCache.top_longitude = None
+ wrSleddingCache.top_elevation = wrSleddingCache1_2.height_top
+ wrSleddingCache.bottom_latitude = None
+ wrSleddingCache.bottom_longitude = None
+ wrSleddingCache.bottom_elevation = wrSleddingCache1_2.height_bottom
+ wrSleddingCache.length = wrSleddingCache1_2.length
+ wrSleddingCache.difficulty = None
+ if 'avalanches' in dir(wrSleddingCache1_2): wrSleddingCache.avalanches = wrSleddingCache1_2.avalanches
+ else: wrSleddingCache.avalanches = None
+ wrSleddingCache.operator = None
+ if wrSleddingCache1_2.public_transport is None: wrSleddingCache.public_transport = None
+ else: wrSleddingCache.public_transport = 6 if wrSleddingCache1_2.public_transport else 5
+ wrSleddingCache.walkup_time = wrSleddingCache1_2.walktime
+ if wrSleddingCache1_2.walkup_separate is None: wrSleddingCache.walkup_separate = None
+ wrSleddingCache.walkup_separate = 1.0 if wrSleddingCache1_2.walkup_separate else 0.0
+ wrSleddingCache.walkup_separate_comment = None
+ wrSleddingCache.lift = wrSleddingCache1_2.lift
+ if wrSleddingCache1_2.lift: wrSleddingCache.lift_details = "Ja"
+ else: wrSleddingCache.lift_details = None
+ if wrSleddingCache1_2.night_light is None: wrSleddingCache.night_light = None
+ else: wrSleddingCache.night_light = 1.0 if wrSleddingCache1_2.night_light else 0.0
+ wrSleddingCache.night_light_comment = None
+ wrSleddingCache.night_light_days = None
+ wrSleddingCache.night_light_days_comment = None
+ wrSleddingCache.sled_rental = wrSleddingCache1_2.sledge_rental
+ wrSleddingCache.sled_rental_comment = None
+ wrSleddingCache.cachet = None
+ wrSleddingCache.information_web = None
+ if wrSleddingCache1_2.information is None: wrSleddingCache.information_phone = None
+ else:
+ m = re.match('^([-\d/\+]{5,}) \((.+)\)', wrSleddingCache1_2.information)
+ if m is None: raise formencode.Invalid('PhoneInfo is invalid', value, None)
+ (phone, info) = m.groups()
+ # check phone
+ phone = wradmin.model.validators.AustrianPhoneNumber().to_python(phone)
+ # convert phone
+ c = formencode.national.InternationalPhoneNumber(default_cc=lambda: 43)
+ phone = c.to_python(phone)
+ wrSleddingCache.information_phone = '%s (%s)' % (phone, info)
+ wrSleddingCache.image = wrSleddingCache1_2.image
+ wrSleddingCache.show_in_overview = wrSleddingCache1_2.show_in_overview
+ wrSleddingCache.forum_id = wrSleddingCache1_2.forum_id
+ wrSleddingCache.under_construction = wrSleddingCache1_2.under_construction
+ return wrSleddingCache
+
+
+def wrSleddingCache_to_Rodelbahnbox(wrSleddingCache):
+ """Converts the WrSleddingCache class to the {{Rodelbahnbox}} representation.
+wrSleddingCache.cachet
+wrSleddingCache.forum_id
+wrSleddingCache.image
+wrSleddingCache.information_phone
+wrSleddingCache.information_web
+wrSleddingCache.lift
+wrSleddingCache.lift_details
+wrSleddingCache.night_light
+wrSleddingCache.night_light_comment
+wrSleddingCache.night_light_days
+wrSleddingCache.night_light_days_comment
+wrSleddingCache.show_in_overview
+wrSleddingCache.sled_rental
+wrSleddingCache.sled_rental_comment
+wrSleddingCache.under_construction
+ """
+ keys = []
+ values = []
+ keys.append(u'Position')
+ values.append(wradmin.model.validators.Geo().from_python((wrSleddingCache.position_latitude, wrSleddingCache.position_longitude)))
+ keys.append(u'Position oben')
+ values.append(wradmin.model.validators.Geo().from_python((wrSleddingCache.top_latitude, wrSleddingCache.top_longitude)))
+ keys.append(u'Höhe oben')
+ values.append(from_unsigned(wrSleddingCache.top_elevation))
+ keys.append(u'Position unten')
+ values.append(wradmin.model.validators.Geo().from_python((wrSleddingCache.bottom_latitude, wrSleddingCache.bottom_longitude)))
+ keys.append(u'Höhe unten')
+ values.append(from_unsigned(wrSleddingCache.bottom_elevation))
+ keys.append(u'Länge')
+ values.append(from_unsigned(wrSleddingCache.length))
+ keys.append(u'Schwierigkeit')
+ values.append(model.validators.GermanDifficulty().from_python(wrSleddingCache.difficulty))
+ keys.append(u'Lawinen')
+ values.append(model.validators.GermanAvalanches().from_python(wrSleddingCache.avalanches))
+ keys.append(u'Betreiber')
+ values.append(formencode.validators.String().from_python(wrSleddingCache.operator))
+ keys.append(u'Öffentliche Anreise')
+ values.append(model.validators.GermanPublicTransport().from_python(wrSleddingCache.public_transport))
+ keys.append(u'Gehzeit')
+ values.append(from_unsigned(wrSleddingCache.walkup_time))
+ keys.append(u'Aufstieg getrennt')
+ v = model.validators.GermanTristateFloat().from_python(wrSleddingCache.walkup_separate)
+ if not wrSleddingCache.walkup_separate_comment is None: v += ' (%s)' % wrSleddingCache.walkup_separate_comment
+ values.append(v)
+
+ b = u"""
+| Aufstiegshilfe = Gondel (unterer Teil)
+| Beleuchtungsanlage = Ja
+| Beleuchtungstage = 3 (Montag, Mittwoch, Freitag)
+| Rodelverleih = Ja (Talstation Serlesbahnan)
+| Gütesiegel = Tiroler Naturrodelbahn-Gütesiegel 2009 mittel
+| Webauskunft = http://www.nösslachhütte.at/page9.php
+| Telefonauskunft = +43-664-5487520 (Mitterer Alm)
+| Bild = Rodelbahn_Mitterer_Alm_04.jpg
+| In Übersichtskarte = Ja
+| Forumid = 33
+}}
+ """
+
+ c = u"""
+ keys.append(u'Betreiber')
+ values.append(formencode.validators.String().from_python(wrInnCache.operator))
+ keys.append(u'Sitzplätze')
+ values.append(from_unsigned(wrInnCache.seats))
+ keys.append(u'Übernachtung')
+ values.append(from_overnight(wrInnCache.overnight, wrInnCache.overnight_comment))
+ keys.append(u'Rauchfrei')
+ values.append(wradmin.model.validators.GermanTristate.from_python((wrInnCache.nonsmoker_area, wrInnCache.smoker_area)))
+ keys.append(u'Rodelverleih')
+ values.append(from_sled_rental_inn(wrInnCache.sled_rental, wrInnCache.sled_rental_comment))
+ keys.append(u'Handyempfang')
+ values.append(formencode.validators.String().from_python(wrInnCache.mobile_provider))
+ keys.append(u'Homepage')
+ values.append(formencode.validators.String().from_python(wrInnCache.homepage))
+ keys.append(u'E-Mail')
+ values.append(formencode.validators.String().from_python(wrInnCache.email_list))
+ keys.append(u'Telefon')
+ values.append(formencode.validators.String().from_python(wrInnCache.phone_list))
+ keys.append(u'Bild')
+ values.append(formencode.validators.String().from_python(wrInnCache.image))
+ keys.append(u'Rodelbahnen')
+ values.append(formencode.validators.String().from_python(wrInnCache.sledding_list))
+ """
+ result = [u'{{Rodelbahnbox']
+ for i in xrange(len(keys)): result.append(u'| %-20s = %s' % (keys[i], values[i]))
+ result.append('}}\n')
+ return '\n'.join(result)
+
+
+def wikipage_to_wrinncache1_2(page_id, page_title, page_text):
+ """Converts a wiki page about an inn to an wradmin.model.WrInnCache1_2 class
+ that can be inserted to the wradmin.model.wrinncache1_2_table.
+ It uses only text operations and does not query or update the database.
+ It needs the wiki page id, the wiki page title and the page text ("old_text") as they come from the database."""
+ inn = model.WrInnCache1_2()
+ inn.page_id = page_id
+ inn.page_title = to_title(page_title)
+
+ # Match Gasthausbox
+ wikitext = page_text
+ regexp = re.compile(u"\{\{(Gasthausbox[^\}]*)\}\}", re.DOTALL)
+ match = regexp.search(wikitext)
+ if not match:
+ raise Exception(u"No 'Gasthausbox' found")
+ box = match.group(1)
+
+ # Process Gashausbox
+ for property in box.split('|'):
+ property = property.strip()
+ if property == u'Gasthausbox': continue
+ key_value = property.split('=')
+ if len(key_value) != 2:
+ raise Exception(u"Property '%s' has unexpected format" % key_value)
+ key = key_value[0].strip()
+ value = key_value[1].strip()
+ if key == u'Gasthausnummer': pass
+ elif key == u'E-Mail': inn.email = conv(to_email, value, u'E-Mail')
+ elif key == u'Homepage': inn.homepage = conv(to_url, value, u'Homepage')
+ elif key == u'Höhe': inn.height = conv(to_unsigned, value, u'Höhe')
+ elif key == u'Bild': inn.image = conv(to_string, value, key)
+ elif key == u'Position': inn.position_latitude, inn.position_longitude = conv(to_geo, value, u'Position') # '47.583333 N 15.75 E'
+ elif key == u'Telefon (Festnetz)': inn.phone = conv(to_phone, value, u'Telefon (Festnetz)')
+ elif key == u'Telefon (Mobil)': inn.mobile_phone = conv(to_phone, value, u'Telefon (Mobil)')
+ elif key == u'Rauchfrei': inn.nonsmoker_area, inn.smoker_area = conv(to_tristate, value, u'Rauchfrei')
+ elif key == u'Aufnahmedatum': inn.creation_date = conv(to_date, value, u'Aufnahmedatum') # '2006-03-15'
+ else: raise formencode.Invalid(u"Unbekannte Eigenschaft der Gasthausbox: '%s' (mit Wert '%s')" % (key, value), value, None)
+ inn.under_construction = None
+ return inn
+
+
+def wikipage_to_wrinncache(wiki_page):
+ """Converts a inn wiki page (wradmin.model.page_table) to a wrinncache database record
+ (wradmin.model.wrinncache_table)."""
+ inn = model.WrInnCache()
+ inn.page_id = inn_wiki.page_id
+ inn.page_title = to_title(inn_wiki.page_title)
+
+ # Match Gasthausbox
+ wikitext = inn_wiki.old_text
+ regexp = re.compile(u"\{\{(Gasthausbox[^\}]*)\}\}", re.DOTALL)
+ match = regexp.search(wikitext)
+ if not match:
+ raise Exception(u"No 'Gasthausbox' found")
+ box = match.group(1)
+
+ # Process Gashausbox
+ for property in box.split('|'):
+ property = property.strip()
+ if property == u'Gasthausbox': continue
+ key_value = property.split('=')
+ if len(key_value) != 2:
+ raise Exception(u"Property '%s' has unexpected format" % key_value)
+ key = key_value[0].strip()
+ value = key_value[1].strip()
+ if key == u'Position': (inn.position_latitude, inn.position_longitude) = conv(to_geo, value, key) # '47.583333 N 15.75 E'
+ elif key == u'Höhe': inn.position_elevation = conv(to_unsigned, value, key)
+ elif key == u'Operator': inn.operator = conv(to_string, value, key)
+ elif key == u'Sitzplätze': inn.seats = conv(to_unsigned, value, key)
+ elif key == u'Übernachtung': inn.overnight, inn.overnight_comment = conv(to_overnight, value, key)
+ elif key == u'Rauchfrei': inn.nonsmoker_area, inn.smoker_area = conv(to_tristate, value, key)
+ elif key == u'Rodelverleih': inn.sled_rental, inn.sled_rental_comment = conv(to_sled_rental_inn, value, key)
+ elif key == u'Handyempfang': inn.mobile_provider = conv(to_mobile_provider, value, key)
+ elif key == u'Homepage': inn.homepage = conv(to_information_web, value, key)
+ elif key == u'E-Mail': inn.email, inn.email_comment, inn.email_list = conv(to_email_list, value, key)
+ elif key == u'Telefon': inn.phone, inn.phone_comment, inn.phone_list = conv(to_phone_list, value, key)
+ elif key == u'Bild': inn.image = conv(to_string, value, key)
+ elif key == u'Rodelbahnen': inn.sledding_list = conv(to_sledding_list, value, key)
+ else: raise formencode.Invalid(u"Unbekannte Eigenschaft der Gasthausbox: '%s' (mit Wert '%s')" % (key, value), value, None)
+ inn.under_construction = None
+ return inn
+
+
+def wrInnCache1_2_to_WrInnCache(wrInnCache1_2):
+ """Converts the old WrInnCache format to the new format."""
+ wrInnCache = model.WrInnCache() # Create an object in the new format
+ wrInnCache.page_id = wrInnCache1_2.page_id
+ wrInnCache.page_title = wrInnCache1_2.page_id
+ wrInnCache.position_latitude = wrInnCache1_2.position_latitude
+ wrInnCache.position_longitude = wrInnCache1_2.position_longitude
+ wrInnCache.position_elevation = wrInnCache1_2.height
+ wrInnCache.operator = None
+ wrInnCache.seats = None
+ wrInnCache.overnight = None
+ wrInnCache.overnight_comment = None
+ wrInnCache.smoker_area = wrInnCache1_2.smoker_area
+ wrInnCache.nonsmoker_area = wrInnCache1_2.nonsmoker_area
+ wrInnCache.sled_rental = None
+ wrInnCache.sled_rental_comment = None
+ wrInnCache.mobile_provider = None
+ wrInnCache.homepage = wrInnCache1_2.homepage
+ wrInnCache.email = wrInnCache1_2.email
+ wrInnCache.email_comment = None
+ wrInnCache.email_list = wrInnCache1_2.email
+ phone_list = []
+ c = formencode.national.InternationalPhoneNumber(default_cc=lambda: 43)
+ if not wrInnCache1_2.phone is None: phone_list.append(c.to_python(wrInnCache1_2.phone))
+ if not wrInnCache1_2.mobile_phone is None: phone_list.append(c.to_python(wrInnCache1_2.mobile_phone))
+ if len(phone_list) >= 1: wrInnCache.phone = phone_list[0]
+ else: wrInnCache.phone = None
+ wrInnCache.phone_comment = None
+ wrInnCache.phone_list = "; ".join(phone_list)
+ wrInnCache.image = wrInnCache1_2.image
+ wrInnCache.sledding_list = None
+ wrInnCache.under_construction = wrInnCache1_2.under_construction
+ return wrInnCache
+
+
+def wrInnCache_to_Gasthausbox(wrInnCache):
+ """Converts the WrInnCache class to the {{Gasthausbox}} representation."""
+ keys = []
+ values = []
+ keys.append(u'Position')
+ values.append(wradmin.model.validators.Geo().from_python((wrInnCache.position_latitude, wrInnCache.position_longitude)))
+ keys.append(u'Höhe')
+ values.append(from_unsigned(wrInnCache.position_elevation))
+ keys.append(u'Betreiber')
+ values.append(formencode.validators.String().from_python(wrInnCache.operator))
+ keys.append(u'Sitzplätze')
+ values.append(from_unsigned(wrInnCache.seats))
+ keys.append(u'Übernachtung')
+ values.append(from_overnight(wrInnCache.overnight, wrInnCache.overnight_comment))
+ keys.append(u'Rauchfrei')
+ values.append(wradmin.model.validators.GermanTristate.from_python((wrInnCache.nonsmoker_area, wrInnCache.smoker_area)))
+ keys.append(u'Rodelverleih')
+ values.append(from_sled_rental_inn(wrInnCache.sled_rental, wrInnCache.sled_rental_comment))
+ keys.append(u'Handyempfang')
+ values.append(formencode.validators.String().from_python(wrInnCache.mobile_provider))
+ keys.append(u'Homepage')
+ values.append(formencode.validators.String().from_python(wrInnCache.homepage))
+ keys.append(u'E-Mail')
+ values.append(formencode.validators.String().from_python(wrInnCache.email_list))
+ keys.append(u'Telefon')
+ values.append(formencode.validators.String().from_python(wrInnCache.phone_list))
+ keys.append(u'Bild')
+ values.append(formencode.validators.String().from_python(wrInnCache.image))
+ keys.append(u'Rodelbahnen')
+ values.append(formencode.validators.String().from_python(wrInnCache.sledding_list))
+ result = [u'{{Gasthausbox']
+ for i in xrange(len(keys)): result.append(u'| %-17s = %s' % (keys[i], values[i]))
+ result.append('}}\n')
+ return '\n'.join(result)
+
+
+