Hello community,
here is the log from the commit of package python-pecan for openSUSE:Factory checked in at 2014-01-13 13:49:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pecan (Old)
and /work/SRC/openSUSE:Factory/.python-pecan.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pecan"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pecan/python-pecan.changes 2013-12-06 09:44:04.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.python-pecan.new/python-pecan.changes 2014-01-13 13:49:59.000000000 +0100
@@ -1,0 +2,20 @@
+Fri Jan 10 17:21:45 UTC 2014 - dmueller@suse.com
+
+- update to 0.4.4:
+ * Removed memoization of certain controller attributes, which can lead to
+ a memory leak in dynamic controller lookups.
+ * Fixed several bugs for RestController.
+ * Fixed a bug in security handling for generic controllers.
+ * Resolved a bug in `_default` handlers used in `RestController`.
+ * Persist `pecan.request.context` across internal redirects.
+- reenable make check
+
+-------------------------------------------------------------------
+Tue Dec 10 10:00:03 UTC 2013 - dmueller@suse.com
+
+- fix requires after the version update to 0.4.2, it was even
+ documented in the .changes file:
+ * Replaced the ``simplegeneric`` dependency with the new
+ ``functools.singledispatch`` function in preparation for Python 3.4 support.
+
+-------------------------------------------------------------------
Old:
----
pecan-0.4.2.tar.gz
New:
----
pecan-0.4.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pecan.spec ++++++
--- /var/tmp/diff_new_pack.c4aY2D/_old 2014-01-13 13:50:00.000000000 +0100
+++ /var/tmp/diff_new_pack.c4aY2D/_new 2014-01-13 13:50:00.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-pecan
#
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +17,7 @@
Name: python-pecan
-Version: 0.4.2
+Version: 0.4.4
Release: 0
Summary: A WSGI object-dispatching web framework, designed to be lean and fast
License: BSD-3-Clause
@@ -27,23 +27,27 @@
BuildRequires: python-devel
BuildRequires: python-setuptools
# Test requirements:
-#BuildRequires: python-Genshi
-#BuildRequires: python-Jinja2
-#BuildRequires: python-Mako >= 0.4.0
-#BuildRequires: python-WebOb >= 1.2dev
-#BuildRequires: python-WebTest >= 1.3.1
-#BuildRequires: python-gunicorn
-#BuildRequires: python-simplegeneric >= 0.8
-#BuildRequires: python-virtualenv
+%if 0%{?suse_version} >= 1230
+BuildRequires: python-Genshi
+BuildRequires: python-Jinja2
+BuildRequires: python-Kajiki
+BuildRequires: python-Mako >= 0.4.0
+BuildRequires: python-SQLAlchemy
+BuildRequires: python-WebTest >= 1.3.1
+BuildRequires: python-gunicorn
+BuildRequires: python-mock
+BuildRequires: python-singledispatch
+BuildRequires: python-virtualenv
+%endif
BuildRequires: python-six
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
Requires: python-logutils
%endif
-Requires: python-Mako >= 0.6.2
-Requires: python-MarkupSafe >= 0.15
-Requires: python-WebOb >= 1.2b3
-Requires: python-WebTest >= 1.3.3
-Requires: python-simplegeneric >= 0.8.1
+Requires: python-Mako >= 0.4.0
+Requires: python-WebOb >= 1.2dev
+Requires: python-WebTest >= 1.3.1
+Requires: python-singledispatch
+Requires: python-six
Suggests: python-Jinja2
Suggests: python-Genshi
Suggests: python-gunicorn
@@ -68,8 +72,10 @@
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
-#%%check
-#python setup.py test
+%if 0%{?suse_version} >= 1230
+%check
+python setup.py test
+%endif
%files
%defattr(-,root,root,-)
++++++ pecan-0.4.2.tar.gz -> pecan-0.4.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pecan-0.4.2/.coveragerc new/pecan-0.4.4/.coveragerc
--- old/pecan-0.4.2/.coveragerc 2013-09-27 23:33:46.000000000 +0200
+++ new/pecan-0.4.4/.coveragerc 2014-01-08 16:14:17.000000000 +0100
@@ -1,3 +1,2 @@
[run]
source=pecan
-omit=pecan/compat/dictconfig.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pecan-0.4.2/PKG-INFO new/pecan-0.4.4/PKG-INFO
--- old/pecan-0.4.2/PKG-INFO 2013-09-27 23:33:55.000000000 +0200
+++ new/pecan-0.4.4/PKG-INFO 2014-01-08 16:14:27.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pecan
-Version: 0.4.2
+Version: 0.4.4
Summary: A WSGI object-dispatching web framework, designed to be lean and fast, with few dependancies.
Home-page: http://github.com/stackforge/pecan
Author: Jonathan LaCour
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pecan-0.4.2/docs/source/changes.rst new/pecan-0.4.4/docs/source/changes.rst
--- old/pecan-0.4.2/docs/source/changes.rst 2013-09-27 23:33:46.000000000 +0200
+++ new/pecan-0.4.4/docs/source/changes.rst 2014-01-08 16:14:17.000000000 +0100
@@ -1,3 +1,15 @@
+0.4.4
+=====
+* Removed memoization of certain controller attributes, which can lead to
+ a memory leak in dynamic controller lookups.
+
+0.4.3
+=====
+* Fixed several bugs for RestController.
+* Fixed a bug in security handling for generic controllers.
+* Resolved a bug in `_default` handlers used in `RestController`.
+* Persist `pecan.request.context` across internal redirects.
+
0.4.2
=====
* Remove a routing optimization that breaks the WSME pecan plugin.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pecan-0.4.2/pecan/core.py new/pecan-0.4.4/pecan/core.py
--- old/pecan-0.4.2/pecan/core.py 2013-09-27 23:33:46.000000000 +0200
+++ new/pecan-0.4.4/pecan/core.py 2014-01-08 16:14:17.000000000 +0100
@@ -14,6 +14,7 @@
from webob import Request, Response, exc, acceptparse
from .compat import urlparse, unquote_plus, izip
+from .secure import handle_security
from .templating import RendererFactory
from .routing import lookup_controller, NonCanonicalPath
from .util import _cfg, encode_if_needed
@@ -119,6 +120,7 @@
if internal:
if code is not None:
raise ValueError('Cannot specify a code for internal redirects')
+ request.environ['pecan.recursive.context'] = request.context
raise ForwardRequestException(location)
if code is None:
code = 302
@@ -428,6 +430,7 @@
im_self = six.get_method_self(controller)
handlers = cfg['generic_handlers']
controller = handlers.get(req.method, handlers['DEFAULT'])
+ handle_security(controller, im_self)
cfg = _cfg(controller)
# add the controller to the state so that hooks can use it
@@ -561,7 +564,7 @@
# handle the request
try:
# add context and environment to the request
- req.context = {}
+ req.context = environ.get('pecan.recursive.context', {})
req.pecan = dict(content_type=None)
self.handle_request(req, resp)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pecan-0.4.2/pecan/rest.py new/pecan-0.4.4/pecan/rest.py
--- old/pecan-0.4.2/pecan/rest.py 2013-09-27 23:33:46.000000000 +0200
+++ new/pecan-0.4.4/pecan/rest.py 2014-01-08 16:14:17.000000000 +0100
@@ -54,7 +54,11 @@
return result
# handle the request
- handler = getattr(self, '_handle_%s' % method, self._handle_custom)
+ handler = getattr(
+ self,
+ '_handle_%s' % method,
+ self._handle_unknown_method
+ )
try:
result = handler(method, args)
@@ -140,9 +144,9 @@
remainder[fixed_args + 1:]
)
- def _handle_custom(self, method, remainder):
+ def _handle_unknown_method(self, method, remainder):
'''
- Routes ``_custom`` actions to the appropriate controller.
+ Routes undefined actions (like RESET) to the appropriate controller.
'''
# try finding a post_{custom} or {custom} method first
controller = self._find_controller('post_%s' % method, method)
@@ -180,14 +184,10 @@
if controller:
return controller, remainder[:-1]
- # check for custom GET requests
- if method.upper() in self._custom_actions.get(method_name, []):
- controller = self._find_controller(
- 'get_%s' % method_name,
- method_name
- )
- if controller:
- return controller, remainder[:-1]
+ match = self._handle_custom_action(method, remainder)
+ if match:
+ return match
+
controller = getattr(self, remainder[0], None)
if controller and not ismethod(controller):
return lookup_controller(controller, remainder[1:])
@@ -204,6 +204,10 @@
Routes ``DELETE`` actions to the appropriate controller.
'''
if remainder:
+ match = self._handle_custom_action(method, remainder)
+ if match:
+ return match
+
controller = getattr(self, remainder[0], None)
if controller and not ismethod(controller):
return lookup_controller(controller, remainder[1:])
@@ -230,14 +234,10 @@
'''
# check for custom POST/PUT requests
if remainder:
- method_name = remainder[-1]
- if method.upper() in self._custom_actions.get(method_name, []):
- controller = self._find_controller(
- '%s_%s' % (method, method_name),
- method_name
- )
- if controller:
- return controller, remainder[:-1]
+ match = self._handle_custom_action(method, remainder)
+ if match:
+ return match
+
controller = getattr(self, remainder[0], None)
if controller and not ismethod(controller):
return lookup_controller(controller, remainder[1:])
@@ -252,6 +252,25 @@
def _handle_put(self, method, remainder):
return self._handle_post(method, remainder)
+ def _handle_custom_action(self, method, remainder):
+ remainder = [r for r in remainder if r]
+ if remainder:
+ if method in ('put', 'delete'):
+ # For PUT and DELETE, additional arguments are supplied, e.g.,
+ # DELETE /foo/XYZ
+ method_name = remainder[0]
+ remainder = remainder[1:]
+ else:
+ method_name = remainder[-1]
+ remainder = remainder[:-1]
+ if method.upper() in self._custom_actions.get(method_name, []):
+ controller = self._find_controller(
+ '%s_%s' % (method, method_name),
+ method_name
+ )
+ if controller:
+ return controller, remainder
+
def _set_routing_args(self, args):
'''
Sets default routing arguments.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pecan-0.4.2/pecan/routing.py new/pecan-0.4.4/pecan/routing.py
--- old/pecan-0.4.2/pecan/routing.py 2013-09-27 23:33:46.000000000 +0200
+++ new/pecan-0.4.4/pecan/routing.py 2014-01-08 16:14:17.000000000 +0100
@@ -36,7 +36,7 @@
obj, remainder = find_object(obj, remainder, notfound_handlers)
handle_security(obj)
return obj, remainder
- except PecanNotFound:
+ except (exc.HTTPNotFound, PecanNotFound):
while notfound_handlers:
name, obj, remainder = notfound_handlers.pop()
if name == '_default':
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pecan-0.4.2/pecan/secure.py new/pecan-0.4.4/pecan/secure.py
--- old/pecan-0.4.2/pecan/secure.py 2013-09-27 23:33:46.000000000 +0200
+++ new/pecan-0.4.4/pecan/secure.py 2014-01-08 16:14:17.000000000 +0100
@@ -119,7 +119,6 @@
To secure a class, invoke with two arguments:
secure(<obj instance>,