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
1=== modified file 'CHANGES.txt'
2--- CHANGES.txt 2012-01-07 17:54:42 +0000
3+++ CHANGES.txt 2012-11-03 20:14:19 +0000
4@@ -2,6 +2,30 @@
5 CHANGES
6 =======
7
8+3.15.0 (2012-01-19)
9+-------------------
10+
11+- Fixed: zope.app.wsgi.paste.ZopeApplication didn't emit
12+ ProcessStarting events.
13+
14+ **NOTE**
15+ If an application compensated for this by generating the event, it
16+ will need to stop or there will be multiple events
17+ emited. (Whether or not multiple events will do any harm is
18+ application specific.)
19+
20+3.14.0 (2012-01-10)
21+-------------------
22+
23+- Set the WSGI environment's ``REMOTE_USER`` item (if not already set)
24+ with the Zope principal label. (This is the same data set in
25+ the ``wsgi.logging_info`` environment item.)
26+
27+ This change allows user info to be used by `paste.translogger
28+ <http://pythonpaste.org/modules/translogger.html>`_ middleware (or
29+ any similar middleware that uses ``REMOTE_USER``), which provides
30+ access logging.
31+
32
33 3.13.0 (2011-03-15)
34 -------------------
35
36=== modified file 'PKG-INFO'
37--- PKG-INFO 2012-01-07 17:54:42 +0000
38+++ PKG-INFO 2012-11-03 20:14:19 +0000
39@@ -1,6 +1,6 @@
40 Metadata-Version: 1.0
41 Name: zope.app.wsgi
42-Version: 3.13.0
43+Version: 3.15.0
44 Summary: WSGI application for the zope.publisher
45 Home-page: http://pypi.python.org/pypi/zope.app.wsgi
46 Author: Zope Foundation and Contributors
47@@ -36,6 +36,30 @@
48 CHANGES
49 =======
50
51+ 3.15.0 (2012-01-19)
52+ -------------------
53+
54+ - Fixed: zope.app.wsgi.paste.ZopeApplication didn't emit
55+ ProcessStarting events.
56+
57+ **NOTE**
58+ If an application compensated for this by generating the event, it
59+ will need to stop or there will be multiple events
60+ emited. (Whether or not multiple events will do any harm is
61+ application specific.)
62+
63+ 3.14.0 (2012-01-10)
64+ -------------------
65+
66+ - Set the WSGI environment's ``REMOTE_USER`` item (if not already set)
67+ with the Zope principal label. (This is the same data set in
68+ the ``wsgi.logging_info`` environment item.)
69+
70+ This change allows user info to be used by `paste.translogger
71+ <http://pythonpaste.org/modules/translogger.html>`_ middleware (or
72+ any similar middleware that uses ``REMOTE_USER``), which provides
73+ access logging.
74+
75
76 3.13.0 (2011-03-15)
77 -------------------
78
79=== modified file 'debian/changelog'
80--- debian/changelog 2012-01-07 19:35:10 +0000
81+++ debian/changelog 2012-11-03 20:14:19 +0000
82@@ -1,3 +1,10 @@
83+zope.app.wsgi (3.15.0-0ubuntu1) raring; urgency=low
84+
85+ * New upstream release.
86+ * Bump Standards-Version to 3.9.3.
87+
88+ -- Logan Rosen <logatronico@gmail.com> Sat, 03 Nov 2012 16:08:43 -0400
89+
90 zope.app.wsgi (3.13.0-0ubuntu1) precise; urgency=low
91
92 * New upstream release.
93
94=== modified file 'debian/control'
95--- debian/control 2011-06-28 04:41:01 +0000
96+++ debian/control 2012-11-03 20:14:19 +0000
97@@ -5,7 +5,7 @@
98 XSBC-Original-Maintainer: Gediminas Paulauskas <menesis@pov.lt>
99 Build-Depends: debhelper (>= 7), python-all (>= 2.6.6-3~),
100 python-setuptools (>= 0.6b3), python-van.pydeb (>= 1.3.0-4)
101-Standards-Version: 3.9.2
102+Standards-Version: 3.9.3
103 X-Python-Version: >= 2.5
104
105 Package: python-zope.app.wsgi
106
107=== modified file 'setup.py'
108--- setup.py 2012-01-07 17:54:42 +0000
109+++ setup.py 2012-11-03 20:14:19 +0000
110@@ -18,12 +18,12 @@
111 ##############################################################################
112 """Setup for zope.app.wsgi package
113
114-$Id: setup.py 120963 2011-03-15 22:52:10Z janjaapdriessen $
115+$Id: setup.py 124091 2012-01-19 15:07:11Z jim $
116 """
117 from setuptools import setup, find_packages
118
119 setup(name='zope.app.wsgi',
120- version='3.13.0',
121+ version='3.15.0',
122 url='http://pypi.python.org/pypi/zope.app.wsgi',
123 license='ZPL 2.1',
124 description='WSGI application for the zope.publisher',
125@@ -48,12 +48,12 @@
126 'zope.annotation',
127 'zope.authentication',
128 'zope.browserpage',
129- 'zope.componentvocabulary',
130- 'zope.location',
131 'zope.login',
132 'zope.password',
133 'zope.principalregistry',
134 'zope.securitypolicy',
135+ 'zope.testing',
136+ 'zope.traversing',
137 ]),
138 install_requires=[
139 'setuptools',
140@@ -72,6 +72,7 @@
141 'zope.container',
142 'zope.error',
143 'zope.lifecycleevent',
144+ 'zope.processlifetime',
145 'zope.session',
146 'zope.site',
147 'zope.testbrowser[wsgi] >= 4.0.0',
148
149=== modified file 'src/zope.app.wsgi.egg-info/PKG-INFO'
150--- src/zope.app.wsgi.egg-info/PKG-INFO 2012-01-07 17:54:42 +0000
151+++ src/zope.app.wsgi.egg-info/PKG-INFO 2012-11-03 20:14:19 +0000
152@@ -1,6 +1,6 @@
153 Metadata-Version: 1.0
154 Name: zope.app.wsgi
155-Version: 3.13.0
156+Version: 3.15.0
157 Summary: WSGI application for the zope.publisher
158 Home-page: http://pypi.python.org/pypi/zope.app.wsgi
159 Author: Zope Foundation and Contributors
160@@ -36,6 +36,30 @@
161 CHANGES
162 =======
163
164+ 3.15.0 (2012-01-19)
165+ -------------------
166+
167+ - Fixed: zope.app.wsgi.paste.ZopeApplication didn't emit
168+ ProcessStarting events.
169+
170+ **NOTE**
171+ If an application compensated for this by generating the event, it
172+ will need to stop or there will be multiple events
173+ emited. (Whether or not multiple events will do any harm is
174+ application specific.)
175+
176+ 3.14.0 (2012-01-10)
177+ -------------------
178+
179+ - Set the WSGI environment's ``REMOTE_USER`` item (if not already set)
180+ with the Zope principal label. (This is the same data set in
181+ the ``wsgi.logging_info`` environment item.)
182+
183+ This change allows user info to be used by `paste.translogger
184+ <http://pythonpaste.org/modules/translogger.html>`_ middleware (or
185+ any similar middleware that uses ``REMOTE_USER``), which provides
186+ access logging.
187+
188
189 3.13.0 (2011-03-15)
190 -------------------
191
192=== modified file 'src/zope.app.wsgi.egg-info/requires.txt'
193--- src/zope.app.wsgi.egg-info/requires.txt 2012-01-07 17:54:42 +0000
194+++ src/zope.app.wsgi.egg-info/requires.txt 2012-11-03 20:14:19 +0000
195@@ -14,6 +14,7 @@
196 zope.container
197 zope.error
198 zope.lifecycleevent
199+zope.processlifetime
200 zope.session
201 zope.site
202 zope.testbrowser[wsgi] >= 4.0.0
203@@ -24,9 +25,9 @@
204 zope.annotation
205 zope.authentication
206 zope.browserpage
207-zope.componentvocabulary
208-zope.location
209 zope.login
210 zope.password
211 zope.principalregistry
212-zope.securitypolicy
213\ No newline at end of file
214+zope.securitypolicy
215+zope.testing
216+zope.traversing
217\ No newline at end of file
218
219=== modified file 'src/zope/app/wsgi/README.txt'
220--- src/zope/app/wsgi/README.txt 2010-12-15 00:51:32 +0000
221+++ src/zope/app/wsgi/README.txt 2012-11-03 20:14:19 +0000
222@@ -104,9 +104,28 @@
223 `ILoggingInfo`. Out-of-the-box, `zope.publisher` registers a base
224 adapter that returns the principal id as value::
225
226- >>> print environ
227- {'wsgi.input': <cStringIO.StringI object at ...>,
228- 'wsgi.logging_info': 'zope.anybody', 'PATH_INFO': '/'}
229+ >>> from pprint import pprint
230+ >>> pprint(environ)
231+ {'PATH_INFO': '/',
232+ 'REMOTE_USER': 'zope.anybody',
233+ 'wsgi.input': <cStringIO.StringI object at ...>,
234+ 'wsgi.logging_info': 'zope.anybody'}
235+
236+.. edge case
237+
238+ If remote user is already set, don't update it:
239+
240+ >>> environ = {
241+ ... 'PATH_INFO': '/',
242+ ... 'REMOTE_USER': 'someoneelse',
243+ ... 'wsgi.input': cStringIO.StringIO('')}
244+
245+ >>> _ = list(app(environ, start_response))
246+ >>> pprint(environ)
247+ {'PATH_INFO': '/',
248+ 'REMOTE_USER': 'someoneelse',
249+ 'wsgi.input': <cStringIO.StringI object at ...>,
250+ 'wsgi.logging_info': 'zope.anybody'}
251
252
253 Creating A WSGI Application
254
255=== modified file 'src/zope/app/wsgi/__init__.py'
256--- src/zope/app/wsgi/__init__.py 2012-01-07 17:54:42 +0000
257+++ src/zope/app/wsgi/__init__.py 2012-11-03 20:14:19 +0000
258@@ -13,7 +13,7 @@
259 ##############################################################################
260 """A WSGI Application wrapper for zope
261
262-$Id: __init__.py 119207 2010-12-28 19:49:21Z menesis $
263+$Id: __init__.py 124018 2012-01-10 23:06:01Z jim $
264 """
265 import os
266 import sys
267@@ -65,6 +65,8 @@
268 else:
269 message = logging_info.getLogMessage()
270 environ['wsgi.logging_info'] = message
271+ if 'REMOTE_USER' not in environ:
272+ environ['REMOTE_USER'] = message
273
274 # Start the WSGI server response
275 start_response(response.getStatusString(), response.getHeaders())
276
277=== modified file 'src/zope/app/wsgi/paste.py'
278--- src/zope/app/wsgi/paste.py 2012-01-07 17:54:42 +0000
279+++ src/zope/app/wsgi/paste.py 2012-11-03 20:14:19 +0000
280@@ -13,9 +13,11 @@
281 ##############################################################################
282 """An application factory for Paste
283
284-$Id: paste.py 119207 2010-12-28 19:49:21Z menesis $
285+$Id: paste.py 124089 2012-01-19 15:03:08Z jim $
286 """
287 from zope.app.wsgi import getWSGIApplication
288+import zope.event
289+import zope.processlifetime
290
291
292 def asbool(obj):
293@@ -30,4 +32,6 @@
294
295 def ZopeApplication(global_config, config_file, handle_errors=True, **options):
296 handle_errors = asbool(handle_errors)
297- return getWSGIApplication(config_file, handle_errors=handle_errors)
298+ app = getWSGIApplication(config_file, handle_errors=handle_errors)
299+ zope.event.notify(zope.processlifetime.ProcessStarting())
300+ return app
301
302=== modified file 'src/zope/app/wsgi/tests.py'
303--- src/zope/app/wsgi/tests.py 2012-01-07 19:35:10 +0000
304+++ src/zope/app/wsgi/tests.py 2012-11-03 20:14:19 +0000
305@@ -26,6 +26,42 @@
306 def cleanEvents(s):
307 zope.event.subscribers.pop()
308
309+def creating_app_w_paste_emits_ProcessStarting_event():
310+ """
311+ >>> import zope.event
312+ >>> events = []
313+ >>> subscriber = events.append
314+ >>> zope.event.subscribers.append(subscriber)
315+
316+ >>> import os, tempfile
317+ >>> temp_dir = tempfile.mkdtemp()
318+ >>> sitezcml = os.path.join(temp_dir, 'site.zcml')
319+ >>> open(sitezcml, 'w').write('<configure />')
320+ >>> zopeconf = os.path.join(temp_dir, 'zope.conf')
321+ >>> open(zopeconf, 'w').write('''
322+ ... site-definition %s
323+ ...
324+ ... <zodb>
325+ ... <mappingstorage />
326+ ... </zodb>
327+ ...
328+ ... <eventlog>
329+ ... <logfile>
330+ ... path STDOUT
331+ ... </logfile>
332+ ... </eventlog>
333+ ... ''' % sitezcml)
334+
335+ >>> import zope.app.wsgi.paste, zope.processlifetime
336+ >>> app = zope.app.wsgi.paste.ZopeApplication(
337+ ... {}, zopeconf, handle_errors=False)
338+
339+ >>> len([e for e in events
340+ ... if isinstance(e, zope.processlifetime.ProcessStarting)]) == 1
341+ True
342+
343+ >>> zope.event.subscribers.remove(subscriber)
344+ """
345
346 def test_suite():
347
348@@ -36,6 +72,8 @@
349 ])
350 filereturns_suite = doctest.DocFileSuite('filereturns.txt')
351 filereturns_suite.layer = BrowserLayer(zope.app.wsgi)
352+ dt_suite = doctest.DocTestSuite()
353+ dt_suite.layer = BrowserLayer(zope.app.wsgi)
354
355 readme_test = doctest.DocFileSuite(
356 'README.txt',
357@@ -56,4 +94,6 @@
358 testlayer_suite.layer = SillyMiddleWareBrowserLayer(zope.app.wsgi)
359
360 return unittest.TestSuite((
361- filereturns_suite, readme_test, doctest_suite, testlayer_suite))
362+ filereturns_suite, readme_test, doctest_suite, testlayer_suite,
363+ dt_suite,
364+ ))

Subscribers

People subscribed via source and target branches

to all changes: