Permalink
Browse files

Fixing helper import issues -- pylons.package does not exist, but 'pa…

…ckage' does.
  • Loading branch information...
markramm committed Oct 17, 2010
1 parent bffd9fc commit a2970cc7a09ad86e709f4d3bb159bd3bdf05a985
Showing with 5 additions and 9 deletions.
  1. +0 −2 tg/configuration.py
  2. +5 −7 tg/render.py
View
@@ -275,8 +275,6 @@ def setup_helpers_and_globals(self):
config['pylons.app_globals'] = self.package.lib.app_globals.Globals()
g = config['pylons.app_globals']
g.dotted_filename_finder = DottedFileNameFinder()
- #config['pylons.helpers'] = self.package.lib.helpers
- #config['pylons.h'] = self.package.lib.helpers
def setup_sa_auth_backend(self):
"""This method adds sa_auth information to the config."""
View
@@ -33,7 +33,7 @@ def my_pylons_globals():
g = conf.get('pylons.app_globals') or conf['pylons.g']
try:
- h = config.get('pylons.package').lib.helpers
+ h = conf.package.lib.helpers
except (AttributeError, KeyError):
h = Bunch()
@@ -154,21 +154,19 @@ def _get_tg_vars():
predicates = predicates,
)
- # TODO in 2.2: we should actually just get helpers from the package's helpers
- # module and dump the use of the SOP.
-
try:
- helpers = config['pylons.package'].lib.helpers
+ h = config.package.lib.helpers
except AttributeError, ImportError:
- helpers = Bunch()
+ h = Bunch()
root_vars = Bunch(
c = tmpl_context,
tmpl_context = tmpl_context,
response = response,
request = request,
url = tg.url,
- helpers = helpers,
+ helpers = h,
+ h = h,
tg = tg_vars
)
#Allow users to provide a callable that defines extra vars to be

0 comments on commit a2970cc

Please sign in to comment.