]> ToastFreeware Gitweb - philipp/winterrodeln/wradmin.git/commitdiff
Changed encoding to UTF-8.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Thu, 27 Jul 2017 21:58:58 +0000 (21:58 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Thu, 27 Jul 2017 21:58:58 +0000 (21:58 +0000)
git-svn-id: http://www.winterrodeln.org/svn/wradmin/trunk@2663 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wradmin/controllers/bericht.py
wradmin/controllers/coordtool.py
wradmin/controllers/gasthaus.py
wradmin/controllers/map.py
wradmin/controllers/rodelbahn.py
wradmin/controllers/wrgpxtool.py
wradmin/lib/mediawiki.py
wradmin/lib/wrgpx.py
wradmin/model/validators.py
wradmin/tests/test_lib.py
wradmin/tests/test_models.py

index dfa56d6caafe9f2b7650caf278307c4b17d0d8fd..6d95dfdc637d59cd965ffbf268bc5fe1b593ff2c 100644 (file)
@@ -1,4 +1,3 @@
-# -*- coding: iso-8859-15 -*-
 import logging
 
 from pylons import request, response, session, url, tmpl_context as c
 import logging
 
 from pylons import request, response, session, url, tmpl_context as c
@@ -78,7 +77,7 @@ 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()
         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'] = 'Datum wurde erfolgreich geändert'
+        session['flash'] = 'Datum wurde erfolgreich geändert'
         session.save()
         return redirect(url(controller='bericht', action='view', id=id))
     
         session.save()
         return redirect(url(controller='bericht', action='view', id=id))
     
index d0629d9cbe9dca4bfd1c8b7d9cb82fb0ff444dc9..572a7cd51c0aeedd7e74b2737d78ed1d3a8f6fe5 100644 (file)
@@ -1,6 +1,4 @@
 #!/usr/bin/python2.6
 #!/usr/bin/python2.6
-# -*- coding: iso-8859-15 -*-
-
 import logging
 
 from pylons import request, response, session, url, tmpl_context as c
 import logging
 
 from pylons import request, response, session, url, tmpl_context as c
index 5125a78906c3f614975f699507474554aa770230..e68f711b1c9bc6bb1d659d7f28b4d71e18ea3ccb 100644 (file)
@@ -1,5 +1,4 @@
 #!/usr/bin/python2.6
 #!/usr/bin/python2.6
-# -*- coding: iso-8859-15 -*-
 import logging
 
 from pylons import request, response, session, url, tmpl_context as c
 import logging
 
 from pylons import request, response, session, url, tmpl_context as c
index acb9bc83002a70ead87817fc56ba96ec150c357f..845a2ad058639c672f0ccf79d49c68f5e9f316ab 100644 (file)
@@ -1,5 +1,4 @@
 #!/usr/bin/python2.6
 #!/usr/bin/python2.6
-# -*- coding: iso-8859-15 -*-
 from pylons import request, response, session, url, tmpl_context as c
 from pylons.controllers.util import abort, redirect
 
 from pylons import request, response, session, url, tmpl_context as c
 from pylons.controllers.util import abort, redirect
 
index 19f2807f0836a8a74f7d8212d258003fe2da4202..92ebff776d9f19cc67c72f2d642c0670a1a7d529 100644 (file)
@@ -1,5 +1,4 @@
 #!/usr/bin/python2.6
 #!/usr/bin/python2.6
-# -*- coding: iso-8859-15 -*-
 import logging
 
 from pylons import request, response, session, url, tmpl_context as c
 import logging
 
 from pylons import request, response, session, url, tmpl_context as c
@@ -72,7 +71,7 @@ class RodelbahnController(BaseController):
         try:
             wrpylib.wrmwcache.update_wrregioncache(c)
             model.meta.Session.commit()
         try:
             wrpylib.wrmwcache.update_wrregioncache(c)
             model.meta.Session.commit()
-            session['flash'] = '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'] = str(e)
         session.save()
         except wrpylib.wrmwcache.UpdateCacheError as e:
             session['flash'] = str(e)
         session.save()
index 6a2a1dce4b97ac83d284cfc988dc05429abe9c2e..17e6bd02ab69fdd2f259de3c0924c2f55e738f3a 100644 (file)
@@ -1,6 +1,4 @@
 #!/usr/bin/python2.6
 #!/usr/bin/python2.6
-# -*- coding: iso-8859-15 -*-
-
 import logging
 
 from pylons import request, response, session, url, tmpl_context as c
 import logging
 
 from pylons import request, response, session, url, tmpl_context as c
@@ -30,13 +28,13 @@ class WrgpxtoolController(BaseController):
                 c.validation_hints = hints
                 c.validation_ok = len([hint for hint in hints if hint.level > 1]) == 0
                 session['wrgpx'] = gpx
                 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'] = "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
+                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
             except etree.XMLSyntaxError as e:
                 c.validation_exception = e
                 c.validation_hints = []
                 c.validation_ok = False
-                session['flash'] = "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 = True
             c.filename = gpxfile.filename
         else:
