[Checkins] SVN: z3ext.statusmessage/trunk/ Use AfterCallEvent from z3ext.cacheheaders package
Nikolay Kim
fafhrd91 at gmail.com
Tue Aug 11 03:33:08 EDT 2009
Log message for revision 102636:
Use AfterCallEvent from z3ext.cacheheaders package
Changed:
U z3ext.statusmessage/trunk/CHANGES.txt
U z3ext.statusmessage/trunk/bootstrap.py
U z3ext.statusmessage/trunk/setup.py
U z3ext.statusmessage/trunk/src/z3ext/statusmessage/__init__.py
U z3ext.statusmessage/trunk/src/z3ext/statusmessage/configure.zcml
U z3ext.statusmessage/trunk/src/z3ext/statusmessage/handler.py
U z3ext.statusmessage/trunk/src/z3ext/statusmessage/interfaces.py
U z3ext.statusmessage/trunk/src/z3ext/statusmessage/message.py
U z3ext.statusmessage/trunk/src/z3ext/statusmessage/null.py
U z3ext.statusmessage/trunk/src/z3ext/statusmessage/session.py
U z3ext.statusmessage/trunk/src/z3ext/statusmessage/tests/ftesting.zcml
U z3ext.statusmessage/trunk/src/z3ext/statusmessage/tests/tests.py
U z3ext.statusmessage/trunk/src/z3ext/statusmessage/tests/view.py
-=-
Modified: z3ext.statusmessage/trunk/CHANGES.txt
===================================================================
--- z3ext.statusmessage/trunk/CHANGES.txt 2009-08-11 07:28:40 UTC (rev 102635)
+++ z3ext.statusmessage/trunk/CHANGES.txt 2009-08-11 07:33:08 UTC (rev 102636)
@@ -2,6 +2,12 @@
CHANGES
=======
+1.4.0 (Unreleased)
+------------------
+
+- Use AfterCallEvent from z3ext.cacheheaders package
+
+
1.3.9 (2009-07-15)
------------------
Modified: z3ext.statusmessage/trunk/bootstrap.py
===================================================================
--- z3ext.statusmessage/trunk/bootstrap.py 2009-08-11 07:28:40 UTC (rev 102635)
+++ z3ext.statusmessage/trunk/bootstrap.py 2009-08-11 07:33:08 UTC (rev 102636)
@@ -1,6 +1,6 @@
##############################################################################
#
-# Copyright (c) 2006 Zope Corporation and Contributors.
+# Copyright (c) 2006 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
@@ -51,9 +51,9 @@
if is_jython:
import subprocess
-
- assert subprocess.Popen([sys.executable] + ['-c', quote(cmd), '-mqNxd',
- quote(tmpeggs), 'zc.buildout'],
+
+ assert subprocess.Popen([sys.executable] + ['-c', quote(cmd), '-mqNxd',
+ quote(tmpeggs), 'zc.buildout'],
env=dict(os.environ,
PYTHONPATH=
ws.find(pkg_resources.Requirement.parse('setuptools')).location
Modified: z3ext.statusmessage/trunk/setup.py
===================================================================
--- z3ext.statusmessage/trunk/setup.py 2009-08-11 07:28:40 UTC (rev 102635)
+++ z3ext.statusmessage/trunk/setup.py 2009-08-11 07:33:08 UTC (rev 102636)
@@ -1,6 +1,6 @@
##############################################################################
#
-# Copyright (c) 2007 Zope Corporation and Contributors.
+# Copyright (c) 2007 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
@@ -56,14 +56,15 @@
'zope.component',
'zope.interface',
'zope.session',
- 'zope.publisher',
+ 'zope.publisher',
'zope.contentprovider',
- 'zope.app.component',
- 'zope.app.publication',
+ 'zope.app.component',
+ 'zope.app.publication',
+ 'z3ext.cacheheaders',
],
extras_require = dict(test=['zope.app.testing',
'zope.testing',
- 'zope.testbrowser',
+ 'zope.testbrowser',
'zope.app.zcmlfiles',
'zope.securitypolicy',
]),
Modified: z3ext.statusmessage/trunk/src/z3ext/statusmessage/__init__.py
===================================================================
--- z3ext.statusmessage/trunk/src/z3ext/statusmessage/__init__.py 2009-08-11 07:28:40 UTC (rev 102635)
+++ z3ext.statusmessage/trunk/src/z3ext/statusmessage/__init__.py 2009-08-11 07:33:08 UTC (rev 102636)
@@ -1,3 +1,3 @@
# This file is necessary to make this directory a package.
-import handler
\ No newline at end of file
+import handler
Modified: z3ext.statusmessage/trunk/src/z3ext/statusmessage/configure.zcml
===================================================================
--- z3ext.statusmessage/trunk/src/z3ext/statusmessage/configure.zcml 2009-08-11 07:28:40 UTC (rev 102635)
+++ z3ext.statusmessage/trunk/src/z3ext/statusmessage/configure.zcml 2009-08-11 07:33:08 UTC (rev 102636)
@@ -1,5 +1,7 @@
<configure xmlns="http://namespaces.zope.org/zope">
+ <subscriber handler=".handler.afterCallHandler" />
+
<!-- messages -->
<adapter
name="info"
Modified: z3ext.statusmessage/trunk/src/z3ext/statusmessage/handler.py
===================================================================
--- z3ext.statusmessage/trunk/src/z3ext/statusmessage/handler.py 2009-08-11 07:28:40 UTC (rev 102635)
+++ z3ext.statusmessage/trunk/src/z3ext/statusmessage/handler.py 2009-08-11 07:33:08 UTC (rev 102636)
@@ -1,6 +1,6 @@
##############################################################################
#
-# Copyright (c) 2008 Zope Corporation and Contributors.
+# Copyright (c) 2008 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
@@ -11,20 +11,19 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""
+"""
$Id$
"""
-from threading import local
-from zope import interface, component
-from zope.app.publication.zopepublication import ZopePublication
+from zope import component
+from z3ext.cacheheaders.interfaces import IAfterCallEvent
from interfaces import IStatusMessage
-# BAD! VERY BAD
-
-def newAfterCall(self, request, ob):
+ at component.adapter(IAfterCallEvent)
+def afterCallHandler(event):
+ request = event.request
response = request.response
status = response.getStatus()
@@ -40,8 +39,3 @@
body = response.consumeBody()
body = body.replace('<!--z3ext-statusmessage-->', msg, 1)
response.setResult(body)
-
- afterCall(self, request, ob)
-
-afterCall = ZopePublication.afterCall
-ZopePublication.afterCall = newAfterCall
Modified: z3ext.statusmessage/trunk/src/z3ext/statusmessage/interfaces.py
===================================================================
--- z3ext.statusmessage/trunk/src/z3ext/statusmessage/interfaces.py 2009-08-11 07:28:40 UTC (rev 102635)
+++ z3ext.statusmessage/trunk/src/z3ext/statusmessage/interfaces.py 2009-08-11 07:33:08 UTC (rev 102636)
@@ -1,6 +1,6 @@
##############################################################################
#
-# Copyright (c) 2007 Zope Corporation and Contributors.
+# Copyright (c) 2007 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
Modified: z3ext.statusmessage/trunk/src/z3ext/statusmessage/message.py
===================================================================
--- z3ext.statusmessage/trunk/src/z3ext/statusmessage/message.py 2009-08-11 07:28:40 UTC (rev 102635)
+++ z3ext.statusmessage/trunk/src/z3ext/statusmessage/message.py 2009-08-11 07:33:08 UTC (rev 102636)
@@ -1,6 +1,6 @@
##############################################################################
#
-# Copyright (c) 2007 Zope Corporation and Contributors.
+# Copyright (c) 2007 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
Modified: z3ext.statusmessage/trunk/src/z3ext/statusmessage/null.py
===================================================================
--- z3ext.statusmessage/trunk/src/z3ext/statusmessage/null.py 2009-08-11 07:28:40 UTC (rev 102635)
+++ z3ext.statusmessage/trunk/src/z3ext/statusmessage/null.py 2009-08-11 07:33:08 UTC (rev 102636)
@@ -11,7 +11,7 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""
+"""
$Id$
"""
Modified: z3ext.statusmessage/trunk/src/z3ext/statusmessage/session.py
===================================================================
--- z3ext.statusmessage/trunk/src/z3ext/statusmessage/session.py 2009-08-11 07:28:40 UTC (rev 102635)
+++ z3ext.statusmessage/trunk/src/z3ext/statusmessage/session.py 2009-08-11 07:33:08 UTC (rev 102636)
@@ -1,6 +1,6 @@
##############################################################################
#
-# Copyright (c) 2007 Zope Corporation and Contributors.
+# Copyright (c) 2007 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
Modified: z3ext.statusmessage/trunk/src/z3ext/statusmessage/tests/ftesting.zcml
===================================================================
--- z3ext.statusmessage/trunk/src/z3ext/statusmessage/tests/ftesting.zcml 2009-08-11 07:28:40 UTC (rev 102635)
+++ z3ext.statusmessage/trunk/src/z3ext/statusmessage/tests/ftesting.zcml 2009-08-11 07:33:08 UTC (rev 102636)
@@ -19,6 +19,7 @@
<include package="zope.app.authentication" />
<include package="zope.session" />
+ <include package="z3ext.cacheheaders" />
<include package="z3ext.statusmessage" />
<browser:page
Modified: z3ext.statusmessage/trunk/src/z3ext/statusmessage/tests/tests.py
===================================================================
--- z3ext.statusmessage/trunk/src/z3ext/statusmessage/tests/tests.py 2009-08-11 07:28:40 UTC (rev 102635)
+++ z3ext.statusmessage/trunk/src/z3ext/statusmessage/tests/tests.py 2009-08-11 07:33:08 UTC (rev 102636)
@@ -1,6 +1,6 @@
##############################################################################
#
-# Copyright (c) 2007 Zope Corporation and Contributors.
+# Copyright (c) 2007 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
@@ -57,6 +57,7 @@
component.provideAdapter(message.StatusMessage, name='statusMessage')
component.provideUtility(RAMSessionDataContainer(), ISessionDataContainer)
+
def tearDown(test):
session.__init__()
setup.placelessTearDown()
Modified: z3ext.statusmessage/trunk/src/z3ext/statusmessage/tests/view.py
===================================================================
--- z3ext.statusmessage/trunk/src/z3ext/statusmessage/tests/view.py 2009-08-11 07:28:40 UTC (rev 102635)
+++ z3ext.statusmessage/trunk/src/z3ext/statusmessage/tests/view.py 2009-08-11 07:33:08 UTC (rev 102636)
@@ -1,6 +1,6 @@
##############################################################################
#
-# Copyright (c) 2008 Zope Corporation and Contributors.
+# Copyright (c) 2008 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
@@ -11,7 +11,7 @@
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""
+"""
$Id: 2007-12-12 12:27:02Z fafhrd $
"""
More information about the Checkins
mailing list