]> ToastFreeware Gitweb - philipp/winterrodeln/wradmin.git/commitdiff
Files after running 2to3.py.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Thu, 27 Jul 2017 21:58:55 +0000 (21:58 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Thu, 27 Jul 2017 21:58:55 +0000 (21:58 +0000)
git-svn-id: http://www.winterrodeln.org/svn/wradmin/trunk@2662 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wradmin/controllers/bericht.py
wradmin/controllers/coordtool.py
wradmin/controllers/gasthaus.py
wradmin/controllers/rodelbahn.py
wradmin/controllers/wrgpxtool.py
wradmin/lib/helpers.py
wradmin/lib/wrgpx.py
wradmin/model/validators.py

index a8c2d77eb9c9cb5ddeab593ae1d5c4e7d374fbda..dfa56d6caafe9f2b7650caf278307c4b17d0d8fd 100644 (file)
@@ -78,29 +78,29 @@ class BerichtController(BaseController):
         elif date == 'now':           wrreport.date_invalid = c.date_now
         elif date == 'userdefined':   wrreport.date_invalid = self.form_result['date_userdefined']
         model.meta.Session.commit()
-        session['flash'] = u'Datum wurde erfolgreich geändert'
+        session['flash'] = 'Datum wurde erfolgreich geändert'
         session.save()
         return redirect(url(controller='bericht', action='view', id=id))
     
     
     def new(self, id):
         "Displays a form to create a new page"
-        return u"Nicht implementiert."
+        return "Nicht implementiert."
     
     
     def create(self):
         "Saves the information submitted from new() and redirects to view()"
-        return u"Nicht implementiert."
+        return "Nicht implementiert."
     
     
     def edit(self, id):
         "Displays a form for editing the page id"
-        return u"Nicht implementiert."
+        return "Nicht implementiert."
     
     
     def save(self, id):
         "Saves the page id and redirects to view()"
-        return u"Nicht implementiert."
+        return "Nicht implementiert."
     
     
     def list(self):
@@ -113,4 +113,4 @@ class BerichtController(BaseController):
     
     def delete(self, id):
         "Deletes a page"
-        return u"Nicht implementiert."
+        return "Nicht implementiert."
index e8180ee8a5dc5568cb35cd8f1f1edcddc71cdcdf..d0629d9cbe9dca4bfd1c8b7d9cb82fb0ff444dc9 100644 (file)
@@ -21,13 +21,13 @@ class CoordtoolController(BaseController):
 
     def convert(self):
         input = request.POST['input']
-        no_elevation = request.POST.has_key('no_elevation')
-        simplify = request.POST.has_key('simplify')
-        swap_latlon = request.POST.has_key('swap_latlon')
-        c.no_geoformat = request.POST.has_key('no_geoformat')
-        c.no_gpxformat = request.POST.has_key('no_gpxformat')
-        c.no_gmapsformat = request.POST.has_key('no_gmapsformat')
-        c.no_geocachingformat = request.POST.has_key('no_geocachingformat')
+        no_elevation = 'no_elevation' in request.POST
+        simplify = 'simplify' in request.POST
+        swap_latlon = 'swap_latlon' in request.POST
+        c.no_geoformat = 'no_geoformat' in request.POST
+        c.no_gpxformat = 'no_gpxformat' in request.POST
+        c.no_gmapsformat = 'no_gmapsformat' in request.POST
+        c.no_geocachingformat = 'no_geocachingformat' in request.POST
         
         if input is None or len(input.strip()) == 0: 
             c.result = None
@@ -35,8 +35,8 @@ class CoordtoolController(BaseController):
         
         geo = wrpylib.wrvalidators.MultiGeo()
         try: c.result = geo.to_python(input)
-        except formencode.Invalid, e:
-            session['flash'] = unicode(e)
+        except formencode.Invalid as e:
+            session['flash'] = str(e)
             session.save()
             return redirect(url(controller='coordtool', action='index'))
         
index d7ce5b519c99d2e259f27028a9eb141156a0d2ce..5125a78906c3f614975f699507474554aa770230 100644 (file)
@@ -42,14 +42,14 @@ class GasthausController(BaseController):
         try:
             wrpylib.wrmwcache.update_wrinncache(c)
             model.meta.Session.commit()
-            session['flash'] = u'Die Gasthausliste wurde erfolgreich aktualisiert.'
+            session['flash'] = 'Die Gasthausliste wurde erfolgreich aktualisiert.'
         except wrpylib.wrmwcache.UpdateCacheError as e:
-            title = unicode(e.args[1])
+            title = str(e.args[1])
             title = wrpylib.mwmarkup.to_title(title)
-            msg = unicode(e.args[2])
+            msg = str(e.args[2])
             msg = msg.replace('\n', '; ')
-            if len(e.args) == 3: session['flash'] = u"Fehler bei Gasthaus '{0}': {1}".format(title, msg)
-            else: session['flash'] = unicode(e)
+            if len(e.args) == 3: session['flash'] = "Fehler bei Gasthaus '{0}': {1}".format(title, msg)
+            else: session['flash'] = str(e)
         session.save()
         # Redirect to result page
         return redirect(url(controller='gasthaus', action='list'))
index d9906b6cc9a356fa59cb4d7faddd7571bd751cdf..19f2807f0836a8a74f7d8212d258003fe2da4202 100644 (file)
@@ -53,14 +53,14 @@ class RodelbahnController(BaseController):
         try:
             wrpylib.wrmwcache.update_wrsledruncache(c)
             model.meta.Session.commit()
-            session['flash'] = u'Die Rodelbahnliste wurde erfolgreich aktualisiert.'
+            session['flash'] = 'Die Rodelbahnliste wurde erfolgreich aktualisiert.'
         except wrpylib.wrmwcache.UpdateCacheError as e:
-            title = unicode(e.args[1])
+            title = str(e.args[1])
             title = wrpylib.mwmarkup.to_title(title)
-            msg = unicode(e.args[2])
+            msg = str(e.args[2])
             msg = msg.replace('\n', '; ')
-            if len(e.args) == 3: session['flash'] = u"Fehler bei Rodelbahn '{0}': {1}".format(title, msg)
-            else: session['flash'] = unicode(e)
+            if len(e.args) == 3: session['flash'] = "Fehler bei Rodelbahn '{0}': {1}".format(title, msg)
+            else: session['flash'] = str(e)
         session.save()
         # Redirect to result page
         return redirect(url(controller='rodelbahn', action='list'))
@@ -72,9 +72,9 @@ class RodelbahnController(BaseController):
         try:
             wrpylib.wrmwcache.update_wrregioncache(c)
             model.meta.Session.commit()
-            session['flash'] = u'Die Rodelbahneinträge in den Regionslisten wurden erfolgreich aktualisiert.'
+            session['flash'] = 'Die Rodelbahneinträge in den Regionslisten wurden erfolgreich aktualisiert.'
         except wrpylib.wrmwcache.UpdateCacheError as e:
-            session['flash'] = unicode(e)
+            session['flash'] = str(e)
         session.save()
         # Redirect to result page
         return redirect(url(controller='rodelbahn', action='list'))
index c98ff6c5b315abe544f3a6a53211daad1eaf2b19..6a2a1dce4b97ac83d284cfc988dc05429abe9c2e 100644 (file)
@@ -22,7 +22,7 @@ class WrgpxtoolController(BaseController):
     @restrict('POST')
     def upload(self):
         gpxfile = request.POST['gpxfile']
-        if gpxfile != u'':
+        if gpxfile != '':
             try:
                 set_lang('de')
                 (gpx, hints) = parse_wrgpx(string = gpxfile.value)            
@@ -30,18 +30,18 @@ class WrgpxtoolController(BaseController):
                 c.validation_hints = hints
                 c.validation_ok = len([hint for hint in hints if hint.level > 1]) == 0
                 session['wrgpx'] = gpx
-                if c.validation_ok: session['flash'] = u"Die Datei '%s' ist eine gültige GPX 1.1 Datei und entspricht zusätzlich den Winterrodeln Anforderungen (WRGPX). :-)" % gpxfile.filename
-                else: session['flash'] = u" Die Datei '%s' ist zwar eine gültige GPX 1.1 Datei, entspricht aber nicht den zusätzlichen Winterrodeln-Anforderungen. :-(" % gpxfile.filename
-            except etree.XMLSyntaxError, e:
+                if c.validation_ok: session['flash'] = "Die Datei '%s' ist eine gültige GPX 1.1 Datei und entspricht zusätzlich den Winterrodeln Anforderungen (WRGPX). :-)" % gpxfile.filename
+                else: session['flash'] = " Die Datei '%s' ist zwar eine gültige GPX 1.1 Datei, entspricht aber nicht den zusätzlichen Winterrodeln-Anforderungen. :-(" % gpxfile.filename
+            except etree.XMLSyntaxError as e:
                 c.validation_exception = e
                 c.validation_hints = []
                 c.validation_ok = False
-                session['flash'] = u"Die Datei '%s' ist keine gültige GPX 1.1 Datei. :-(" % gpxfile.filename
+                session['flash'] = "Die Datei '%s' ist keine gültige GPX 1.1 Datei. :-(" % gpxfile.filename
             c.validated = True
             c.filename = gpxfile.filename
         else:
             c.validated = False
-            session['flash'] = u"Bitte eine GPX-Datei angeben!"
+            session['flash'] = "Bitte eine GPX-Datei angeben!"
         session.save()
         return render('wrgpxtool.html')
     
@@ -49,7 +49,7 @@ class WrgpxtoolController(BaseController):
     def height_profile(self):
         response.content_type = 'image/png'
         response.charset = None
-        if session.has_key('wrgpx'):
+        if 'wrgpx' in session:
             wrgpx = session['wrgpx']
             s = height_profile(wrgpx)
             return s
index c2f5e920af8f1e39d7ded9e8463200b052c7ac3d..3e0247cbfe61bf593225a5e29cf21d145a234654 100644 (file)
@@ -13,18 +13,18 @@ from webhelpers.html.tags import file, form, end_form, submit
 def wiki(page_title=None):
     "Creates a link to the specified page in the www.winterrodeln.org wiki"
     if page_title is None: page_title = 'Hauptseite'
-    return u'http://www.winterrodeln.org/wiki/' + page_title
+    return 'http://www.winterrodeln.org/wiki/' + page_title
 
 
 def forum(forum=None):
     "Creates a link to the specified forum. If no id is given, a general link is created."
-    if forum is None: return u'http://winterrodeln-forum.org/'
-    return u'http://winterrodeln-forum.org/viewforum.php?f=%d' % forum
+    if forum is None: return 'http://winterrodeln-forum.org/'
+    return 'http://winterrodeln-forum.org/viewforum.php?f=%d' % forum
 
 
 def google_maps(latitude, longitude):
     "Builds an URL like http://maps.google.at/maps?q=47.200607,11.260007"
-    return u"http://maps.google.at/maps?q=%.6f,%.6f" % (latitude, longitude)
+    return "http://maps.google.at/maps?q=%.6f,%.6f" % (latitude, longitude)
 
 
 def bool(value):
@@ -43,6 +43,6 @@ def tristate_float(value):
 
 
 def public_transport(value):
-    if isinstance(value, long): value = int(value)
+    if isinstance(value, int): value = int(value)
     return wrpylib.wrvalidators.GermanPublicTransport().from_python(value)
 
index 2b9b314bfb45bc540f1cb7ce5ad82e4a150f258b..9ba5c813beb6bb6f311b3438a16242a3d213c190 100644 (file)
@@ -13,7 +13,7 @@ import numpy as np
 import matplotlib
 matplotlib.use('Agg')
 import matplotlib.pyplot as plt
-import StringIO
+import io
 from pylons.i18n.translation import _
 
 
@@ -43,7 +43,7 @@ class Waypoint:
         self.name = None           # name as string or None
         self.type = None           # type as string or None
     def __repr__(self):
-        return u"Waypoint %s" % unicode(self.name)
+        return "Waypoint %s" % str(self.name)
 
 
 class Track:
@@ -52,7 +52,7 @@ class Track:
         self.type = None           # type as string or None
         self.points = []           # one point is a tuple (lat, lon, ele) or (lat, lon, None)
     def __repr__(self):
-        return u"Track %s" % unicode(self.name)
+        return "Track %s" % str(self.name)
 
 
 class WrGpx:
@@ -134,10 +134,10 @@ def parse_wrgpx(filename=None, string=None):
         elif element.tag == ns+'wpt':
             waypoint = parse_wpt(element)
             wrgpx.waypoints.append(waypoint)
-            if waypoint.ele is None: hints.append(Hint(_(u"Elevation of waypoint '%s' should be given.") % unicode(waypoint), 1))
-            if waypoint.name is None: hints.append(Hint(_(u"Name of waypoint '%s' must be given.") % unicode(waypoint), 2))
-            if waypoint.type is None: hints.append(Hint(_(u"Type of waypoint '%s' must be given (Gasthaus, Bushaltestelle, ...)") % unicode(waypoint), 2))
-            if not waypoint.type in ['Gasthaus', 'Parkplatz', 'Bushaltestelle']: hints.append(Hint(_(u"Type of the waypoint '%s' has to be one of (Gasthaus, Bushaltestelle, ...)") % unicode(waypoint), 2))
+            if waypoint.ele is None: hints.append(Hint(_("Elevation of waypoint '%s' should be given.") % str(waypoint), 1))
+            if waypoint.name is None: hints.append(Hint(_("Name of waypoint '%s' must be given.") % str(waypoint), 2))
+            if waypoint.type is None: hints.append(Hint(_("Type of waypoint '%s' must be given (Gasthaus, Bushaltestelle, ...)") % str(waypoint), 2))
+            if not waypoint.type in ['Gasthaus', 'Parkplatz', 'Bushaltestelle']: hints.append(Hint(_("Type of the waypoint '%s' has to be one of (Gasthaus, Bushaltestelle, ...)") % str(waypoint), 2))
 
         # Routes
         elif element.tag == ns+'rte':
@@ -159,8 +159,8 @@ def parse_wrgpx(filename=None, string=None):
                             track.points.append((trkpt.lat, trkpt.lon, trkpt.ele))
                             if trkpt.ele is None: no_ele += 1
                         elif e.tag == ns+'extensions': hints.append(Hint(_("XML element extensions within XML element trkpt is not used by WRGPX."), 2))
-                    if no_ele > 0: hints.append(Hint(_(u"%d of %d track points have no elevation (%s).") % (no_ele, len(track.points), unicode(track)), 1))
-            if len(track.points) == 0: hints.append(Hint(_(u"track '%s' is empty.") % unicode(track), 2))
+                    if no_ele > 0: hints.append(Hint(_("%d of %d track points have no elevation (%s).") % (no_ele, len(track.points), str(track)), 1))
+            if len(track.points) == 0: hints.append(Hint(_("track '%s' is empty.") % str(track), 2))
             wrgpx.tracks.append(track)
 
         # Extensions
@@ -175,18 +175,18 @@ def height_profile(wrgpx):
     "Create a elevation profile for the wrgpx class. Raises a RuntimError in case of an error, otherwise returns the PNG file as string."
     proj_utm32 = mapnik.Projection("+proj=utm +zone=32 +ellps=WGS84 +datum=WGS84 +units=m +no_defs")
     bahntracks = [t for t in wrgpx.tracks if t.type=='Rodelbahn' and len(t.points) > 0]
-    if len(bahntracks) == 0: raise RuntimeError(_(u"There is no 'Rodelbahn' type track in the GPX file."))
+    if len(bahntracks) == 0: raise RuntimeError(_("There is no 'Rodelbahn' type track in the GPX file."))
 
     # Descending order and check
     for track in bahntracks:
-        if track.points[0][2] is None or track.points[-1][2] is None: raise RuntimeError(_(u'Track has no elevation data'))
+        if track.points[0][2] is None or track.points[-1][2] is None: raise RuntimeError(_('Track has no elevation data'))
         if track.points[0][2] < track.points[-1][2]: track.points[:] = track.points[::-1]
     bahntracks.sort(lambda x, y: -1 if x.points[0][2] > y.points[0][2] else 1)
     points = []
     for track in bahntracks: points.extend(track.points)
 
     points = np.array(points)
-    for i in xrange(len(points)):
+    for i in range(len(points)):
         c = mapnik.Coord(points[i][1], points[i][0])
         c = c.forward(proj_utm32)
         points[i][0] = c.y
@@ -207,12 +207,12 @@ def height_profile(wrgpx):
     plt.plot(x, h, color='black')
     plt.axis([axxmin, axxmax, axymin, axymax])
     plt.grid()
-    plt.xlabel(u'Strecke in m [%d m Gesamtstrecke]' % round(x[-1], -1))
-    plt.ylabel(u'Höhe in m [%d m Differenz]' % round(h[0]-h[-1]))
-    plt.title(u'%s - Höhenprofil' % wrgpx.metadata.name)
+    plt.xlabel('Strecke in m [%d m Gesamtstrecke]' % round(x[-1], -1))
+    plt.ylabel('Höhe in m [%d m Differenz]' % round(h[0]-h[-1]))
+    plt.title('%s - Höhenprofil' % wrgpx.metadata.name)
 
     width_px = 500
-    imgdata = StringIO.StringIO()
+    imgdata = io.StringIO()
     f.savefig(imgdata, dpi=width_px/plt.gcf().get_figwidth())
     s = imgdata.getvalue()
     imgdata.close()
index 05614955ea4b3a0276aca3eb595fc234fbefc5ec..9e0fb4c8cd18794afa776e0db9cd82a0b7d97263 100644 (file)
@@ -24,11 +24,11 @@ class NoneValidator(formencode.FancyValidator):
     
     def to_python(self, value):
         self.assert_string(value, None)
-        if value == u'': return self.python_none
+        if value == '': return self.python_none
         return self.validator.to_python(value)
     
     def from_python(self, value):
-        if value == self.python_none: return u''
+        if value == self.python_none: return ''
         return self.validator.from_python(value)
 
 
@@ -44,17 +44,17 @@ class NeinValidator(formencode.FancyValidator):
     >>> v.to_python(u'Nein')
     u'Nein'
     """
-    def __init__(self, validator, python_no=u'Nein'):
+    def __init__(self, validator, python_no='Nein'):
         self.validator = validator
         self.python_no = python_no
     
     def to_python(self, value):
         self.assert_string(value, None)
-        if value == u'Nein': return self.python_no
+        if value == 'Nein': return self.python_no
         return self.validator.to_python(value)
     
     def from_python(self, value):
-        if value == self.python_no: return u'Nein'
+        if value == self.python_no: return 'Nein'
         return self.validator.from_python(value)
 
 
@@ -63,10 +63,10 @@ class Unicode(formencode.FancyValidator):
     u'any string' <=> u'any string'"""
     def to_python(self, value):
         self.assert_string(value, None)
-        return unicode(value)
+        return str(value)
 
     def from_python(self, value):
-        return unicode(value)
+        return str(value)
 
 
 class UnicodeNone(NoneValidator):
@@ -91,7 +91,7 @@ class Unsigned(formencode.FancyValidator):
         return self.iv.to_python(value)
     
     def from_python(self, value):
-        return unicode(value)
+        return str(value)
 
 
 class UnsignedNone(NoneValidator):
@@ -146,11 +146,11 @@ class DictValidator(formencode.FancyValidator):
     
     def to_python(self, value):
         self.assert_string(value, None)
-        if not self.dict.has_key(value): raise formencode.Invalid("Key not found in dict.", value, None)
+        if value not in self.dict: raise formencode.Invalid("Key not found in dict.", value, None)
         return self.dict[value]
     
     def from_python(self, value):
-        for k, v in self.dict.iteritems():
+        for k, v in self.dict.items():
             if type(v) == type(value) and v == value: return k
         raise formencode.Invalid('Invalid value', value, None)
 
@@ -162,7 +162,7 @@ class GermanBoolNone(DictValidator):
     u'Nein' <=> False
     """
     def __init__(self):
-        DictValidator.__init__(self, {u'': None, u'Ja': True, u'Nein': False})
+        DictValidator.__init__(self, {'': None, 'Ja': True, 'Nein': False})
 
 
 class GermanTristateTuple(DictValidator):
@@ -172,7 +172,7 @@ class GermanTristateTuple(DictValidator):
     u'Teilweise' <=> (True,  True)
     u'Nein'      <=> (False, True)"""
     def __init__(self, yes_python = (True, False), no_python = (False, True), partly_python = (True, True), none_python = (None, None)):
-        DictValidator.__init__(self, {u'': none_python, u'Ja': yes_python, u'Nein': no_python, u'Teilweise': partly_python})
+        DictValidator.__init__(self, {'': none_python, 'Ja': yes_python, 'Nein': no_python, 'Teilweise': partly_python})
 
 
 class GermanTristateFloat(GermanTristateTuple):
@@ -198,20 +198,20 @@ class ValueComment(formencode.FancyValidator):
     
     def to_python(self, value):
         self.assert_string(value, None)
-        if value == u'':
+        if value == '':
             v = value
             c = value
         else:
             left = value.find('(')
             right = value.rfind(')')
             if left < 0 and right < 0:
-                if not self.comment_is_optional: raise formencode.Invalid(u'Mandatory comment not present', value, None)
+                if not self.comment_is_optional: raise formencode.Invalid('Mandatory comment not present', value, None)
                 v = value
-                c = u''
+                c = ''
             elif left >= 0 and right >= 0 and left < right:
                 v = value[:left].strip()
                 c = value[left+1:right].strip()
-            else: raise formencode.Invalid(u'Invalid format', value, None)
+            else: raise formencode.Invalid('Invalid format', value, None)
         return self.value_validator.to_python(v), self.comment_validator.to_python(c)
 
     def from_python(self, value):
@@ -219,8 +219,8 @@ class ValueComment(formencode.FancyValidator):
         v = self.value_validator.from_python(value[0])
         c = self.comment_validator.from_python(value[1])
         if len(c) > 0:
-            if len(v) > 0: return u'%s (%s)' % (v, c)
-            else: return u'(%s)' % c
+            if len(v) > 0: return '%s (%s)' % (v, c)
+            else: return '(%s)' % c
         return v
 
 
@@ -265,7 +265,7 @@ class GenericDateTime(formencode.FancyValidator):
     def to_python(self, value, state=None):
         self.assert_string(value, None)
         try: return datetime.datetime.strptime(value, self.date_time_format)
-        except ValueError, e: raise formencode.Invalid(str(e), value, None)
+        except ValueError as e: raise formencode.Invalid(str(e), value, None)
     
     def from_python(self, value, state=None):
         return value.strftime(self.date_time_format)
@@ -286,13 +286,13 @@ class Geo(formencode.FancyValidator):
     """Formats to coordinates '47.076207 N 11.453553 E' to the (latitude, longitude) tuplet."""
     def to_python(self, value):
         self.assert_string(value, None)
-        r = re.match(u'(\d+\.\d+) N (\d+\.\d+) E', value)
-        if r is None: raise formencode.Invalid(u"Coordinates '%s' have not a format like '47.076207 N 11.453553 E'" % value, value, None)
+        r = re.match('(\d+\.\d+) N (\d+\.\d+) E', value)
+        if r is None: raise formencode.Invalid("Coordinates '%s' have not a format like '47.076207 N 11.453553 E'" % value, value, None)
         return (float(r.groups()[0]), float(r.groups()[1]))
     
     def from_python(self, value):
         latitude, longitude = value
-        return u'%.6f N %.6f E' % (latitude, longitude)
+        return '%.6f N %.6f E' % (latitude, longitude)
 
 
 class GeoNone(NoneValidator):
@@ -327,13 +327,13 @@ class MultiGeo(formencode.FancyValidator):
         self.assert_string(value, None)
         input_format = self.input_format
         if not input_format in [self.FORMAT_GUESS, self.FORMAT_GEOCACHING, self.FORMAT_WINTERRODELN, self.FORMAT_GMAPPLUGIN, self.FORMAT_GPX]:
-            raise formencode.Invalid(u"input_format %d is not recognized" % input_format, value, None) # Shouldn't it be an other type of runtime error?
+            raise formencode.Invalid("input_format %d is not recognized" % input_format, value, None) # Shouldn't it be an other type of runtime error?
         lines = [line.strip() for line in value.split("\n") if len(line.strip()) > 0]
         
         result = []
         for line in lines:
             if input_format == self.FORMAT_GUESS or input_format == self.FORMAT_GEOCACHING:
-                r = re.match(u'N ?(\d+)° ?(\d+\.\d+) +E ?(\d+)° ?(\d+\.\d+)', line)
+                r = re.match('N ?(\d+)° ?(\d+\.\d+) +E ?(\d+)° ?(\d+\.\d+)', line)
                 if not r is None:
                     g = r.groups()
                     result.append((float(g[0]) + float(g[1])/60, float(g[2]) + float(g[3])/60, None))
@@ -341,14 +341,14 @@ class MultiGeo(formencode.FancyValidator):
                     continue
                     
             if input_format == self.FORMAT_GUESS or input_format == self.FORMAT_WINTERRODELN:
-                r = re.match(u'(\d+\.\d+) N (\d+\.\d+) E', line)
+                r = re.match('(\d+\.\d+) N (\d+\.\d+) E', line)
                 if not r is None:
                     result.append((float(r.groups()[0]), float(r.groups()[1]), None))
                     last_input_format = self.FORMAT_WINTERRODELN
                     continue
                 
             if input_format == self.FORMAT_GUESS or input_format == self.FORMAT_GMAPPLUGIN:
-                r = re.match(u'(\d+\.\d+), ?(\d+\.\d+)', line)
+                r = re.match('(\d+\.\d+), ?(\d+\.\d+)', line)
                 if not r is None:
                     result.append((float(r.groups()[0]), float(r.groups()[1]), None))
                     last_input_format = self.FORMAT_GMAPPLUGIN
@@ -367,7 +367,7 @@ class MultiGeo(formencode.FancyValidator):
                     continue
                 except (ExpatError, IndexError, ValueError): pass
 
-            raise formencode.Invalid(u"Coordinates '%s' have no known format" % line, value, None)
+            raise formencode.Invalid("Coordinates '%s' have no known format" % line, value, None)
             
         return result
     
@@ -377,20 +377,20 @@ class MultiGeo(formencode.FancyValidator):
         for latitude, longitude, height in value:
             if output_format == self.FORMAT_GEOCACHING:
                 degree = latitude
-                result.append(u'N %02d° %02.3f E %03d° %02.3f' % (latitude, latitude % 1 * 60, longitude, longitude % 1 * 60))
+                result.append('N %02d° %02.3f E %03d° %02.3f' % (latitude, latitude % 1 * 60, longitude, longitude % 1 * 60))
                 
             elif output_format == self.FORMAT_WINTERRODELN:
-                result.append(u'%.6f N %.6f E' % (latitude, longitude))
+                result.append('%.6f N %.6f E' % (latitude, longitude))
 
             elif output_format == self.FORMAT_GMAPPLUGIN:
-                result.append(u'%.6f, %.6f' % (latitude, longitude))
+                result.append('%.6f, %.6f' % (latitude, longitude))
                 
             elif output_format == self.FORMAT_GPX:
-                if not height is None: result.append(u'<trkpt lat="%.6f" lon="%.6f"><ele>%.2f</ele></trkpt>' % (latitude, longitude, height))
-                else: result.append(u'<trkpt lat="%.6f" lon="%.6f"/>' % (latitude, longitude))
+                if not height is None: result.append('<trkpt lat="%.6f" lon="%.6f"><ele>%.2f</ele></trkpt>' % (latitude, longitude, height))
+                else: result.append('<trkpt lat="%.6f" lon="%.6f"/>' % (latitude, longitude))
             
             else:
-                raise formencode.Invalid(u"output_format %d is not recognized" % output_format, value, None) # Shouldn't it be an other type of runtime error?
+                raise formencode.Invalid("output_format %d is not recognized" % output_format, value, None) # Shouldn't it be an other type of runtime error?
             
         return "\n".join(result)
 
@@ -420,7 +420,7 @@ class AustrianPhoneNumber(formencode.FancyValidator):
 
     def to_python(self, value):
         self.assert_string(value, None)
-        m = re.match(u'^(?:\+(\d+)/)?([\d/]+)(?:-(\d+))?$', value)
+        m = re.match('^(?:\+(\d+)/)?([\d/]+)(?:-(\d+))?$', value)
         # This will separate 
         #     u'+43/512/1234567-89'  => (u'43', u'512/1234567', u'89')
         #     u'+43/512/1234/567-89' => (u'43', u'512/1234/567', u'89')
@@ -430,13 +430,13 @@ class AustrianPhoneNumber(formencode.FancyValidator):
         (country, phone, extension) = m.groups()
         
         # Phone
-        if phone.find(u'//') > -1 or phone.count('/') == 0: raise formencode.Invalid(self.message('phoneFormat', None) % {'value': value}, value, None)
+        if phone.find('//') > -1 or phone.count('/') == 0: raise formencode.Invalid(self.message('phoneFormat', None) % {'value': value}, value, None)
         
         # Country
         if country is None:
             if phone[0] != '0': raise formencode.Invalid(self.message('phoneFormat', None) % {'value': value}, value, None)
             phone = phone[1:]
-            country = unicode(self.default_cc)
+            country = str(self.default_cc)
         
         if extension is None: return '+%s/%s' % (country, phone)
         return '+%s/%s-%s' % (country, phone, extension)
@@ -462,7 +462,7 @@ class GermanDifficulty(DictValidator):
     u'mittel' <=> 2
     u'schwer' <=> 3"""
     def __init__(self):
-        DictValidator.__init__(self, {u'': None, u'leicht': 1, u'mittel': 2, u'schwer': 3})
+        DictValidator.__init__(self, {'': None, 'leicht': 1, 'mittel': 2, 'schwer': 3})
 
 
 class GermanAvalanches(DictValidator):
@@ -474,7 +474,7 @@ class GermanAvalanches(DictValidator):
     u'gelegentlich' <=> 3
     u'häufig'       <=> 4"""
     def __init__(self):
-        DictValidator.__init__(self, {u'': None, u'kaum': 1, u'selten': 2, u'gelegentlich': 3, u'häufig': 4})
+        DictValidator.__init__(self, {'': None, 'kaum': 1, 'selten': 2, 'gelegentlich': 3, 'häufig': 4})
 
 
 class GermanPublicTransport(DictValidator):
@@ -488,7 +488,7 @@ class GermanPublicTransport(DictValidator):
     u'Nein'        <=> 5
     u'Ja'          <=> 6"""
     def __init__(self):
-        DictValidator.__init__(self, {u'': None, u'Sehr gut': 1, u'Gut': 2, u'Mittelmäßig': 3, u'Schlecht': 4, u'Nein': 5, u'Ja': 6})
+        DictValidator.__init__(self, {'': None, 'Sehr gut': 1, 'Gut': 2, 'Mittelmäßig': 3, 'Schlecht': 4, 'Nein': 5, 'Ja': 6})
 
 
 class GermanTristateFloatComment(ValueComment):
@@ -525,18 +525,18 @@ class GermanCachet(formencode.FancyValidator):
     u'Tiroler Naturrodelbahn-Gütesiegel 2009 mittel' <=> u'Tiroler Naturrodelbahn-Gütesiegel 2009 mittel'"""
     def to_python(self, value):
         self.assert_string(value, None)
-        if value == u'': return None
-        elif value == u'Nein': return value
-        elif value.startswith(u'Tiroler Naturrodelbahn-Gütesiegel '):
+        if value == '': return None
+        elif value == 'Nein': return value
+        elif value.startswith('Tiroler Naturrodelbahn-Gütesiegel '):
             p = value.split(" ")
             Unsigned().to_python(p[2]) # check if year can be parsed
             if not p[3] in ['leicht', 'mittel', 'schwer']: raise formencode.Invalid("Unbekannter Schwierigkeitsgrad", value, None)
             return value
-        else: raise formencode.Invalid(u"Unbekanntes Gütesiegel", value, None)
+        else: raise formencode.Invalid("Unbekanntes Gütesiegel", value, None)
     
     def from_python(self, value):
-        if value == None: return u''
-        assert value != u''
+        if value == None: return ''
+        assert value != ''
         return self.to_python(self, value)
 
 
@@ -546,10 +546,10 @@ class Url(formencode.FancyValidator):
     def to_python(self, value):
         self.assert_string(value, None)
         v = value
-        v = v.replace(u'ä', u'a')
-        v = v.replace(u'ö', u'o')
-        v = v.replace(u'ü', u'u')
-        v = v.replace(u'ß', u'ss')
+        v = v.replace('ä', 'a')
+        v = v.replace('ö', 'o')
+        v = v.replace('ü', 'u')
+        v = v.replace('ß', 'ss')
         v = self.urlv.to_python(v)
         return value
     
@@ -580,7 +580,7 @@ class PhoneNumber(formencode.FancyValidator):
         self.validator = formencode.national.InternationalPhoneNumber(default_cc=lambda: default_cc)
 
     def to_python(self, value):
-        return unicode(self.validator.to_python(value))
+        return str(self.validator.to_python(value))
 
     def from_python(self, value):
         return self.validator.from_python(value)
@@ -694,7 +694,7 @@ class GermanLift(BoolUnicodeTupleValidator):
     u'Sessellift (Wochenende); Taxi (6 Euro)' <=> (True, u'Sessellift (Wochenende); Taxi (6 Euro)')
     """
     def __init__(self):
-        BoolUnicodeTupleValidator.__init__(self, Loop(ValueCommentList(DictValidator({u'Sessellift': u'Sessellift', u'Gondel': u'Gondel', u'Linienbus': u'Linienbus', u'Taxi': u'Taxi', u'Sonstige': u'Sonstige'}))))
+        BoolUnicodeTupleValidator.__init__(self, Loop(ValueCommentList(DictValidator({'Sessellift': 'Sessellift', 'Gondel': 'Gondel', 'Linienbus': 'Linienbus', 'Taxi': 'Taxi', 'Sonstige': 'Sonstige'}))))
         
 
 class SledRental(BoolUnicodeTupleValidator):