Commits

Mark Ramm-Christensen  committed 2e37c77

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

  • Participants
  • Parent commits 0fb969c
  • Tags 2.1rc1

Comments (0)

Files changed (2)

File tg/configuration.py

         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."""

File tg/render.py

     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()
         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,
         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