- def _wikipage_to_wrinncache(self, inn_wiki):
- "Converts an inn wiki page to an inn wrinncache database record."
- 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'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 = value
- 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(self, inn_wiki):
+ # "Converts an inn wiki page to an inn wrinncache database record."
+ # 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'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 = value
+ # 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