make the application start with pylons 0.10

This commit is contained in:
Jan Dittberner 2010-04-16 21:44:13 +02:00
parent 284844168c
commit 794bed92fd
14 changed files with 167 additions and 77 deletions

View file

@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# DDPortfolio service lib package
# Copyright (c) 2009 Jan Dittberner <jan@dittberner.info>
# Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
#
# This file is part of DDPortfolio service.
#

View file

@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# DDPortfolio service application Globals
# Copyright (c) 2009 Jan Dittberner <jan@dittberner.info>
# Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
#
# This file is part of DDPortfolio service.
#
@ -21,16 +21,21 @@
# <http://www.gnu.org/licenses/>.
#
"""The application's Globals object"""
from pylons import config
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
life of the application
"""
def __init__(self):
def __init__(self, config):
"""One instance of Globals is created during application
initialization and is available during requests via the 'g'
variable
initialization and is available during requests via the
'app_globals' variable
"""
pass
self.cache = CacheManager(**parse_cache_config_options(config))

View file

@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# DDPortfolio service base controller
# Copyright (c) 2009 Jan Dittberner <jan@dittberner.info>
# Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
#
# This file is part of DDPortfolio service.
#
@ -22,18 +22,12 @@
#
"""The base Controller API
Provides the BaseController class for subclassing, and other objects
utilized by Controllers.
Provides the BaseController class for subclassing.
"""
from pylons import c, cache, config, g, request, response, session
from pylons import tmpl_context as c, request
from pylons.controllers import WSGIController
from pylons.controllers.util import abort, etag_cache, redirect_to
from pylons.decorators import jsonify, validate
from pylons.i18n import _, ungettext, N_, add_fallback
from pylons.templating import render
import ddportfolioservice.lib.helpers as h
import ddportfolioservice.model as model
from pylons.i18n import add_fallback
from pylons.templating import render_mako as render
class BaseController(WSGIController):
@ -50,7 +44,3 @@ class BaseController(WSGIController):
pass
c.messages = { 'errors': [], 'messages': [] }
return WSGIController.__call__(self, environ, start_response)
# Include the '_' function in the public names
__all__ = [__name for __name in locals().keys() if not __name.startswith('_') \
or __name == '_']

View file

@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
#
# DDPortfolio service webhelpers
# Copyright (c) 2009 Jan Dittberner <jan@dittberner.info>
# Copyright © 2009, 2010 Jan Dittberner <jan@dittberner.info>
#
# This file is part of DDPortfolio service.
#
@ -23,11 +23,6 @@
"""Helper functions
Consists of functions to typically be used within templates, but also
available to Controllers. This module is available to both as 'h'.
available to Controllers. This module is available to templates as 'h'.
"""
from webhelpers import *
from webhelpers.html.tags import *
from webhelpers.html.builder import escape
from webhelpers.text import *
from webhelpers.textile import *
from routes.util import *