-# -*- 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
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))
-# -*- 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
-# -*- 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
-# -*- 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
-# -*- 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
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()
-# -*- 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
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:
-# -*- coding: iso-8859-15 -*-
# $Id$
"MediaWiki communication functions"
import datetime
# $Id$
"MediaWiki communication functions"
import datetime
-# -*- 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
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()
-# -*- 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.
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>"
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))
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))
u'kaum' <=> 1
u'selten' <=> 2
u'gelegentlich' <=> 3
u'kaum' <=> 1
u'selten' <=> 2
u'gelegentlich' <=> 3
- 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):
u'' <=> None
u'Sehr gut' <=> 1
u'Gut' <=> 2
u'' <=> None
u'Sehr gut' <=> 1
u'Gut' <=> 2
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):
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 ''
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
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)')
"""
-# -*- coding: iso-8859-15 -*-
# $Id$
import unittest
import wradmin.lib
# $Id$
import unittest
import wradmin.lib
-# -*- coding: iso-8859-15 -*-
-