]> ToastFreeware Gitweb - philipp/winterrodeln/wradmin.git/blobdiff - wradmin/controllers/coordtool.py
Files after running 2to3.py.
[philipp/winterrodeln/wradmin.git] / wradmin / controllers / coordtool.py
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'))