index 8f7cbf4b3c70978dfc0742deae0c5b1dc12bf09c..23c8814008159fa2a0fffc2e91d02672c7d96d0a 100644 (file)
@@ -1,5 +1,4 @@
 #!/usr/bin/python2.6
 #!/usr/bin/python2.6
-# -*- coding: iso-8859-15 -*-
 # $Id$
 "MediaWiki communication functions"
 import datetime
 # $Id$
 "MediaWiki communication functions"
 import datetime
index 9ba5c813beb6bb6f311b3438a16242a3d213c190..742a3737db89f52b76efb40f0e2cbbb2005d0293 100644 (file)
@@ -1,5 +1,4 @@
 #!/usr/bin/python2.6
 #!/usr/bin/python2.6
-# -*- coding: iso-8859-15 -*-
 """Library to handle WRGPX files.
 A WRGPX file (WR stands for Winterrodeln) is a normal GPX file
 that follows several conventions so that it can be rendered to
 """Library to handle WRGPX files.
 A WRGPX file (WR stands for Winterrodeln) is a normal GPX file
 that follows several conventions so that it can be rendered to
@@ -208,8 +207,8 @@ def height_profile(wrgpx):
     plt.axis([axxmin, axxmax, axymin, axymax])
     plt.grid()
     plt.xlabel('Strecke in m [%d m Gesamtstrecke]' % round(x[-1], -1))
     plt.axis([axxmin, axxmax, axymin, axymax])
     plt.grid()
     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)
+    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 = io.StringIO()
 
     width_px = 500
     imgdata = io.StringIO()
index 9e0fb4c8cd18794afa776e0db9cd82a0b7d97263..28f25271e32f933d5b3822ff5bfdf9b910956db6 100644 (file)
@@ -1,5 +1,4 @@
 #!/usr/bin/python2.6
 #!/usr/bin/python2.6
-# -*- coding: iso-8859-15 -*-
 """This file contains "validators" that convert between string and python (database) representation
 of properties used in the "Rodelbahnbox" and "Gasthausbox".
 The "to_python" method has to get a unicode argument.
 """This file contains "validators" that convert between string and python (database) representation
 of properties used in the "Rodelbahnbox" and "Gasthausbox".
 The "to_python" method has to get a unicode argument.
@@ -309,7 +308,7 @@ class MultiGeo(formencode.FancyValidator):
     FORMAT_NONE = -1          # indicates missing formats
     
     # Valid for input_format and output_format
     FORMAT_NONE = -1          # indicates missing formats
     
     # Valid for input_format and output_format
-    FORMAT_GEOCACHING = 1    # e.g. "N 47° 13.692 E 011° 25.535"
+    FORMAT_GEOCACHING = 1    # e.g. "N 47° 13.692 E 011° 25.535"
     FORMAT_WINTERRODELN = 2  # e.g. "47.222134 N 11.467211 E"
     FORMAT_GMAPPLUGIN = 3    # e.g. "47.232922, 11.452239"
     FORMAT_GPX = 4           # e.g. "<trkpt lat="47.181289" lon="11.408827"><ele>1090.57</ele></trkpt>"
     FORMAT_WINTERRODELN = 2  # e.g. "47.222134 N 11.467211 E"
     FORMAT_GMAPPLUGIN = 3    # e.g. "47.232922, 11.452239"
     FORMAT_GPX = 4           # e.g. "<trkpt lat="47.181289" lon="11.408827"><ele>1090.57</ele></trkpt>"
@@ -333,7 +332,7 @@ class MultiGeo(formencode.FancyValidator):
         result = []
         for line in lines:
             if input_format == self.FORMAT_GUESS or input_format == self.FORMAT_GEOCACHING:
         result = []
         for line in lines:
             if input_format == self.FORMAT_GUESS or input_format == self.FORMAT_GEOCACHING:
-                r = re.match('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))
                 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))
@@ -377,7 +376,7 @@ class MultiGeo(formencode.FancyValidator):
         for latitude, longitude, height in value:
             if output_format == self.FORMAT_GEOCACHING:
                 degree = latitude
         for latitude, longitude, height in value:
             if output_format == self.FORMAT_GEOCACHING:
                 degree = latitude
