]> ToastFreeware Gitweb - philipp/winterrodeln/wradmin.git/commitdiff
Updated wradmin to use Pylons 0.10 instead of Pylons 0.9.7.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Mon, 23 Aug 2010 22:03:05 +0000 (22:03 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Mon, 23 Aug 2010 22:03:05 +0000 (22:03 +0000)
git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/trunk/wradmin@582 7aebc617-e5e2-0310-91dc-80fb5f6d2477

26 files changed:
wradmin/setup.py
wradmin/wradmin/config/deployment.ini_tmpl
wradmin/wradmin/config/environment.py
wradmin/wradmin/config/middleware.py
wradmin/wradmin/config/routing.py
wradmin/wradmin/controllers/bericht.py
wradmin/wradmin/controllers/coordtool.py
wradmin/wradmin/controllers/gasthaus.py
wradmin/wradmin/controllers/map.py
wradmin/wradmin/controllers/rodelbahn.py
wradmin/wradmin/controllers/wrgpxtool.py
wradmin/wradmin/lib/app_globals.py
wradmin/wradmin/lib/base.py
wradmin/wradmin/lib/helpers.py
wradmin/wradmin/templates/bericht_list.html
wradmin/wradmin/templates/bericht_view.html
wradmin/wradmin/templates/coordtool.html
wradmin/wradmin/templates/gasthaus_list.html
wradmin/wradmin/templates/index.html
wradmin/wradmin/templates/maptool.html
wradmin/wradmin/templates/master.html
wradmin/wradmin/templates/rodelbahn_list.html
wradmin/wradmin/templates/rodelbahn_view.html
wradmin/wradmin/templates/wrgpxtool.html
wradmin/wradmin/tests/__init__.py
wradmin/wradmin/websetup.py

index 6e8a485839a32a060beedb4706b388ce4f27a63c..2af8630a5e2dc446bd22eab42eda60f4d31b98d7 100644 (file)
@@ -13,11 +13,11 @@ setup(
     author_email='philipp.spitzer@winterrodeln.org',
     url='http://www.winterrodeln.org/',
     install_requires=[
     author_email='philipp.spitzer@winterrodeln.org',
     url='http://www.winterrodeln.org/',
     install_requires=[
-        "Pylons>=0.9.7",
+        "Pylons>=0.10",
+        "SQLAlchemy>=0.5",
         "Genshi>=0.4",
         "MySQL-python>=1.2",
         "AuthKit>=0.4.3,<=0.4.99",
         "Genshi>=0.4",
         "MySQL-python>=1.2",
         "AuthKit>=0.4.3,<=0.4.99",
-        "SQLAlchemy>=0.5",
         "lxml>=2.2",
         # "matplotlib>=0.9",
         "Babel>=0.9"
         "lxml>=2.2",
         # "matplotlib>=0.9",
         "Babel>=0.9"
index 8fd5e050f02906c4541369c961c3660d7184100e..095acad53e8cd03c45e7f96cc6a0b25fa6ffb817 100644 (file)
@@ -67,4 +67,4 @@ level = NOTSET
 formatter = generic
 
 [formatter_generic]
 formatter = generic
 
 [formatter_generic]
-format = %(asctime)s %(levelname)-5.5s [%(name)s] %(message)s
+format = %(asctime)s %(levelname)-5.5s [%(name)s] [%(threadName)s] %(message)s
index 843b198f861272e48444b3ce1ca4b6568e977de5..759430292c372a44e063fc43df20e410207ded77 100644 (file)
@@ -2,7 +2,7 @@
 import os
 
 from genshi.template import TemplateLoader
 import os
 
 from genshi.template import TemplateLoader
-from pylons import config
+from pylons.configuration import PylonsConfig
 from sqlalchemy import engine_from_config
 
 import wradmin.lib.app_globals as app_globals
 from sqlalchemy import engine_from_config
 
 import wradmin.lib.app_globals as app_globals
@@ -14,6 +14,8 @@ def load_environment(global_conf, app_conf):
     """Configure the Pylons environment via the ``pylons.config``
     object
     """
     """Configure the Pylons environment via the ``pylons.config``
     object
     """
+    config = PylonsConfig()
+    
     # Pylons paths
     root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
     paths = dict(root=root,
     # Pylons paths
     root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
     paths = dict(root=root,
@@ -24,9 +26,14 @@ def load_environment(global_conf, app_conf):
     # Initialize config with the basic options
     config.init_app(global_conf, app_conf, package='wradmin', paths=paths)
 
     # Initialize config with the basic options
     config.init_app(global_conf, app_conf, package='wradmin', paths=paths)
 
-    config['routes.map'] = make_map()
-    config['pylons.app_globals'] = app_globals.Globals()
+    config['routes.map'] = make_map(config)
+    config['pylons.app_globals'] = app_globals.Globals(config)
     config['pylons.h'] = wradmin.lib.helpers
     config['pylons.h'] = wradmin.lib.helpers
+    
+    # Setup cache object as early as possible
+    import pylons
+    pylons.cache._push_object(config['pylons.app_globals'].cache)
+    
 
     # Create the Genshi TemplateLoader
     config['pylons.app_globals'].genshi_loader = TemplateLoader(
 
     # Create the Genshi TemplateLoader
     config['pylons.app_globals'].genshi_loader = TemplateLoader(
@@ -38,4 +45,5 @@ def load_environment(global_conf, app_conf):
 
     # CONFIGURATION OPTIONS HERE (note: all config options will override
     # any Pylons config options)
 
     # CONFIGURATION OPTIONS HERE (note: all config options will override
     # any Pylons config options)
-    config['pylons.strict_c'] = True
\ No newline at end of file
+    
+    return config
index 4f8a31e494cf6c13a9f56c9589162023c1d52bfd..cc2ccb3c20b476946a8fdaedf281ae8b774c2771 100644 (file)
@@ -1,10 +1,9 @@
 """Pylons middleware initialization"""
 """Pylons middleware initialization"""
-from beaker.middleware import CacheMiddleware, SessionMiddleware
+from beaker.middleware import SessionMiddleware
 from paste.cascade import Cascade
 from paste.registry import RegistryManager
 from paste.urlparser import StaticURLParser
 from paste.deploy.converters import asbool
 from paste.cascade import Cascade
 from paste.registry import RegistryManager
 from paste.urlparser import StaticURLParser
 from paste.deploy.converters import asbool
-from pylons import config
 from pylons.middleware import ErrorHandler, StatusCodeRedirect
 from pylons.wsgiapp import PylonsApp
 from routes.middleware import RoutesMiddleware
 from pylons.middleware import ErrorHandler, StatusCodeRedirect
 from pylons.wsgiapp import PylonsApp
 from routes.middleware import RoutesMiddleware
@@ -38,15 +37,14 @@ def make_app(global_conf, full_stack=True, static_files=True, **app_conf):
 
     """
     # Configure the Pylons environment
 
     """
     # Configure the Pylons environment
-    load_environment(global_conf, app_conf)
+    config = load_environment(global_conf, app_conf)
 
     # The Pylons WSGI app
 
     # The Pylons WSGI app
-    app = PylonsApp()
+    app = PylonsApp(config=config)
 
 
-    # Routing/Session/Cache Middleware
+    # Routing/Session Middleware
     app = RoutesMiddleware(app, config['routes.map'])
     app = SessionMiddleware(app, config)
     app = RoutesMiddleware(app, config['routes.map'])
     app = SessionMiddleware(app, config)
-    app = CacheMiddleware(app, config)
 
     # CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares)
 
 
     # CUSTOM MIDDLEWARE HERE (filtered by error handling middlewares)
 
@@ -74,5 +72,5 @@ def make_app(global_conf, full_stack=True, static_files=True, **app_conf):
         # Serve static files
         static_app = StaticURLParser(config['pylons.paths']['static_files'])
         app = Cascade([static_app, app])
         # Serve static files
         static_app = StaticURLParser(config['pylons.paths']['static_files'])
         app = Cascade([static_app, app])
-
+    app.config = config
     return app
     return app
index 2c038fb5d82ca65200ac53c18d9442d79ee966d3..8dfa3dcbca063516a69f5c5b3f164ddac547e8d1 100644 (file)
@@ -4,14 +4,14 @@ The more specific and detailed routes should be defined first so they
 may take precedent over the more generic routes. For more information
 refer to the routes manual at http://routes.groovie.org/docs/
 """
 may take precedent over the more generic routes. For more information
 refer to the routes manual at http://routes.groovie.org/docs/
 """
-from pylons import config
 from routes import Mapper
 
 from routes import Mapper
 
-def make_map():
+def make_map(config):
     """Create, configure and return the routes Mapper"""
     map = Mapper(directory=config['pylons.paths']['controllers'],
     """Create, configure and return the routes Mapper"""
     map = Mapper(directory=config['pylons.paths']['controllers'],
-                 always_scan=config['debug'], explicit=True)
+                 always_scan=config['debug'])
     map.minimization = False
     map.minimization = False
+    map.explicit = False
 
     # The ErrorController route (handles 404/500 error pages); it should
     # likely stay at the top, ensuring it can always be resolved
 
     # The ErrorController route (handles 404/500 error pages); it should
     # likely stay at the top, ensuring it can always be resolved
index a004d2b064b106f4f4662fe78a60de2939db38ec..a4464fa506fd2be34f31ea0939d7725a67bd870f 100644 (file)
@@ -1,8 +1,8 @@
 # -*- coding: iso-8859-15 -*-
 import logging
 
 # -*- coding: iso-8859-15 -*-
 import logging
 
-from pylons import request, response, session, tmpl_context as c
-from pylons.controllers.util import abort, redirect_to
+from pylons import request, response, session, url, tmpl_context as c
+from pylons.controllers.util import abort, redirect
 import webhelpers.paginate as paginate
 
 from wradmin.lib.base import BaseController, render
 import webhelpers.paginate as paginate
 
 from wradmin.lib.base import BaseController, render
@@ -80,7 +80,7 @@ class BerichtController(BaseController):
         model.meta.Session.commit()
         session['flash'] = u'Datum wurde erfolgreich geändert'
         session.save()
         model.meta.Session.commit()
         session['flash'] = u'Datum wurde erfolgreich geändert'
         session.save()
-        return redirect_to(controller='bericht', action='view', id=id)
+        return redirect(url(controller='bericht', action='view', id=id))
     
     
     def new(self, id):
     
     
     def new(self, id):
index 19336370a7284ca0f2f6a975e2c3f42a30ea1741..7dc1145be879829ca7efa18449f0a0f0db3719db 100644 (file)
@@ -3,8 +3,8 @@
 
 import logging
 
 
 import logging
 
-from pylons import request, response, session, tmpl_context as c
-from pylons.controllers.util import abort, redirect_to
+from pylons import request, response, session, url, tmpl_context as c
+from pylons.controllers.util import abort, redirect
 import formencode
 
 from wradmin.lib.base import BaseController, render
 import formencode
 
 from wradmin.lib.base import BaseController, render
@@ -31,14 +31,14 @@ class CoordtoolController(BaseController):
         
         if input is None or len(input.strip()) == 0: 
             c.result = None
         
         if input is None or len(input.strip()) == 0: 
             c.result = None
-            return redirect_to(controller='coordtool', action='index')
+            return redirect(url(controller='coordtool', action='index'))
         
         geo = wradmin.model.validators.MultiGeo()
         try: c.result = geo.to_python(input)
         except formencode.Invalid, e:
             session['flash'] = unicode(e)
             session.save()
         
         geo = wradmin.model.validators.MultiGeo()
         try: c.result = geo.to_python(input)
         except formencode.Invalid, e:
             session['flash'] = unicode(e)
             session.save()
-            return redirect_to(controller='coordtool', action='index')
+            return redirect(url(controller='coordtool', action='index'))
         
         if swap_latlon:
             c.result = [(latitude, longitude, elevation) for (longitude, latitude, elevation) in c.result]
         
         if swap_latlon:
             c.result = [(latitude, longitude, elevation) for (longitude, latitude, elevation) in c.result]
@@ -51,4 +51,4 @@ class CoordtoolController(BaseController):
         c.geo_gpx = wradmin.model.validators.MultiGeo(output_format = geo.FORMAT_GPX)
         c.geo_geocaching = wradmin.model.validators.MultiGeo(output_format = geo.FORMAT_GEOCACHING)
         
         c.geo_gpx = wradmin.model.validators.MultiGeo(output_format = geo.FORMAT_GPX)
         c.geo_geocaching = wradmin.model.validators.MultiGeo(output_format = geo.FORMAT_GEOCACHING)
         
-        return render('coordtool.html')
\ No newline at end of file
+        return render('coordtool.html')
index 03813793b9d52f747aae62f26e84a68dd0febb61..83d20d250c43a4d56a097f7ad30e197f12d9feff 100644 (file)
@@ -2,8 +2,8 @@
 # -*- coding: iso-8859-15 -*-
 import logging
 
 # -*- coding: iso-8859-15 -*-
 import logging
 
-from pylons import request, response, session, tmpl_context as c
-from pylons.controllers.util import abort, redirect_to
+from pylons import request, response, session, url, tmpl_context as c
+from pylons.controllers.util import abort, redirect
 import webhelpers.paginate as paginate
 
 from wradmin.lib.base import BaseController, render
 import webhelpers.paginate as paginate
 
 from wradmin.lib.base import BaseController, render
@@ -98,4 +98,4 @@ class GasthausController(BaseController):
         if error_msg == '': session['flash'] = u'Die Gasthausliste wurde erfolgreich aktualisiert.'
         else: session['flash'] = error_msg
         session.save()
         if error_msg == '': session['flash'] = u'Die Gasthausliste wurde erfolgreich aktualisiert.'
         else: session['flash'] = error_msg
         session.save()
-        return redirect_to(controller='gasthaus', action='list')
+        return redirect(url(controller='gasthaus', action='list'))
index 8d6420872d8cb526e958e5ef0145e012d21a317a..2c2ffe0916d9da9bedbd9a9ee186a37c29b79ead 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/python2.5
 # -*- coding: iso-8859-15 -*-
 #!/usr/bin/python2.5
 # -*- coding: iso-8859-15 -*-
-from pylons import request, response, session, tmpl_context as c
-from pylons.controllers.util import abort, redirect_to
+from pylons import request, response, session, url, tmpl_context as c
+from pylons.controllers.util import abort, redirect
 
 from wradmin.lib.base import BaseController, render
 import wradmin.model as model
 
 from wradmin.lib.base import BaseController, render
 import wradmin.model as model
index 4a5ffb1d951d45f0d62020335bf6c561999d0fb9..93fb478614ef047f396ac88f53950d415fa9495e 100644 (file)
@@ -2,8 +2,8 @@
 # -*- coding: iso-8859-15 -*-
 import logging
 
 # -*- coding: iso-8859-15 -*-
 import logging
 
-from pylons import request, response, session, tmpl_context as c
-from pylons.controllers.util import abort, redirect_to
+from pylons import request, response, session, url, tmpl_context as c
+from pylons.controllers.util import abort, redirect
 import webhelpers.paginate as paginate
 
 from wradmin.lib.base import BaseController, render
 import webhelpers.paginate as paginate
 
 from wradmin.lib.base import BaseController, render
@@ -122,4 +122,4 @@ class RodelbahnController(BaseController):
         if error_msg == '': session['flash'] = u'Die Rodelbahnliste wurde erfolgreich aktualisiert.'
         else: session['flash'] = error_msg
         session.save()
         if error_msg == '': session['flash'] = u'Die Rodelbahnliste wurde erfolgreich aktualisiert.'
         else: session['flash'] = error_msg
         session.save()
-        return redirect_to(controller='rodelbahn', action='list')
+        return redirect(url(controller='rodelbahn', action='list'))
index 26f564f8100132cad1a8a858b0411e05eebb854d..fe49fe5ab3dfe893f41e93a926669b2efff2df5b 100644 (file)
@@ -3,8 +3,8 @@
 
 import logging
 
 
 import logging
 
-from pylons import request, response, session, tmpl_context as c
-from pylons.controllers.util import abort, redirect_to
+from pylons import request, response, session, url, tmpl_context as c
+from pylons.controllers.util import abort, redirect
 from pylons.decorators.rest import restrict
 
 from wradmin.lib.base import BaseController, render
 from pylons.decorators.rest import restrict
 
 from wradmin.lib.base import BaseController, render
index 8e62241eea90b1bcd74146bc396cae996cc71ed7..2366bba167260c7b8aa16fa2ec923ee06efec250 100644 (file)
@@ -1,5 +1,8 @@
 """The application's Globals object"""
 
 """The application's Globals object"""
 
+from beaker.cache import CacheManager
+from beaker.util import parse_cache_config_options
+
 class Globals(object):
 
     """Globals acts as a container for objects available throughout the
 class Globals(object):
 
     """Globals acts as a container for objects available throughout the
@@ -7,9 +10,10 @@ class Globals(object):
 
     """
 
 
     """
 
-    def __init__(self):
+    def __init__(self, config):
         """One instance of Globals is created during application
         initialization and is available during requests via the
         'app_globals' variable
 
         """
         """One instance of Globals is created during application
         initialization and is available during requests via the
         'app_globals' variable
 
         """
+        self.cache = CacheManager(**parse_cache_config_options(config))
index c1a36dc65674c682d38f3c062467262d642a7d3c..13647d26bd86dfe66758a5702bf8bd8eccf41c35 100644 (file)
@@ -4,7 +4,8 @@ Provides the BaseController class for subclassing.
 """
 from pylons.controllers import WSGIController
 from pylons.templating import render_genshi as render
 """
 from pylons.controllers import WSGIController
 from pylons.templating import render_genshi as render
-from wradmin.model import meta
+
+from wradmin.model.meta import Session
 
 class BaseController(WSGIController):
 
 
 class BaseController(WSGIController):
 
@@ -16,5 +17,4 @@ class BaseController(WSGIController):
         try:
             return WSGIController.__call__(self, environ, start_response)
         finally:
         try:
             return WSGIController.__call__(self, environ, start_response)
         finally:
-            meta.Session.remove()
-
+            Session.remove()
index 585cd4492e743ff173f1a3e92a2cc2cc84858b63..a5c4413fe0163f7b29fac4c0744bc924a53b8b2f 100644 (file)
@@ -6,7 +6,7 @@ available to Controllers. This module is available to templates as 'h'.
 # Import helpers as desired, or define your own, ie:
 #from webhelpers.html.tags import checkbox, password
 
 # Import helpers as desired, or define your own, ie:
 #from webhelpers.html.tags import checkbox, password
 
-from routes import url_for
+from pylons import url
 import wradmin.model.validators
 from webhelpers.html.tags import file, form, end_form, submit
 
 import wradmin.model.validators
 from webhelpers.html.tags import file, form, end_form, submit
 
index e5d91e1db0c835cfa73585b1437678400f0500cd..c444005073bcbd1099fd6dbb87a5c011c4bbb14b 100644 (file)
@@ -28,7 +28,7 @@
         <th>Gelöscht</th>
     </tr>
     <tr py:for="r in c.paginator">
         <th>Gelöscht</th>
     </tr>
     <tr py:for="r in c.paginator">
-        <td><a href="${h.url_for(controller='bericht', action='view', id=r.id)}">${r.id}</a></td>
+        <td><a href="${h.url(controller='bericht', action='view', id=r.id)}">${r.id}</a></td>
         <td>${r.page_title}</td>
         <td>${r.date_entry}</td>
         <td>${r.date_invalid}</td>
         <td>${r.page_title}</td>
         <td>${r.date_entry}</td>
         <td>${r.date_invalid}</td>
index a78ef7b89eaf36e8f27e97fc5668c81e1fae22ee..a4ac5eceee6dae150ba1a5350fd8dbdf95be68a0 100644 (file)
@@ -26,7 +26,7 @@ Der Bericht wurde am ${c.wrreport.date_report} abgegeben.
        </tr>
     <tr>
                <th>Seiten-ID (Rodelbahn-ID)</th>
        </tr>
     <tr>
                <th>Seiten-ID (Rodelbahn-ID)</th>
-               <td><a href="${h.url_for(controller='rodelbahn', action='view', id=c.wrreport.page_id)}">${c.wrreport.page_id}</a></td>
+               <td><a href="${h.url(controller='rodelbahn', action='view', id=c.wrreport.page_id)}">${c.wrreport.page_id}</a></td>
     </tr>
        <tr>
                <th>Datum für Bericht</th>
     </tr>
        <tr>
                <th>Datum für Bericht</th>
@@ -99,7 +99,7 @@ Der Bericht wurde am ${c.wrreport.date_report} abgegeben.
 </table>
 
 <h3>Anzeigedauer des Rodelbahnberichts ändern</h3>
 </table>
 
 <h3>Anzeigedauer des Rodelbahnberichts ändern</h3>
-<form action="${h.url_for(controller='bericht', action='change_date_invalid', id=c.wrreport.id)}" method="post">
+<form action="${h.url(controller='bericht', action='change_date_invalid', id=c.wrreport.id)}" method="post">
 <table>
        <tr>
                <th>Enddatum</th>
 <table>
        <tr>
                <th>Enddatum</th>
index afd3e271ddb10119a7a60ca9e36e2ad2c398bf1f..6d1e6ede67c9b05f6d519a81df3431f991bd9651 100644 (file)
@@ -36,7 +36,7 @@
     <py:for each="line in c.result">${c.geo_geocaching.from_python([line])}<br/></py:for>
 </p>
 
     <py:for each="line in c.result">${c.geo_geocaching.from_python([line])}<br/></py:for>
 </p>
 
-<form action="${h.url_for(controller='coordtool', action='convert')}" method="post">
+<form action="${h.url(controller='coordtool', action='convert')}" method="post">
 <table>
     <tr><th></th><th>Beispiel</th></tr>
        <tr><td><textarea name="input" cols="80" rows="10"/></td>
 <table>
     <tr><th></th><th>Beispiel</th></tr>
        <tr><td><textarea name="input" cols="80" rows="10"/></td>
index 005a0a0c16d12dab94a216d4d34680fee5940771..ff4259dccdbf7f13324c4b45da947dcd2c25bae3 100644 (file)
@@ -15,7 +15,7 @@
 
 <p>Die folgende Lise wurde automatisiert von den Gasthausboxen gesammelt. Da dies nicht automatisch passiert, kann es sein, dass die Liste "veraltete" Information enthält.</p>
 
 
 <p>Die folgende Lise wurde automatisiert von den Gasthausboxen gesammelt. Da dies nicht automatisch passiert, kann es sein, dass die Liste "veraltete" Information enthält.</p>
 
-<p><a href="${h.url_for(controller='gasthaus', action='update')}" class="button">Gasthausboxen auslesen und DB aktualisieren</a></p>
+<p><a href="${h.url(controller='gasthaus', action='update')}" class="button">Gasthausboxen auslesen und DB aktualisieren</a></p>
 
 
 <p>${c.paginator.pager('$link_first $link_previous $first_item bis $last_item von $item_count $link_next $link_last', controller='gasthaus', action='list')}</p>
 
 
 <p>${c.paginator.pager('$link_first $link_previous $first_item bis $last_item von $item_count $link_next $link_last', controller='gasthaus', action='list')}</p>
@@ -35,7 +35,7 @@
         <th>In Arbeit</th>
     </tr>
     <tr py:for="s in c.paginator">
         <th>In Arbeit</th>
     </tr>
     <tr py:for="s in c.paginator">
-        <td><a href="${h.url_for(controller='gasthaus', action='view', id=s.page_id)}">${s.page_id}</a></td>
+        <td><a href="${h.url(controller='gasthaus', action='view', id=s.page_id)}">${s.page_id}</a></td>
         <td>${s.page_title}</td>
         <td>${s.position_elevation}</td>
         <td>${s.phone_list}</td>
         <td>${s.page_title}</td>
         <td>${s.position_elevation}</td>
         <td>${s.phone_list}</td>
index 2bb064901cdcb6a25d59f2125ed9610801cd5f26..77ae969ccbda113688d5205b2628704a39d2cc05 100644 (file)
 <p>Willkommen auf den Administrationsseiten von Winterrodeln.</p>
 
 <ul>
 <p>Willkommen auf den Administrationsseiten von Winterrodeln.</p>
 
 <ul>
-    <li><a href="${h.url_for(controller='rodelbahn', action='list')}">Rodelbahnen</a></li>
-    <li><a href="${h.url_for(controller='bericht', action='list')}">Rodelbahnberichte</a></li>
-    <li><a href="${h.url_for(controller='gasthaus', action='list')}">Gasthäuser</a></li>
-    <li><a href="${h.url_for(controller='maptool', action='index')}">Maptool</a></li>
-    <li><a href="${h.url_for(controller='coordtool', action='index')}">Koordinaten-Rechner</a></li>
-       <!-- <li><a href="${h.url_for(controller='wrgpxtool', action='index')}">Winterrodeln-GPX Datei Werkzeuge</a></li> -->
+    <li><a href="${h.url(controller='rodelbahn', action='list')}">Rodelbahnen</a></li>
+    <li><a href="${h.url(controller='bericht', action='list')}">Rodelbahnberichte</a></li>
+    <li><a href="${h.url(controller='gasthaus', action='list')}">Gasthäuser</a></li>
+    <li><a href="${h.url(controller='maptool', action='index')}">Maptool</a></li>
+    <li><a href="${h.url(controller='coordtool', action='index')}">Koordinaten-Rechner</a></li>
+    <!-- <li><a href="${h.url(controller='wrgpxtool', action='index')}">Winterrodeln-GPX Datei Werkzeuge</a></li> -->
 </ul>
 
 <ul>
 </ul>
 
 <ul>
index 92409851a5b28e17685e0e6cfe6cc063c2a16dc5..b35e793214d6ef5c5b56b0a8d062d258786ea10d 100644 (file)
@@ -9,9 +9,9 @@
 <head>
     <title>Map-Tool</title>
     <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAVDRl0qsoeYOspQi0txxVEhTO7xxs0m3ls_NApg8LzilP9E0D3hScAc_5O_qu8-pbIbSF5h8xfGEcjA" type="text/javascript"> </script>
 <head>
     <title>Map-Tool</title>
     <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAVDRl0qsoeYOspQi0txxVEhTO7xxs0m3ls_NApg8LzilP9E0D3hScAc_5O_qu8-pbIbSF5h8xfGEcjA" type="text/javascript"> </script>
-    <script src="${h.url_for('/yui/yahoo-dom-event/yahoo-dom-event.js')}" type="text/javascript"> </script>
-    <script src="${h.url_for('/yui/connection/connection-min.js')}" type="text/javascript"> </script>
-    <script src="${h.url_for('/yui/json/json-min.js')}" type="text/javascript"> </script>
+    <script src="${h.url('/yui/yahoo-dom-event/yahoo-dom-event.js')}" type="text/javascript"> </script>
+    <script src="${h.url('/yui/connection/connection-min.js')}" type="text/javascript"> </script>
+    <script src="${h.url('/yui/json/json-min.js')}" type="text/javascript"> </script>
     <script type="text/javascript">
 // <![CDATA[
 
     <script type="text/javascript">
 // <![CDATA[
 
@@ -109,8 +109,8 @@ function updatePositionInfo(wrMap, latlng, description, digits) {
 function initSledding(wrMap) {
     // Icon
     var wrSleddingIcon = new GIcon(G_DEFAULT_ICON);
 function initSledding(wrMap) {
     // Icon
     var wrSleddingIcon = new GIcon(G_DEFAULT_ICON);
-    wrSleddingIcon.image = "${h.url_for('/gmap_rodelbahn_c.png')}";
-    wrSleddingIcon.shadow = "${h.url_for('/gmap_rodelbahn_c_s.png')}";
+    wrSleddingIcon.image = "${h.url('/gmap_rodelbahn_c.png')}";
+    wrSleddingIcon.shadow = "${h.url('/gmap_rodelbahn_c_s.png')}";
     wrSleddingIcon.iconSize = new GSize(17, 17);
     wrSleddingIcon.shadowSize = new GSize(23, 23);
     wrSleddingIcon.iconAnchor = new GPoint(9, 9);
     wrSleddingIcon.iconSize = new GSize(17, 17);
     wrSleddingIcon.shadowSize = new GSize(23, 23);
     wrSleddingIcon.iconAnchor = new GPoint(9, 9);
@@ -139,7 +139,7 @@ function initSledding(wrMap) {
         },
         failure: function(o) {alert("Konnte die Rodelbahnen-Daten nicht vom Server laden");}
     }
         },
         failure: function(o) {alert("Konnte die Rodelbahnen-Daten nicht vom Server laden");}
     }
-    var url = "${h.url_for(controller='maptool', action='ajax_sledding')}";
+    var url = "${h.url(controller='maptool', action='ajax_sledding')}";
     YAHOO.util.Connect.asyncRequest('GET', url, callback, null);
 }
 
     YAHOO.util.Connect.asyncRequest('GET', url, callback, null);
 }
 
@@ -147,7 +147,7 @@ function initSledding(wrMap) {
 function initInns(wrMap) {
     // Icon
     var wrInnIcon = new GIcon(G_DEFAULT_ICON);
 function initInns(wrMap) {
     // Icon
     var wrInnIcon = new GIcon(G_DEFAULT_ICON);
-    wrInnIcon.image = "${h.url_for('/gmapGasthaus.png')}";
+    wrInnIcon.image = "${h.url('/gmapGasthaus.png')}";
     
     // Add one inn
     function addInnMarker(latitude, longitude, name) {
     
     // Add one inn
     function addInnMarker(latitude, longitude, name) {
@@ -172,7 +172,7 @@ function initInns(wrMap) {
         },
         failure: function(o) {alert("Konnte die Hütten-Daten nicht vom Server laden");}
     }
         },
         failure: function(o) {alert("Konnte die Hütten-Daten nicht vom Server laden");}
     }
-    var url = "${h.url_for(controller='maptool', action='ajax_inns')}";
+    var url = "${h.url(controller='maptool', action='ajax_inns')}";
     YAHOO.util.Connect.asyncRequest('GET', url, callback, null);
 }
 
     YAHOO.util.Connect.asyncRequest('GET', url, callback, null);
 }
 
index 4134cbcd270faae5faa0eaf0a2f320ecbf5f50b8..4afc8619f783da0b371187ea2b700343d0da23d3 100644 (file)
@@ -9,21 +9,21 @@
 <head py:match="head" py:attrs="select('@*')">
     <meta content="text/html; charset=UTF-8" http-equiv="content-type" />
     <meta name="robots" content="noindex, nofollow" />
 <head py:match="head" py:attrs="select('@*')">
     <meta content="text/html; charset=UTF-8" http-equiv="content-type" />
     <meta name="robots" content="noindex, nofollow" />
-    <link rel="stylesheet" type="text/css" media="screen" href="${h.url_for('/style.css')}" />
-    <link rel="shortcut icon" href="${h.url_for('/favicon.png')}" />
+    <link rel="stylesheet" type="text/css" media="screen" href="${h.url('/style.css')}" />
+    <link rel="shortcut icon" href="${h.url('/favicon.png')}" />
     <meta py:replace="select('*|text()')" />
 </head>
 
 
 <body py:match="body" py:attrs="select('@*')">
     <meta py:replace="select('*|text()')" />
 </head>
 
 
 <body py:match="body" py:attrs="select('@*')">
-<h1 id="header"><img src="${h.url_for('/titlebanner.png')}" alt="Winterrodeln Administration"/></h1>
+<h1 id="header"><img src="${h.url('/titlebanner.png')}" alt="Winterrodeln Administration"/></h1>
 
 <ul id="mainmenu">
 
 <ul id="mainmenu">
-    <li><a href="${h.url_for(controller='rodelbahn', action='index')}">Übersicht</a></li>
-    <li><a href="${h.url_for(controller='rodelbahn', action='list')}">Rodelbahnen</a></li>
-    <li><a href="${h.url_for(controller='bericht', action='list')}">Rodelbahnberichte</a></li>
-    <li><a href="${h.url_for(controller='gasthaus', action='list')}">Gasthäuser</a></li>
-    <li><a href="${h.url_for(controller='maptool', action='index')}">Map-Tool</a></li>
+    <li><a href="${h.url(controller='rodelbahn', action='index')}">Übersicht</a></li>
+    <li><a href="${h.url(controller='rodelbahn', action='list')}">Rodelbahnen</a></li>
+    <li><a href="${h.url(controller='bericht', action='list')}">Rodelbahnberichte</a></li>
+    <li><a href="${h.url(controller='gasthaus', action='list')}">Gasthäuser</a></li>
+    <li><a href="${h.url(controller='maptool', action='index')}">Map-Tool</a></li>
 </ul>
 
 <div py:if="session.has_key('flash')" class="${session.pop('flashclass', 'flash')}">${session.pop('flash')}<?python session.save() ?></div>
 </ul>
 
 <div py:if="session.has_key('flash')" class="${session.pop('flashclass', 'flash')}">${session.pop('flash')}<?python session.save() ?></div>
@@ -32,7 +32,7 @@
 ${select('*|text()')}
 </div>
 
 ${select('*|text()')}
 </div>
 
-<div id="footer"><img src="${h.url_for('/philipp_spitzer.png')}" alt="Philipp Spitzer"/></div>
+<div id="footer"><img src="${h.url('/philipp_spitzer.png')}" alt="Philipp Spitzer"/></div>
 </body>
 
 </html>
 </body>
 
 </html>
index c052e6c707975b7a2dd9696b68c01f4c1d058b00..51f6147044e797c0b363c6acd55b5494b6f5f9f6 100644 (file)
@@ -15,7 +15,7 @@
 
 <p>Die folgende Lise wurde automatisiert von den Rodelbahnboxen gesammelt. Da dies nicht automatisch passiert, kann es sein, dass die Liste "veraltete" Information enthält.</p>
 
 
 <p>Die folgende Lise wurde automatisiert von den Rodelbahnboxen gesammelt. Da dies nicht automatisch passiert, kann es sein, dass die Liste "veraltete" Information enthält.</p>
 
-<a href="${h.url_for(controller='rodelbahn', action='update')}" class="button">Rodelbahnboxen auslesen und DB aktualisieren</a>
+<a href="${h.url(controller='rodelbahn', action='update')}" class="button">Rodelbahnboxen auslesen und DB aktualisieren</a>
 
 <p>${c.paginator.pager('$link_first $link_previous $first_item bis $last_item von $item_count $link_next $link_last', controller='rodelbahn', action='list')}</p>
 
 
 <p>${c.paginator.pager('$link_first $link_previous $first_item bis $last_item von $item_count $link_next $link_last', controller='rodelbahn', action='list')}</p>
 
@@ -41,7 +41,7 @@
         <th>In Übersicht</th>
     </tr>
     <tr py:for="s in c.paginator">
         <th>In Übersicht</th>
     </tr>
     <tr py:for="s in c.paginator">
-        <td><a href="${h.url_for(controller='rodelbahn', action='view', id=s.page_id)}">${s.page_id}</a></td>
+        <td><a href="${h.url(controller='rodelbahn', action='view', id=s.page_id)}">${s.page_id}</a></td>
         <td>${s.page_title}</td>
         <td>${s.length}</td>
         <td>${s.walkup_time}</td>
         <td>${s.page_title}</td>
         <td>${s.length}</td>
         <td>${s.walkup_time}</td>
index ed91ddb100cf67bbffc4fe43d4e79c9dbf686e92..87eef3715d2b854a3ccd819f7bb91302fcbfa4c0 100644 (file)
         <th>Gelöscht</th>
     </tr>
     <tr py:for="r in c.paginator">
         <th>Gelöscht</th>
     </tr>
     <tr py:for="r in c.paginator">
-        <td><a href="${h.url_for(controller='bericht', action='view', id=r.id)}">${r.id}</a></td>
+        <td><a href="${h.url(controller='bericht', action='view', id=r.id)}">${r.id}</a></td>
         <td>${r.date_entry}</td>
         <td>${r.date_invalid}</td>
         <td>${r.date_report}</td>
         <td>${r.date_entry}</td>
         <td>${r.date_invalid}</td>
         <td>${r.date_report}</td>
index 05147b068d749371a220e16f17d6ddcffe8e92e6..8e49799927bdc2ebc9a49d96b26af24fa3595f48 100644 (file)
@@ -19,7 +19,7 @@
 <py:if test="not c.validated">
 <p>WRGPX steht für "Winterrodeln GPX". Hier können Sie eine .gpx Datei auf ihre Gültigkeit untersuchen.</p>
 
 <py:if test="not c.validated">
 <p>WRGPX steht für "Winterrodeln GPX". Hier können Sie eine .gpx Datei auf ihre Gültigkeit untersuchen.</p>
 
-${h.form(h.url_for(controller='wrgpxtool', action='upload'), multipart=True)}
+${h.form(h.url(controller='wrgpxtool', action='upload'), multipart=True)}
 GPX-Datei zum Untersuchen: ${h.file('gpxfile')}<br/>
 ${h.submit('submit', 'Raufladen')}
 ${h.end_form()}
 GPX-Datei zum Untersuchen: ${h.file('gpxfile')}<br/>
 ${h.submit('submit', 'Raufladen')}
 ${h.end_form()}
@@ -40,7 +40,7 @@ ${h.end_form()}
 
 <py:if test="c.validation_ok">
 <p>Sie entspricht außerdem den zusätzlichen Anforderungen von Winterrodeln an GPX Dateien (WRGPX).</p>
 
 <py:if test="c.validation_ok">
 <p>Sie entspricht außerdem den zusätzlichen Anforderungen von Winterrodeln an GPX Dateien (WRGPX).</p>
-<img src="${h.url_for(controller='wrgpxtool', action='height_profile')}"/>
+<img src="${h.url(controller='wrgpxtool', action='height_profile')}"/>
 
 <py:if test="len(c.validation_hints) > 0">
 <p>Trotzdem könnte die Datei noch verbessert werden:</p>
 
 <py:if test="len(c.validation_hints) > 0">
 <p>Trotzdem könnte die Datei noch verbessert werden:</p>
@@ -58,7 +58,7 @@ Der validierende XML-Parser lieferte folgende Fehlermeldung:</p>
 <p><em>${str(c.validation_exception)}</em></p>
 </py:if>
 
 <p><em>${str(c.validation_exception)}</em></p>
 </py:if>
 
-<p><a href="${h.url_for(controller='wrgpxtool', action='index')}">Andere/geänderte GPX-Datei untersuchen</a></p>
+<p><a href="${h.url(controller='wrgpxtool', action='index')}">Andere/geänderte GPX-Datei untersuchen</a></p>
 </py:if>
 
 
 </py:if>
 
 
index d51f6f265400de46139e1fb3e983ff5648842fc1..21a6b61a472ab516945ad1e4d09eea2b62bb9bac 100644 (file)
@@ -11,7 +11,7 @@ from unittest import TestCase
 
 from paste.deploy import loadapp
 from paste.script.appinstall import SetupCommand
 
 from paste.deploy import loadapp
 from paste.script.appinstall import SetupCommand
-from pylons import config, url
+from pylons import url
 from routes.util import URLGenerator
 from webtest import TestApp
 
 from routes.util import URLGenerator
 from webtest import TestApp
 
@@ -20,17 +20,16 @@ import pylons.test
 __all__ = ['environ', 'url', 'TestController']
 
 # Invoke websetup with the current config file
 __all__ = ['environ', 'url', 'TestController']
 
 # Invoke websetup with the current config file
-SetupCommand('setup-app').run([config['__file__']])
+SetupCommand('setup-app').run([pylons.test.pylonsapp.config['__file__']])
 
 environ = {}
 
 class TestController(TestCase):
 
     def __init__(self, *args, **kwargs):
 
 environ = {}
 
 class TestController(TestCase):
 
     def __init__(self, *args, **kwargs):
-        if pylons.test.pylonsapp:
-            wsgiapp = pylons.test.pylonsapp
-        else:
-            wsgiapp = loadapp('config:%s' % config['__file__'])
+        wsgiapp = pylons.test.pylonsapp
+        config = wsgiapp.config
         self.app = TestApp(wsgiapp)
         url._push_object(URLGenerator(config['routes.map'], environ))
         TestCase.__init__(self, *args, **kwargs)
         self.app = TestApp(wsgiapp)
         url._push_object(URLGenerator(config['routes.map'], environ))
         TestCase.__init__(self, *args, **kwargs)
+
index 923f7b0538b690c37fadd49c59c633300ba870b0..4ccf624684ccf4b0a22a67588af605ba0d93c873 100644 (file)
@@ -1,5 +1,6 @@
 """Setup the wradmin application"""
 import logging
 """Setup the wradmin application"""
 import logging
+import pylons.test
 
 from wradmin.config.environment import load_environment
 from wradmin.model import meta
 
 from wradmin.config.environment import load_environment
 from wradmin.model import meta
@@ -8,7 +9,8 @@ log = logging.getLogger(__name__)
 
 def setup_app(command, conf, vars):
     """Place any commands to setup wradmin here"""
 
 def setup_app(command, conf, vars):
     """Place any commands to setup wradmin here"""
-    load_environment(conf.global_conf, conf.local_conf)
+    if not pylons.test.pylonsapp:
+        load_environment(conf.global_conf, conf.local_conf)
 
     ## Create the tables if they don't already exist
 
     ## Create the tables if they don't already exist
-    # meta.metadata.create_all(bind=meta.engine)
\ No newline at end of file
+    # meta.metadata.create_all(bind=meta.engine)