1
"""Base objects to be exported for use in Controllers"""
2
from paste.registry import StackedObjectProxy
4
from pylons.configuration import config
6
__all__ = ['app_globals', 'cache', 'config', 'request', 'response',
7
'session', 'tmpl_context', 'url']
11
from pkg_resources import require
13
# NOTE: this only works when the package is either installed,
14
# or has an .egg-info directory present (i.e. wont work with raw
16
info = require('pylons')[0]
17
if os.path.dirname(os.path.dirname(__file__)) == info.location:
20
return '(not installed)'
22
return '(not installed)'
24
__version__ = __figure_version()
26
app_globals = StackedObjectProxy(name="app_globals")
27
cache = StackedObjectProxy(name="cache")
28
request = StackedObjectProxy(name="request")
29
response = StackedObjectProxy(name="response")
30
session = StackedObjectProxy(name="session")
31
tmpl_context = StackedObjectProxy(name="tmpl_context or C")
32
url = StackedObjectProxy(name="url")
34
translator = StackedObjectProxy(name="translator")