-                result.append('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('%.6f N %.6f E' % (latitude, longitude))
                 
             elif output_format == self.FORMAT_WINTERRODELN:
                 result.append('%.6f N %.6f E' % (latitude, longitude))
@@ -472,9 +471,9 @@ class GermanAvalanches(DictValidator):
     u'kaum'         <=> 1
     u'selten'       <=> 2
     u'gelegentlich' <=> 3
     u'kaum'         <=> 1
     u'selten'       <=> 2
     u'gelegentlich' <=> 3
-    u'häufig'       <=> 4"""
+    u'häufig'       <=> 4"""
     def __init__(self):
     def __init__(self):
-        DictValidator.__init__(self, {'': None, 'kaum': 1, 'selten': 2, 'gelegentlich': 3, 'häufig': 4})
+        DictValidator.__init__(self, {'': None, 'kaum': 1, 'selten': 2, 'gelegentlich': 3, 'häufig': 4})
 
 
 class GermanPublicTransport(DictValidator):
 
 
 class GermanPublicTransport(DictValidator):
@@ -483,12 +482,12 @@ class GermanPublicTransport(DictValidator):
     u''            <=> None
     u'Sehr gut'    <=> 1
     u'Gut'         <=> 2
     u''            <=> None
     u'Sehr gut'    <=> 1
     u'Gut'         <=> 2
-    u'Mittelmäßig' <=> 3
+    u'Mittelmäßig' <=> 3
     u'Schlecht'    <=> 4
     u'Nein'        <=> 5
     u'Ja'          <=> 6"""
     def __init__(self):
     u'Schlecht'    <=> 4
     u'Nein'        <=> 5
     u'Ja'          <=> 6"""
     def __init__(self):
-        DictValidator.__init__(self, {'': None, 'Sehr gut': 1, 'Gut': 2, 'Mittelmäßig': 3, 'Schlecht': 4, 'Nein': 5, 'Ja': 6})
+        DictValidator.__init__(self, {'': None, 'Sehr gut': 1, 'Gut': 2, 'Mittelmäßig': 3, 'Schlecht': 4, 'Nein': 5, 'Ja': 6})
 
 
 class GermanTristateFloatComment(ValueComment):
 
 
 class GermanTristateFloatComment(ValueComment):
@@ -519,20 +518,20 @@ class UnsignedCommentNone(NoneValidator):
 
 
 class GermanCachet(formencode.FancyValidator):
 
 
 class GermanCachet(formencode.FancyValidator):
-    """Converts a "Gütesiegel":
+    """Converts a "Gütesiegel":
     u'' <=> None
     u'Nein' <=> 'Nein'
     u'' <=> None
     u'Nein' <=> 'Nein'
-    u'Tiroler Naturrodelbahn-Gütesiegel 2009 mittel' <=> u'Tiroler Naturrodelbahn-Gütesiegel 2009 mittel'"""
+    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 == '': return None
         elif value == 'Nein': return value
     def to_python(self, value):
         self.assert_string(value, None)
         if value == '': return None
         elif value == 'Nein': return value
-        elif value.startswith('Tiroler Naturrodelbahn-Gütesiegel '):
+        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
             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("Unbekanntes Gütesiegel", value, None)
+        else: raise formencode.Invalid("Unbekanntes Gütesiegel", value, None)
     
     def from_python(self, value):
         if value == None: return ''
     
     def from_python(self, value):
         if value == None: return ''
@@ -546,10 +545,10 @@ class Url(formencode.FancyValidator):
     def to_python(self, value):
         self.assert_string(value, None)
         v = value
     def to_python(self, value):
         self.assert_string(value, None)
         v = value
-        v = v.replace('ä', 'a')
-        v = v.replace('ö', 'o')
-        v = v.replace('ü', 'u')
-        v = v.replace('ß', '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
     
         v = self.urlv.to_python(v)
         return value
     
@@ -689,7 +688,7 @@ class GermanLift(BoolUnicodeTupleValidator):
     u''                                       <=> (None, None)
     u'Nein'                                   <=> (False, None)
     u'Sessellift                              <=> (True, u'Sessellift')
     u''                                       <=> (None, None)
     u'Nein'                                   <=> (False, None)
     u'Sessellift                              <=> (True, u'Sessellift')
-    u'Gondel (nur bis zur Hälfte)'            <=> (True, u'Gondel (nur bis zur Hälfte)')
+    u'Gondel (nur bis zur Hälfte)'            <=> (True, u'Gondel (nur bis zur Hälfte)')
     u'Sessellift; Taxi'                       <=> (True, u'Sessellift; Taxi')
     u'Sessellift (Wochenende); Taxi (6 Euro)' <=> (True, u'Sessellift (Wochenende); Taxi (6 Euro)')
     """
     u'Sessellift; Taxi'                       <=> (True, u'Sessellift; Taxi')
     u'Sessellift (Wochenende); Taxi (6 Euro)' <=> (True, u'Sessellift (Wochenende); Taxi (6 Euro)')
     """
index 196a04a5282da9144a05a5432c6caf9ac00ecf6f..f6ef728274ff60f3fcf47030e16addec4d15a5bf 100644 (file)
@@ -1,5 +1,4 @@
 #!/usr/bin/python2.7
 #!/usr/bin/python2.7
-# -*- coding: iso-8859-15 -*-
 # $Id$
 import unittest
 import wradmin.lib
 # $Id$
 import unittest
 import wradmin.lib
index 9de7cfc46f7fa49c894123a574e15e4bf8fd71f3..56e7ec596e1a9e94701ba011d921e0a072747554 100644 (file)
@@ -1,4 +1,2 @@
-# -*- coding: iso-8859-15 -*-
-
 # No tests yet.
 
 # No tests yet.