[TurboGears2] * Mon Oct 18 2010 Luke Macken <lmacken at redhat.com> - 2.1-0.4.rc1 - Add a patch to fix a helpers impo

Luke Macken lmacken at fedoraproject.org
Mon Oct 18 16:48:56 UTC 2010


commit 9ab0946c0b1cb9c38aa167137530b120b50ef226
Author: Luke Macken <lmacken at redhat.com>
Date:   Mon Oct 18 12:48:40 2010 -0400

    * Mon Oct 18 2010 Luke Macken <lmacken at redhat.com> - 2.1-0.4.rc1
    - Add a patch to fix a helpers import issue
    - This brings our package up to speed with the latest RC1 release

 TurboGears2-helpers-r1048.patch |   80 +++++++++++++++++++++++++++++++++++++++
 TurboGears2.spec                |   10 ++++-
 2 files changed, 88 insertions(+), 2 deletions(-)
---
diff --git a/TurboGears2-helpers-r1048.patch b/TurboGears2-helpers-r1048.patch
new file mode 100644
index 0000000..a8e31fb
--- /dev/null
+++ b/TurboGears2-helpers-r1048.patch
@@ -0,0 +1,80 @@
+diff --git a/tg/configuration.py b/tg/configuration.py
+--- a/tg/configuration.py
++++ b/tg/configuration.py
+@@ -270,18 +270,16 @@ class AppConfig(Bunch):
+         Override this method to customize the way that ``app_globals``
+         and ``helpers`` are setup.
+ 
+         """
+ 
+         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."""
+ 
+         if 'beaker.session.secret' not in config:
+             raise TGConfigError("You must provide a value for 'beaker.session.secret'  If this is a project quickstarted with TG 2.0.2 or earlier \
+ double check that you have base_config['beaker.session.secret'] = 'mysecretsecret' in your app_cfg.py file.")
+ 
+diff --git a/tg/render.py b/tg/render.py
+--- a/tg/render.py
++++ b/tg/render.py
+@@ -28,17 +28,17 @@ def my_pylons_globals():
+ 
+     """
+ 
+     conf = pylons.config._current_obj()
+     c = pylons.tmpl_context._current_obj()
+     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()
+ 
+     pylons_vars = dict(
+         c=c,
+         tmpl_context=c,
+         config=conf,
+@@ -149,31 +149,29 @@ def _get_tg_vars():
+         locale = tg.request.accept_language.best_matches(),
+         errors = getattr(tmpl_context, "form_errors", {}),
+         inputs = getattr(tmpl_context, "form_values", {}),
+         request = tg.request,
+         auth_stack_enabled = 'repoze.who.plugins' in tg.request.environ,
+         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
+     #added to the template namespace
+     variable_provider = config.get('variable_provider', None)
+     if variable_provider:
+         root_vars.update(variable_provider())
+     return root_vars
diff --git a/TurboGears2.spec b/TurboGears2.spec
index c5c3016..9f19e01 100644
--- a/TurboGears2.spec
+++ b/TurboGears2.spec
@@ -2,11 +2,10 @@
 %{!?pyver: %define pyver %(%{__python} -c "import sys ; print sys.version[:3]")}
 
 %global rcver rc1
-%global devrev 1048
 
 Name:           TurboGears2
 Version:        2.1
-Release:        0.3.%{rcver}.dev%{devrev}%{?dist}
+Release:        0.4.%{rcver}%{?dist}
 Summary:        Next generation front-to-back web development megaframework built on Pylons
 
 Group:          Development/Languages
@@ -16,6 +15,8 @@ URL:            http://www.turbogears.org
 # Snapshot generated from mercurial tip 1048 with `hg backout -r 1046` to
 # remove Kajiki requirements
 Source0:        http://www.turbogears.org/2.1/downloads/%{version}/%{name}-%{version}%{rcver}.tar.bz2
+# A patch from changeset 1048 to bring our package up to speed with RC1
+Patch0:         %{name}-helpers-r1048.patch
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:      noarch
@@ -59,6 +60,7 @@ database development and everything in between:
 
 %prep
 %setup -q -n %{name}-%{version}%{rcver}
+%patch0 -p1 -b .helpers
 
 
 %build
@@ -84,6 +86,10 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Mon Oct 18 2010 Luke Macken <lmacken at redhat.com> - 2.1-0.4.rc1
+- Add a patch to fix a helpers import issue
+- This brings our package up to speed with the latest RC1 release
+
 * Tue Sep 28 2010 Luke Macken <lmacken at redhat.com> - 2.1-0.3.rc1.dev1048
 - Pre-RC1 development snapshot
 - Remove strict Pylons<0.9.7 requirement


More information about the scm-commits mailing list