From: philipp Date: Thu, 27 Jul 2017 21:58:58 +0000 (+0000) Subject: Changed encoding to UTF-8. X-Git-Url: https://git.toastfreeware.priv.at/philipp/winterrodeln/wradmin.git/commitdiff_plain/bc16e26959fabe1a9ea2f9293d9853312ce5fedd Changed encoding to UTF-8. git-svn-id: http://www.winterrodeln.org/svn/wradmin/trunk@2663 7aebc617-e5e2-0310-91dc-80fb5f6d2477 --- diff --git a/wradmin/controllers/bericht.py b/wradmin/controllers/bericht.py index dfa56d6..6d95dfd 100644 --- a/wradmin/controllers/bericht.py +++ b/wradmin/controllers/bericht.py @@ -1,4 +1,3 @@ -# -*- coding: iso-8859-15 -*- 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() - 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)) diff --git a/wradmin/controllers/coordtool.py b/wradmin/controllers/coordtool.py index d0629d9..572a7cd 100644 --- a/wradmin/controllers/coordtool.py +++ b/wradmin/controllers/coordtool.py @@ -1,6 +1,4 @@ #!/usr/bin/python2.6 -# -*- coding: iso-8859-15 -*- - import logging from pylons import request, response, session, url, tmpl_context as c diff --git a/wradmin/controllers/gasthaus.py b/wradmin/controllers/gasthaus.py index 5125a78..e68f711 100644 --- a/wradmin/controllers/gasthaus.py +++ b/wradmin/controllers/gasthaus.py @@ -1,5 +1,4 @@ #!/usr/bin/python2.6 -# -*- coding: iso-8859-15 -*- import logging from pylons import request, response, session, url, tmpl_context as c diff --git a/wradmin/controllers/map.py b/wradmin/controllers/map.py index acb9bc8..845a2ad 100644 --- a/wradmin/controllers/map.py +++ b/wradmin/controllers/map.py @@ -1,5 +1,4 @@ #!/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 diff --git a/wradmin/controllers/rodelbahn.py b/wradmin/controllers/rodelbahn.py index 19f2807..92ebff7 100644 --- a/wradmin/controllers/rodelbahn.py +++ b/wradmin/controllers/rodelbahn.py @@ -1,5 +1,4 @@ #!/usr/bin/python2.6 -# -*- coding: iso-8859-15 -*- 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() - 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() diff --git a/wradmin/controllers/wrgpxtool.py b/wradmin/controllers/wrgpxtool.py index 6a2a1dc..17e6bd0 100644 --- a/wradmin/controllers/wrgpxtool.py +++ b/wradmin/controllers/wrgpxtool.py @@ -1,6 +1,4 @@ #!/usr/bin/python2.6 -# -*- coding: iso-8859-15 -*- - 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 - 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 - 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: diff --git a/wradmin/lib/mediawiki.py b/wradmin/lib/mediawiki.py index 8f7cbf4..23c8814 100644 --- a/wradmin/lib/mediawiki.py +++ b/wradmin/lib/mediawiki.py @@ -1,5 +1,4 @@ #!/usr/bin/python2.6 -# -*- coding: iso-8859-15 -*- # $Id$ "MediaWiki communication functions" import datetime diff --git a/wradmin/lib/wrgpx.py b/wradmin/lib/wrgpx.py index 9ba5c81..742a373 100644 --- a/wradmin/lib/wrgpx.py +++ b/wradmin/lib/wrgpx.py @@ -1,5 +1,4 @@ #!/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 @@ -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.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() diff --git a/wradmin/model/validators.py b/wradmin/model/validators.py index 9e0fb4c..28f2527 100644 --- a/wradmin/model/validators.py +++ b/wradmin/model/validators.py @@ -1,5 +1,4 @@ #!/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. @@ -309,7 +308,7 @@ class MultiGeo(formencode.FancyValidator): 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. "1090.57" @@ -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: - 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)) @@ -377,7 +376,7 @@ class MultiGeo(formencode.FancyValidator): 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)) @@ -472,9 +471,9 @@ class GermanAvalanches(DictValidator): u'kaum' <=> 1 u'selten' <=> 2 u'gelegentlich' <=> 3 - u'häufig' <=> 4""" + u'häufig' <=> 4""" 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): @@ -483,12 +482,12 @@ class GermanPublicTransport(DictValidator): 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): - 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): @@ -519,20 +518,20 @@ class UnsignedCommentNone(NoneValidator): class GermanCachet(formencode.FancyValidator): - """Converts a "Gütesiegel": + """Converts a "Gütesiegel": 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 - 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 - 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 '' @@ -546,10 +545,10 @@ class Url(formencode.FancyValidator): 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 @@ -689,7 +688,7 @@ class GermanLift(BoolUnicodeTupleValidator): 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)') """ diff --git a/wradmin/tests/test_lib.py b/wradmin/tests/test_lib.py index 196a04a..f6ef728 100644 --- a/wradmin/tests/test_lib.py +++ b/wradmin/tests/test_lib.py @@ -1,5 +1,4 @@ #!/usr/bin/python2.7 -# -*- coding: iso-8859-15 -*- # $Id$ import unittest import wradmin.lib diff --git a/wradmin/tests/test_models.py b/wradmin/tests/test_models.py index 9de7cfc..56e7ec5 100644 --- a/wradmin/tests/test_models.py +++ b/wradmin/tests/test_models.py @@ -1,4 +1,2 @@ -# -*- coding: iso-8859-15 -*- - # No tests yet.