[TurboGears/f14/master] Revert "- Update to upstream 1.1.1"
Toshio くらとみ
toshio at fedoraproject.org
Tue Jan 18 01:19:57 UTC 2011
commit 7714ecbd483f2bd467ce3dbf3963eff13afee177
Author: Toshio Kuratomi <toshio at fedoraproject.org>
Date: Mon Jan 17 17:17:26 2011 -0800
Revert "- Update to upstream 1.1.1"
This reverts commit 65fa9ff1ce06e0309abd207eda9d6f0b5ef9ea9d.
TurboGears-1.0.8-paginate.patch | 89 ++++++++++++++++++++++++++++++++++++
TurboGears-1.0.8-setup.patch | 21 ++++++++
turbogears-deprecation.patch | 57 +++++++++++++++++++++++
turbogears-feed.patch | 13 -----
turbogears-js-mime-type-test.patch | 14 ------
turbogears-sa0.6.patch | 15 ++++++
6 files changed, 182 insertions(+), 27 deletions(-)
---
diff --git a/TurboGears-1.0.8-paginate.patch b/TurboGears-1.0.8-paginate.patch
new file mode 100644
index 0000000..a5c24e1
--- /dev/null
+++ b/TurboGears-1.0.8-paginate.patch
@@ -0,0 +1,89 @@
+Index: /branches/1.0/turbogears/paginate.py
+===================================================================
+--- /branches/1.0/turbogears/paginate.py (revision 5317)
++++ /branches/1.0/turbogears/paginate.py (revision 6575)
+@@ -82,6 +82,6 @@
+ @type limit: integer
+
+- @param max_limit: The maximum number to which the imposed limit
+- can be increased using the dynamic_limit keyword argument in the URL.
++ @param max_limit: The maximum number to which the imposed limit can be
++ increased using the "var_name"_tgp_limit keyword argument in the URL.
+ If this is set to 0, no dynamic change at all will be allowed;
+ if it is set to None, any change will be allowed.
+@@ -113,4 +113,15 @@
+ """
+
++ if default_reversed is not None:
++ warnings.warn("default_reversed is deprecated."
++ " Use default_order='-field' to indicate"
++ " default reversed order, or"
++ " default_order=['field1', '-field2, 'field3']"
++ " for multiple fields.", DeprecationWarning, 2)
++ if allow_limit_override is not None:
++ warnings.warn("allow_limit_override is deprecated."
++ " Use max_limit to specify an upper bound for limit.",
++ DeprecationWarning, 2)
++
+ def entangle(func):
+
+@@ -122,15 +133,4 @@
+ return kw.pop(var_name + '_tgp_' + name,
+ kw.pop('tg_paginate_' + name, default))
+-
+- if default_reversed is not None:
+- warnings.warn("default_reversed is deprecated."
+- " Use default_order='-field' to indicate"
+- " default reversed order, or"
+- " default_order=['field1', '-field2, 'field3']"
+- " for multiple fields.", DeprecationWarning, 2)
+- if allow_limit_override is not None:
+- warnings.warn("allow_limit_override is deprecated."
+- " Use max_limit to specify an upper bound for limit.",
+- DeprecationWarning, 2)
+
+ page = kwpop('no')
+@@ -152,6 +152,7 @@
+ try:
+ limit_ = int(kwpop('limit'))
+- if max_limit is not None:
+- if max_limit <= 0 and not allow_limit_override:
++ if max_limit is not None and not (
++ allow_limit_override and max_limit == 0):
++ if max_limit <= 0:
+ raise ValueError
+ limit_ = min(limit_, max_limit)
+Index: /branches/1.0/turbogears/tests/test_paginate.py
+===================================================================
+--- /branches/1.0/turbogears/tests/test_paginate.py (revision 5674)
++++ /branches/1.0/turbogears/tests/test_paginate.py (revision 6575)
+@@ -471,4 +471,29 @@
+ Spy.assert_ok(self.body, 'pages', xrange(1, 3))
+
++ def test_limit_override_deprecated(self):
++ import sys, StringIO
++ stderr, sys.stderr = sys.stderr, StringIO.StringIO()
++ try:
++ class DeprecatedMixin(RootController):
++ [expose()]
++ [paginate("data", limit=4, allow_limit_override=True)]
++ def custom_limit_deprecated(self):
++ spy = Spy(var_name='data',
++ order=None, ordering=[], row_count=10)
++ data = range(10)
++ return dict(data=data, spy=spy)
++ finally:
++ stderr, sys.stderr = sys.stderr, stderr
++ warn = stderr.getvalue()
++ stderr.close()
++ assert 'allow_limit_override is deprecated.' in warn
++ self.MyRoot.__bases__ = (DeprecatedMixin,) + self.MyRoot.__bases__
++ # can override limit (using deprecated parameter)
++ self.request('/custom_limit_deprecated?tg_paginate_limit=2')
++ assert '"data": [0, 1]' in self.body
++ Spy.assert_ok(self.body, 'page_count', 5)
++ Spy.assert_ok(self.body, 'limit', 2)
++ Spy.assert_ok(self.body, 'pages', xrange(1, 6))
++
+ def test_max_pages(self):
+ self.request("/default_max_pages")
diff --git a/TurboGears-1.0.8-setup.patch b/TurboGears-1.0.8-setup.patch
new file mode 100644
index 0000000..13cf1a9
--- /dev/null
+++ b/TurboGears-1.0.8-setup.patch
@@ -0,0 +1,21 @@
+Index: setup.py
+===================================================================
+--- setup.py.orig
++++ setup.py
+@@ -20,7 +20,6 @@ execfile(os.path.join("turbogears", "rel
+ # setup params
+ install_requires = [
+ "CherryPy >= 2.3.0, < 3.0.0alpha",
+- "ConfigObj >= 4.3.2",
+ "DecoratorTools >= 1.4",
+ "FormEncode >= 0.7.1",
+ "PasteScript >= 1.6.2",
+@@ -29,7 +28,7 @@ install_requires = [
+ "simplejson >= 1.3",
+ "TurboCheetah >= 1.0",
+ # TurboJson >= 1.2 uses PEAK-Rules
+- "TurboJson >= 1.1.4, < 1.2",
++ "TurboJson >= 1.1.4",
+ "TurboKid >= 1.0.4",
+ ]
+
diff --git a/turbogears-deprecation.patch b/turbogears-deprecation.patch
new file mode 100644
index 0000000..d7b3731
--- /dev/null
+++ b/turbogears-deprecation.patch
@@ -0,0 +1,57 @@
+Index: TurboGears-1.0.9/turbogears/identity/__init__.py
+===================================================================
+--- TurboGears-1.0.9.orig/turbogears/identity/__init__.py
++++ TurboGears-1.0.9/turbogears/identity/__init__.py
+@@ -6,8 +6,15 @@
+
+ """
+
+-import md5
+-import sha
++try:
++ from hashlib import md5
++except ImportError:
++ from md5 import new as md5
++try:
++ from hashlib import sha1
++except ImportError:
++ from sha import new as sha1
++
+ import threading
+
+ import cherrypy
+@@ -148,9 +155,9 @@ def _encrypt_password(algorithm, passwor
+ else:
+ password_8bit = password
+ if algorithm == 'md5':
+- hashed_password = md5.new(password_8bit).hexdigest()
++ hashed_password = md5(password_8bit).hexdigest()
+ elif algorithm == 'sha1':
+- hashed_password = sha.new(password_8bit).hexdigest()
++ hashed_password = sha1(password_8bit).hexdigest()
+ elif algorithm == 'custom':
+ custom_encryption_path = turbogears.config.get(
+ 'identity.custom_encryption', None)
+Index: TurboGears-1.0.9/turbogears/visit/api.py
+===================================================================
+--- TurboGears-1.0.9.orig/turbogears/visit/api.py
++++ TurboGears-1.0.9/turbogears/visit/api.py
+@@ -1,5 +1,8 @@
+ import logging
+-import sha
++try:
++ from hashlib import sha1
++except ImportError:
++ from sha import new as sha1
+ import threading
+ import time
+
+@@ -255,7 +258,7 @@ class VisitFilter(BaseFilter):
+ # it's basically more noise.
+ key_string = '%s%s%s%s' % (random(), datetime.now(),
+ cherrypy.request.remote_host, cherrypy.request.remote_port)
+- return sha.new(key_string).hexdigest()
++ return sha1(key_string).hexdigest()
+ _generate_key = staticmethod(_generate_key)
+
+ def clear_cookie(self):
diff --git a/turbogears-sa0.6.patch b/turbogears-sa0.6.patch
new file mode 100644
index 0000000..aa328f6
--- /dev/null
+++ b/turbogears-sa0.6.patch
@@ -0,0 +1,15 @@
+Index: TurboGears-1.0.9/turbogears/tests/test_sqlalchemy.py
+===================================================================
+--- TurboGears-1.0.9.orig/turbogears/tests/test_sqlalchemy.py
++++ TurboGears-1.0.9/turbogears/tests/test_sqlalchemy.py
+@@ -208,8 +208,8 @@ def test_raise_sa_exception():
+ assert 'No exceptions occurred' in output
+ create_request("/create_person?id=20")
+ output = cherrypy.response.body[0]
+- # SA 0.3 uses SQLError, 0.4 DBAPIError
+- assert 'SQLError' in output or 'DBAPIError' in output
++ # SA 0.3 uses SQLError, 0.4 DBAPIError, 0.6 uses IntegrityError
++ assert 'SQLError' in output or 'DBAPIError' in output or 'IntegrityError' in output
+
+ def test_user_exception():
+ """If a controller raises an exception, transactions are rolled back."""
More information about the scm-commits
mailing list