Merge lp:~logan/ubuntu/raring/zope.app.wsgi/new-upstream into lp:ubuntu/raring/zope.app.wsgi

Proposed by Logan Rosen
Status: Merged
Merged at revision: 7
Proposed branch: lp:~logan/ubuntu/raring/zope.app.wsgi/new-upstream
Merge into: lp:ubuntu/raring/zope.app.wsgi
Diff against target: 364 lines (+163/-17)
11 files modified
CHANGES.txt (+24/-0)
PKG-INFO (+25/-1)
debian/changelog (+7/-0)
debian/control (+1/-1)
setup.py (+5/-4)
src/zope.app.wsgi.egg-info/PKG-INFO (+25/-1)
src/zope.app.wsgi.egg-info/requires.txt (+4/-3)
src/zope/app/wsgi/README.txt (+22/-3)
src/zope/app/wsgi/__init__.py (+3/-1)
src/zope/app/wsgi/paste.py (+6/-2)
src/zope/app/wsgi/tests.py (+41/-1)
To merge this branch: bzr merge lp:~logan/ubuntu/raring/zope.app.wsgi/new-upstream
Reviewer Review Type Date Requested Status
Barry Warsaw (community) Approve
Ubuntu branches Pending
Review via email: mp+132783@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Barry Warsaw (barry) wrote :

Thanks for the contribution to Ubuntu! I will sponsor this into Raring.

review: Approve
Revision history for this message
Logan Rosen (logan) wrote :

Barry, any update on sponsoring this?

Revision history for this message
Logan Rosen (logan) wrote :

Oh, just kidding. Looks like the branch is just out-of-date due to a bzr error.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CHANGES.txt'
--- CHANGES.txt 2012-01-07 17:54:42 +0000
+++ CHANGES.txt 2012-11-03 20:14:19 +0000
@@ -2,6 +2,30 @@
2CHANGES2CHANGES
3=======3=======
44
53.15.0 (2012-01-19)
6-------------------
7
8- Fixed: zope.app.wsgi.paste.ZopeApplication didn't emit
9 ProcessStarting events.
10
11 **NOTE**
12 If an application compensated for this by generating the event, it
13 will need to stop or there will be multiple events
14 emited. (Whether or not multiple events will do any harm is
15 application specific.)
16
173.14.0 (2012-01-10)
18-------------------
19
20- Set the WSGI environment's ``REMOTE_USER`` item (if not already set)
21 with the Zope principal label. (This is the same data set in
22 the ``wsgi.logging_info`` environment item.)
23
24 This change allows user info to be used by `paste.translogger
25 <http://pythonpaste.org/modules/translogger.html>`_ middleware (or
26 any similar middleware that uses ``REMOTE_USER``), which provides
27 access logging.
28
529
63.13.0 (2011-03-15)303.13.0 (2011-03-15)
7-------------------31-------------------
832
=== modified file 'PKG-INFO'
--- PKG-INFO 2012-01-07 17:54:42 +0000
+++ PKG-INFO 2012-11-03 20:14:19 +0000
@@ -1,6 +1,6 @@
1Metadata-Version: 1.01Metadata-Version: 1.0
2Name: zope.app.wsgi2Name: zope.app.wsgi
3Version: 3.13.03Version: 3.15.0
4Summary: WSGI application for the zope.publisher4Summary: WSGI application for the zope.publisher
5Home-page: http://pypi.python.org/pypi/zope.app.wsgi5Home-page: http://pypi.python.org/pypi/zope.app.wsgi
6Author: Zope Foundation and Contributors6Author: Zope Foundation and Contributors
@@ -36,6 +36,30 @@
36 CHANGES36 CHANGES
37 =======37 =======
38 38
39 3.15.0 (2012-01-19)
40 -------------------
41
42 - Fixed: zope.app.wsgi.paste.ZopeApplication didn't emit
43 ProcessStarting events.
44
45 **NOTE**
46 If an application compensated for this by generating the event, it
47 will need to stop or there will be multiple events
48 emited. (Whether or not multiple events will do any harm is
49 application specific.)
50
51 3.14.0 (2012-01-10)
52 -------------------
53
54 - Set the WSGI environment's ``REMOTE_USER`` item (if not already set)
55 with the Zope principal label. (This is the same data set in
56 the ``wsgi.logging_info`` environment item.)
57
58 This change allows user info to be used by `paste.translogger
59 <http://pythonpaste.org/modules/translogger.html>`_ middleware (or
60 any similar middleware that uses ``REMOTE_USER``), which provides
61 access logging.
62
39 63
40 3.13.0 (2011-03-15)64 3.13.0 (2011-03-15)
41 -------------------65 -------------------
4266
=== modified file 'debian/changelog'
--- debian/changelog 2012-01-07 19:35:10 +0000
+++ debian/changelog 2012-11-03 20:14:19 +0000
@@ -1,3 +1,10 @@
1zope.app.wsgi (3.15.0-0ubuntu1) raring; urgency=low
2
3 * New upstream release.
4 * Bump Standards-Version to 3.9.3.
5
6 -- Logan Rosen <logatronico@gmail.com> Sat, 03 Nov 2012 16:08:43 -0400
7
1zope.app.wsgi (3.13.0-0ubuntu1) precise; urgency=low8zope.app.wsgi (3.13.0-0ubuntu1) precise; urgency=low
29
3 * New upstream release.10 * New upstream release.
411
=== modified file 'debian/control'
--- debian/control 2011-06-28 04:41:01 +0000
+++ debian/control 2012-11-03 20:14:19 +0000
@@ -5,7 +5,7 @@
5XSBC-Original-Maintainer: Gediminas Paulauskas <menesis@pov.lt>5XSBC-Original-Maintainer: Gediminas Paulauskas <menesis@pov.lt>
6Build-Depends: debhelper (>= 7), python-all (>= 2.6.6-3~),6Build-Depends: debhelper (>= 7), python-all (>= 2.6.6-3~),
7 python-setuptools (>= 0.6b3), python-van.pydeb (>= 1.3.0-4)7 python-setuptools (>= 0.6b3), python-van.pydeb (>= 1.3.0-4)
8Standards-Version: 3.9.28Standards-Version: 3.9.3
9X-Python-Version: >= 2.59X-Python-Version: >= 2.5
1010
11Package: python-zope.app.wsgi11Package: python-zope.app.wsgi
1212
=== modified file 'setup.py'
--- setup.py 2012-01-07 17:54:42 +0000
+++ setup.py 2012-11-03 20:14:19 +0000
@@ -18,12 +18,12 @@
18##############################################################################18##############################################################################
19"""Setup for zope.app.wsgi package19"""Setup for zope.app.wsgi package
2020
21$Id: setup.py 120963 2011-03-15 22:52:10Z janjaapdriessen $21$Id: setup.py 124091 2012-01-19 15:07:11Z jim $
22"""22"""
23from setuptools import setup, find_packages23from setuptools import setup, find_packages
2424
25setup(name='zope.app.wsgi',25setup(name='zope.app.wsgi',
26 version='3.13.0',26 version='3.15.0',
27 url='http://pypi.python.org/pypi/zope.app.wsgi',27 url='http://pypi.python.org/pypi/zope.app.wsgi',
28 license='ZPL 2.1',28 license='ZPL 2.1',
29 description='WSGI application for the zope.publisher',29 description='WSGI application for the zope.publisher',
@@ -48,12 +48,12 @@
48 'zope.annotation',48 'zope.annotation',
49 'zope.authentication',49 'zope.authentication',
50 'zope.browserpage',50 'zope.browserpage',
51 'zope.componentvocabulary',
52 'zope.location',
53 'zope.login',51 'zope.login',
54 'zope.password',52 'zope.password',
55 'zope.principalregistry',53 'zope.principalregistry',
56 'zope.securitypolicy',54 'zope.securitypolicy',
55 'zope.testing',
56 'zope.traversing',
57 ]),57 ]),
58 install_requires=[58 install_requires=[
59 'setuptools',59 'setuptools',
@@ -72,6 +72,7 @@
72 'zope.container',72 'zope.container',
73 'zope.error',73 'zope.error',
74 'zope.lifecycleevent',74 'zope.lifecycleevent',
75 'zope.processlifetime',
75 'zope.session',76 'zope.session',
76 'zope.site',77 'zope.site',
77 'zope.testbrowser[wsgi] >= 4.0.0',78 'zope.testbrowser[wsgi] >= 4.0.0',
7879
=== modified file 'src/zope.app.wsgi.egg-info/PKG-INFO'
--- src/zope.app.wsgi.egg-info/PKG-INFO 2012-01-07 17:54:42 +0000
+++ src/zope.app.wsgi.egg-info/PKG-INFO 2012-11-03 20:14:19 +0000
@@ -1,6 +1,6 @@
1Metadata-Version: 1.01Metadata-Version: 1.0
2Name: zope.app.wsgi2Name: zope.app.wsgi
3Version: 3.13.03Version: 3.15.0
4Summary: WSGI application for the zope.publisher4Summary: WSGI application for the zope.publisher
5Home-page: http://pypi.python.org/pypi/zope.app.wsgi5Home-page: http://pypi.python.org/pypi/zope.app.wsgi
6Author: Zope Foundation and Contributors6Author: Zope Foundation and Contributors
@@ -36,6 +36,30 @@
36 CHANGES36 CHANGES
37 =======37 =======
38 38
39 3.15.0 (2012-01-19)
40 -------------------
41
42 - Fixed: zope.app.wsgi.paste.ZopeApplication didn't emit
43 ProcessStarting events.
44
45 **NOTE**
46 If an application compensated for this by generating the event, it
47 will need to stop or there will be multiple events
48 emited. (Whether or not multiple events will do any harm is
49 application specific.)
50
51 3.14.0 (2012-01-10)
52 -------------------
53
54 - Set the WSGI environment's ``REMOTE_USER`` item (if not already set)
55 with the Zope principal label. (This is the same data set in
56 the ``wsgi.logging_info`` environment item.)
57
58 This change allows user info to be used by `paste.translogger
59 <http://pythonpaste.org/modules/translogger.html>`_ middleware (or
60 any similar middleware that uses ``REMOTE_USER``), which provides
61 access logging.
62
39 63
40 3.13.0 (2011-03-15)64 3.13.0 (2011-03-15)
41 -------------------65 -------------------
4266
=== modified file 'src/zope.app.wsgi.egg-info/requires.txt'
--- src/zope.app.wsgi.egg-info/requires.txt 2012-01-07 17:54:42 +0000
+++ src/zope.app.wsgi.egg-info/requires.txt 2012-11-03 20:14:19 +0000
@@ -14,6 +14,7 @@
14zope.container14zope.container
15zope.error15zope.error
16zope.lifecycleevent16zope.lifecycleevent
17zope.processlifetime
17zope.session18zope.session
18zope.site19zope.site
19zope.testbrowser[wsgi] >= 4.0.020zope.testbrowser[wsgi] >= 4.0.0
@@ -24,9 +25,9 @@
24zope.annotation25zope.annotation
25zope.authentication26zope.authentication
26zope.browserpage27zope.browserpage
27zope.componentvocabulary
28zope.location
29zope.login28zope.login
30zope.password29zope.password
31zope.principalregistry30zope.principalregistry
32zope.securitypolicy
33\ No newline at end of file31\ No newline at end of file
32zope.securitypolicy
33zope.testing
34zope.traversing
34\ No newline at end of file35\ No newline at end of file
3536
=== modified file 'src/zope/app/wsgi/README.txt'
--- src/zope/app/wsgi/README.txt 2010-12-15 00:51:32 +0000
+++ src/zope/app/wsgi/README.txt 2012-11-03 20:14:19 +0000
@@ -104,9 +104,28 @@
104`ILoggingInfo`. Out-of-the-box, `zope.publisher` registers a base104`ILoggingInfo`. Out-of-the-box, `zope.publisher` registers a base
105adapter that returns the principal id as value::105adapter that returns the principal id as value::
106106
107 >>> print environ107 >>> from pprint import pprint
108 {'wsgi.input': <cStringIO.StringI object at ...>,108 >>> pprint(environ)
109 'wsgi.logging_info': 'zope.anybody', 'PATH_INFO': '/'}109 {'PATH_INFO': '/',
110 'REMOTE_USER': 'zope.anybody',
111 'wsgi.input': <cStringIO.StringI object at ...>,
112 'wsgi.logging_info': 'zope.anybody'}
113
114.. edge case
115
116 If remote user is already set, don't update it:
117
118 >>> environ = {
119 ... 'PATH_INFO': '/',
120 ... 'REMOTE_USER': 'someoneelse',
121 ... 'wsgi.input': cStringIO.StringIO('')}
122
123 >>> _ = list(app(environ, start_response))
124 >>> pprint(environ)
125 {'PATH_INFO': '/',
126 'REMOTE_USER': 'someoneelse',
127 'wsgi.input': <cStringIO.StringI object at ...>,
128 'wsgi.logging_info': 'zope.anybody'}
110129
111130
112Creating A WSGI Application131Creating A WSGI Application
113132
=== modified file 'src/zope/app/wsgi/__init__.py'
--- src/zope/app/wsgi/__init__.py 2012-01-07 17:54:42 +0000
+++ src/zope/app/wsgi/__init__.py 2012-11-03 20:14:19 +0000
@@ -13,7 +13,7 @@
13##############################################################################13##############################################################################
14"""A WSGI Application wrapper for zope14"""A WSGI Application wrapper for zope
1515
16$Id: __init__.py 119207 2010-12-28 19:49:21Z menesis $16$Id: __init__.py 124018 2012-01-10 23:06:01Z jim $
17"""17"""
18import os18import os
19import sys19import sys
@@ -65,6 +65,8 @@
65 else:65 else:
66 message = logging_info.getLogMessage()66 message = logging_info.getLogMessage()
67 environ['wsgi.logging_info'] = message67 environ['wsgi.logging_info'] = message
68 if 'REMOTE_USER' not in environ:
69 environ['REMOTE_USER'] = message
6870
69 # Start the WSGI server response71 # Start the WSGI server response
70 start_response(response.getStatusString(), response.getHeaders())72 start_response(response.getStatusString(), response.getHeaders())
7173
=== modified file 'src/zope/app/wsgi/paste.py'
--- src/zope/app/wsgi/paste.py 2012-01-07 17:54:42 +0000
+++ src/zope/app/wsgi/paste.py 2012-11-03 20:14:19 +0000
@@ -13,9 +13,11 @@
13##############################################################################13##############################################################################
14"""An application factory for Paste14"""An application factory for Paste
1515
16$Id: paste.py 119207 2010-12-28 19:49:21Z menesis $16$Id: paste.py 124089 2012-01-19 15:03:08Z jim $
17"""17"""
18from zope.app.wsgi import getWSGIApplication18from zope.app.wsgi import getWSGIApplication
19import zope.event
20import zope.processlifetime
1921
2022
21def asbool(obj):23def asbool(obj):
@@ -30,4 +32,6 @@
3032
31def ZopeApplication(global_config, config_file, handle_errors=True, **options):33def ZopeApplication(global_config, config_file, handle_errors=True, **options):
32 handle_errors = asbool(handle_errors)34 handle_errors = asbool(handle_errors)
33 return getWSGIApplication(config_file, handle_errors=handle_errors)35 app = getWSGIApplication(config_file, handle_errors=handle_errors)
36 zope.event.notify(zope.processlifetime.ProcessStarting())
37 return app
3438
=== modified file 'src/zope/app/wsgi/tests.py'
--- src/zope/app/wsgi/tests.py 2012-01-07 19:35:10 +0000
+++ src/zope/app/wsgi/tests.py 2012-11-03 20:14:19 +0000
@@ -26,6 +26,42 @@
26def cleanEvents(s):26def cleanEvents(s):
27 zope.event.subscribers.pop()27 zope.event.subscribers.pop()
2828
29def creating_app_w_paste_emits_ProcessStarting_event():
30 """
31 >>> import zope.event
32 >>> events = []
33 >>> subscriber = events.append
34 >>> zope.event.subscribers.append(subscriber)
35
36 >>> import os, tempfile
37 >>> temp_dir = tempfile.mkdtemp()
38 >>> sitezcml = os.path.join(temp_dir, 'site.zcml')
39 >>> open(sitezcml, 'w').write('<configure />')
40 >>> zopeconf = os.path.join(temp_dir, 'zope.conf')
41 >>> open(zopeconf, 'w').write('''
42 ... site-definition %s
43 ...
44 ... <zodb>
45 ... <mappingstorage />
46 ... </zodb>
47 ...
48 ... <eventlog>
49 ... <logfile>
50 ... path STDOUT
51 ... </logfile>
52 ... </eventlog>
53 ... ''' % sitezcml)
54
55 >>> import zope.app.wsgi.paste, zope.processlifetime
56 >>> app = zope.app.wsgi.paste.ZopeApplication(
57 ... {}, zopeconf, handle_errors=False)
58
59 >>> len([e for e in events
60 ... if isinstance(e, zope.processlifetime.ProcessStarting)]) == 1
61 True
62
63 >>> zope.event.subscribers.remove(subscriber)
64 """
2965
30def test_suite():66def test_suite():
3167
@@ -36,6 +72,8 @@
36 ])72 ])
37 filereturns_suite = doctest.DocFileSuite('filereturns.txt')73 filereturns_suite = doctest.DocFileSuite('filereturns.txt')
38 filereturns_suite.layer = BrowserLayer(zope.app.wsgi)74 filereturns_suite.layer = BrowserLayer(zope.app.wsgi)
75 dt_suite = doctest.DocTestSuite()
76 dt_suite.layer = BrowserLayer(zope.app.wsgi)
3977
40 readme_test = doctest.DocFileSuite(78 readme_test = doctest.DocFileSuite(
41 'README.txt',79 'README.txt',
@@ -56,4 +94,6 @@
56 testlayer_suite.layer = SillyMiddleWareBrowserLayer(zope.app.wsgi)94 testlayer_suite.layer = SillyMiddleWareBrowserLayer(zope.app.wsgi)
5795
58 return unittest.TestSuite((96 return unittest.TestSuite((
59 filereturns_suite, readme_test, doctest_suite, testlayer_suite))97 filereturns_suite, readme_test, doctest_suite, testlayer_suite,
98 dt_suite,
99 ))

Subscribers

People subscribed via source and target branches

to all changes: