[Checkins] SVN: z3ext.statusmessage/tags/1.4.0/ release tag

Nikolay Kim fafhrd91 at gmail.com
Tue Aug 11 04:03:00 EDT 2009


Log message for revision 102641:
  release tag

Changed:
  A   z3ext.statusmessage/tags/1.4.0/
  D   z3ext.statusmessage/tags/1.4.0/CHANGES.txt
  A   z3ext.statusmessage/tags/1.4.0/CHANGES.txt
  D   z3ext.statusmessage/tags/1.4.0/bootstrap.py
  A   z3ext.statusmessage/tags/1.4.0/bootstrap.py
  D   z3ext.statusmessage/tags/1.4.0/setup.py
  A   z3ext.statusmessage/tags/1.4.0/setup.py
  D   z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/__init__.py
  A   z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/__init__.py
  D   z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/configure.zcml
  A   z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/configure.zcml
  D   z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/handler.py
  A   z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/handler.py
  D   z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/interfaces.py
  A   z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/interfaces.py
  D   z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/message.py
  A   z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/message.py
  D   z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/null.py
  A   z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/null.py
  D   z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/session.py
  A   z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/session.py
  D   z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/tests/ftesting.zcml
  A   z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/tests/ftesting.zcml
  D   z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/tests/tests.py
  A   z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/tests/tests.py
  D   z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/tests/view.py
  A   z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/tests/view.py

-=-
Deleted: z3ext.statusmessage/tags/1.4.0/CHANGES.txt
===================================================================
--- z3ext.statusmessage/trunk/CHANGES.txt	2009-08-10 15:09:13 UTC (rev 102629)
+++ z3ext.statusmessage/tags/1.4.0/CHANGES.txt	2009-08-11 08:03:00 UTC (rev 102641)
@@ -1,92 +0,0 @@
-=======
-CHANGES
-=======
-
-1.3.9 (2009-07-15)
-------------------
-
-- Oppress duplicated messages
-
-
-1.3.8 (2009-06-23)
-------------------
-
-- Better checks for session service availability
-
-
-1.3.7 (2009-06-04)
-------------------
-
-- Added null status message service
-
-
-1.3.6 (2009-06-01)
-------------------
-
-- Fix publication afterCall handler
-
-
-1.3.5 (2009-04-15)
-------------------
-
-- Do not use z3c.autoinclude
-
-
-1.3.4 (2009-03-12)
-------------------
-
-- Added default css styles
-
-
-1.3.3 (2008-11-27)
-------------------
-
-- Handle error if session is not available
-
-
-1.3.2 (2008-11-23)
-------------------
-
-- Fixed tests agains zope3.4
-
-
-1.3.1 (2008-11-21)
-------------------
-
-- Fixed UnicodeEncodeError
-
-
-1.3.0 (2008-11-20)
-------------------
-
-- API refactored
-
-- Allow add messages at any stage of page processing
-
-
-1.2.1 (2008-05-14)
-------------------
-
-- Replace 'autoinclude' with 'includeDependendcies'
-
-
-1.2.0 (2008-03-21)
-------------------
-
-- rename to z3ext.statusmessage
-
-- moved to svn.zope.org
-
-
-1.1.0 (2008-03-18)
-------------------
-
-- Use z3c.autoinclude
-
-- Code cleanup
-
-
-1.0.0 (2007-12-08)
-------------------
-
-- Initial release.

Copied: z3ext.statusmessage/tags/1.4.0/CHANGES.txt (from rev 102640, z3ext.statusmessage/trunk/CHANGES.txt)
===================================================================
--- z3ext.statusmessage/tags/1.4.0/CHANGES.txt	                        (rev 0)
+++ z3ext.statusmessage/tags/1.4.0/CHANGES.txt	2009-08-11 08:03:00 UTC (rev 102641)
@@ -0,0 +1,98 @@
+=======
+CHANGES
+=======
+
+1.4.0 (2009-08-11)
+------------------
+
+- Use AfterCallEvent from z3ext.cacheheaders package
+
+
+1.3.9 (2009-07-15)
+------------------
+
+- Oppress duplicated messages
+
+
+1.3.8 (2009-06-23)
+------------------
+
+- Better checks for session service availability
+
+
+1.3.7 (2009-06-04)
+------------------
+
+- Added null status message service
+
+
+1.3.6 (2009-06-01)
+------------------
+
+- Fix publication afterCall handler
+
+
+1.3.5 (2009-04-15)
+------------------
+
+- Do not use z3c.autoinclude
+
+
+1.3.4 (2009-03-12)
+------------------
+
+- Added default css styles
+
+
+1.3.3 (2008-11-27)
+------------------
+
+- Handle error if session is not available
+
+
+1.3.2 (2008-11-23)
+------------------
+
+- Fixed tests agains zope3.4
+
+
+1.3.1 (2008-11-21)
+------------------
+
+- Fixed UnicodeEncodeError
+
+
+1.3.0 (2008-11-20)
+------------------
+
+- API refactored
+
+- Allow add messages at any stage of page processing
+
+
+1.2.1 (2008-05-14)
+------------------
+
+- Replace 'autoinclude' with 'includeDependendcies'
+
+
+1.2.0 (2008-03-21)
+------------------
+
+- rename to z3ext.statusmessage
+
+- moved to svn.zope.org
+
+
+1.1.0 (2008-03-18)
+------------------
+
+- Use z3c.autoinclude
+
+- Code cleanup
+
+
+1.0.0 (2007-12-08)
+------------------
+
+- Initial release.

Deleted: z3ext.statusmessage/tags/1.4.0/bootstrap.py
===================================================================
--- z3ext.statusmessage/trunk/bootstrap.py	2009-08-10 15:09:13 UTC (rev 102629)
+++ z3ext.statusmessage/tags/1.4.0/bootstrap.py	2009-08-11 08:03:00 UTC (rev 102641)
@@ -1,77 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2006 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Bootstrap a buildout-based project
-
-Simply run this script in a directory containing a buildout.cfg.
-The script accepts buildout command-line options, so you can
-use the -c option to specify an alternate configuration file.
-
-$Id$
-"""
-
-import os, shutil, sys, tempfile, urllib2
-
-tmpeggs = tempfile.mkdtemp()
-
-is_jython = sys.platform.startswith('java')
-
-try:
-    import pkg_resources
-except ImportError:
-    ez = {}
-    exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
-                         ).read() in ez
-    ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
-
-    import pkg_resources
-
-if sys.platform == 'win32':
-    def quote(c):
-        if ' ' in c:
-            return '"%s"' % c # work around spawn lamosity on windows
-        else:
-            return c
-else:
-    def quote (c):
-        return c
-
-cmd = 'from setuptools.command.easy_install import main; main()'
-ws  = pkg_resources.working_set
-
-if is_jython:
-    import subprocess
-    
-    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
-               ),
-           ).wait() == 0
-
-else:
-    assert os.spawnle(
-        os.P_WAIT, sys.executable, quote (sys.executable),
-        '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout',
-        dict(os.environ,
-            PYTHONPATH=
-            ws.find(pkg_resources.Requirement.parse('setuptools')).location
-            ),
-        ) == 0
-
-ws.add_entry(tmpeggs)
-ws.require('zc.buildout')
-import zc.buildout.buildout
-zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
-shutil.rmtree(tmpeggs)

Copied: z3ext.statusmessage/tags/1.4.0/bootstrap.py (from rev 102636, z3ext.statusmessage/trunk/bootstrap.py)
===================================================================
--- z3ext.statusmessage/tags/1.4.0/bootstrap.py	                        (rev 0)
+++ z3ext.statusmessage/tags/1.4.0/bootstrap.py	2009-08-11 08:03:00 UTC (rev 102641)
@@ -0,0 +1,77 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Bootstrap a buildout-based project
+
+Simply run this script in a directory containing a buildout.cfg.
+The script accepts buildout command-line options, so you can
+use the -c option to specify an alternate configuration file.
+
+$Id$
+"""
+
+import os, shutil, sys, tempfile, urllib2
+
+tmpeggs = tempfile.mkdtemp()
+
+is_jython = sys.platform.startswith('java')
+
+try:
+    import pkg_resources
+except ImportError:
+    ez = {}
+    exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py'
+                         ).read() in ez
+    ez['use_setuptools'](to_dir=tmpeggs, download_delay=0)
+
+    import pkg_resources
+
+if sys.platform == 'win32':
+    def quote(c):
+        if ' ' in c:
+            return '"%s"' % c # work around spawn lamosity on windows
+        else:
+            return c
+else:
+    def quote (c):
+        return c
+
+cmd = 'from setuptools.command.easy_install import main; main()'
+ws  = pkg_resources.working_set
+
+if is_jython:
+    import subprocess
+
+    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
+               ),
+           ).wait() == 0
+
+else:
+    assert os.spawnle(
+        os.P_WAIT, sys.executable, quote (sys.executable),
+        '-c', quote (cmd), '-mqNxd', quote (tmpeggs), 'zc.buildout',
+        dict(os.environ,
+            PYTHONPATH=
+            ws.find(pkg_resources.Requirement.parse('setuptools')).location
+            ),
+        ) == 0
+
+ws.add_entry(tmpeggs)
+ws.require('zc.buildout')
+import zc.buildout.buildout
+zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap'])
+shutil.rmtree(tmpeggs)

Deleted: z3ext.statusmessage/tags/1.4.0/setup.py
===================================================================
--- z3ext.statusmessage/trunk/setup.py	2009-08-10 15:09:13 UTC (rev 102629)
+++ z3ext.statusmessage/tags/1.4.0/setup.py	2009-08-11 08:03:00 UTC (rev 102641)
@@ -1,72 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2007 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""Setup for z3ext.statusmessage package
-
-$Id$
-"""
-import sys, os
-from setuptools import setup, find_packages
-
-def read(*rnames):
-    return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
-
-version = '1.3.10dev'
-
-
-setup(name='z3ext.statusmessage',
-      version=version,
-      description="Status messages",
-      long_description=(
-          'Detailed Dcoumentation\n' +
-          '======================\n'
-          + '\n\n' +
-          read('src', 'z3ext', 'statusmessage', 'README.txt')
-          + '\n\n' +
-          read('CHANGES.txt')
-          ),
-      classifiers=[
-        'Development Status :: 5 - Production/Stable',
-        'Environment :: Web Environment',
-        'Intended Audience :: Developers',
-        'License :: OSI Approved :: Zope Public License',
-        'Programming Language :: Python',
-        'Natural Language :: English',
-        'Operating System :: OS Independent',
-        'Topic :: Internet :: WWW/HTTP',
-        'Framework :: Zope3'],
-      author='Nikolay Kim',
-      author_email='fafhrd91 at gmail.com',
-      url='http://z3ext.net/',
-      license='ZPL 2.1',
-      packages=find_packages('src'),
-      package_dir = {'':'src'},
-      namespace_packages=['z3ext'],
-      install_requires = ['setuptools',
-                          'zope.component',
-                          'zope.interface',
-                          'zope.session',
-			  'zope.publisher',
-                          'zope.contentprovider',
-			  'zope.app.component',
-			  'zope.app.publication',
-                          ],
-      extras_require = dict(test=['zope.app.testing',
-                                  'zope.testing',
-				  'zope.testbrowser',
-                                  'zope.app.zcmlfiles',
-                                  'zope.securitypolicy',
-                                  ]),
-      include_package_data = True,
-      zip_safe = False
-      )

Copied: z3ext.statusmessage/tags/1.4.0/setup.py (from rev 102640, z3ext.statusmessage/trunk/setup.py)
===================================================================
--- z3ext.statusmessage/tags/1.4.0/setup.py	                        (rev 0)
+++ z3ext.statusmessage/tags/1.4.0/setup.py	2009-08-11 08:03:00 UTC (rev 102641)
@@ -0,0 +1,73 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Setup for z3ext.statusmessage package
+
+$Id$
+"""
+import sys, os
+from setuptools import setup, find_packages
+
+def read(*rnames):
+    return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
+
+version = '1.4.0'
+
+
+setup(name='z3ext.statusmessage',
+      version=version,
+      description="Status messages",
+      long_description=(
+          'Detailed Dcoumentation\n' +
+          '======================\n'
+          + '\n\n' +
+          read('src', 'z3ext', 'statusmessage', 'README.txt')
+          + '\n\n' +
+          read('CHANGES.txt')
+          ),
+      classifiers=[
+        'Development Status :: 5 - Production/Stable',
+        'Environment :: Web Environment',
+        'Intended Audience :: Developers',
+        'License :: OSI Approved :: Zope Public License',
+        'Programming Language :: Python',
+        'Natural Language :: English',
+        'Operating System :: OS Independent',
+        'Topic :: Internet :: WWW/HTTP',
+        'Framework :: Zope3'],
+      author='Nikolay Kim',
+      author_email='fafhrd91 at gmail.com',
+      url='http://z3ext.net/',
+      license='ZPL 2.1',
+      packages=find_packages('src'),
+      package_dir = {'':'src'},
+      namespace_packages=['z3ext'],
+      install_requires = ['setuptools',
+                          'zope.component',
+                          'zope.interface',
+                          'zope.session',
+                          'zope.publisher',
+                          'zope.contentprovider',
+                          'zope.app.component',
+                          'zope.app.publication',
+                          'z3ext.cacheheaders',
+                          ],
+      extras_require = dict(test=['zope.app.testing',
+                                  'zope.testing',
+                                  'zope.testbrowser',
+                                  'zope.app.zcmlfiles',
+                                  'zope.securitypolicy',
+                                  ]),
+      include_package_data = True,
+      zip_safe = False
+      )

Deleted: z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/__init__.py
===================================================================
--- z3ext.statusmessage/trunk/src/z3ext/statusmessage/__init__.py	2009-08-10 15:09:13 UTC (rev 102629)
+++ z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/__init__.py	2009-08-11 08:03:00 UTC (rev 102641)
@@ -1,3 +0,0 @@
-# This file is necessary to make this directory a package.
-
-import handler
\ No newline at end of file

Copied: z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/__init__.py (from rev 102636, z3ext.statusmessage/trunk/src/z3ext/statusmessage/__init__.py)
===================================================================
--- z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/__init__.py	                        (rev 0)
+++ z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/__init__.py	2009-08-11 08:03:00 UTC (rev 102641)
@@ -0,0 +1,3 @@
+# This file is necessary to make this directory a package.
+
+import handler

Deleted: z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/configure.zcml
===================================================================
--- z3ext.statusmessage/trunk/src/z3ext/statusmessage/configure.zcml	2009-08-10 15:09:13 UTC (rev 102629)
+++ z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/configure.zcml	2009-08-11 08:03:00 UTC (rev 102641)
@@ -1,27 +0,0 @@
-<configure xmlns="http://namespaces.zope.org/zope">
-
-  <!-- messages -->
-  <adapter
-     name="info"
-     factory=".message.InformationMessage" />
-
-  <adapter
-     name="warning"
-     factory=".message.WarningMessage" />
-
-  <adapter
-     name="error"
-     factory=".message.ErrorMessage" />
-
-  <!-- default message service -->
-  <adapter factory=".session.getMessageService" />
-
-  <!-- browser views -->
-  <adapter
-     name="statusMessage"
-     factory=".message.StatusMessage" />
-
-  <!-- default styles -->
-  <include file="styles.zcml" />
-
-</configure>

Copied: z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/configure.zcml (from rev 102636, z3ext.statusmessage/trunk/src/z3ext/statusmessage/configure.zcml)
===================================================================
--- z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/configure.zcml	                        (rev 0)
+++ z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/configure.zcml	2009-08-11 08:03:00 UTC (rev 102641)
@@ -0,0 +1,29 @@
+<configure xmlns="http://namespaces.zope.org/zope">
+
+  <subscriber handler=".handler.afterCallHandler" />
+
+  <!-- messages -->
+  <adapter
+     name="info"
+     factory=".message.InformationMessage" />
+
+  <adapter
+     name="warning"
+     factory=".message.WarningMessage" />
+
+  <adapter
+     name="error"
+     factory=".message.ErrorMessage" />
+
+  <!-- default message service -->
+  <adapter factory=".session.getMessageService" />
+
+  <!-- browser views -->
+  <adapter
+     name="statusMessage"
+     factory=".message.StatusMessage" />
+
+  <!-- default styles -->
+  <include file="styles.zcml" />
+
+</configure>

Deleted: z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/handler.py
===================================================================
--- z3ext.statusmessage/trunk/src/z3ext/statusmessage/handler.py	2009-08-10 15:09:13 UTC (rev 102629)
+++ z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/handler.py	2009-08-11 08:03:00 UTC (rev 102641)
@@ -1,47 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2008 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-""" 
-
-$Id$
-"""
-from threading import local
-from zope import interface, component
-from zope.app.publication.zopepublication import ZopePublication
-
-from interfaces import IStatusMessage
-
-
-# BAD! VERY BAD
-
-def newAfterCall(self, request, ob):
-    response = request.response
-
-    status = response.getStatus()
-    if status not in (302, 303):
-        service = IStatusMessage(request, None)
-        if service is not None:
-            messages = service.clear()
-
-            if messages:
-                msg = u'\n'.join(messages)
-                msg = msg.encode('utf-8', 'ignore')
-
-                body = response.consumeBody()
-                body = body.replace('<!--z3ext-statusmessage-->', msg, 1)
-                response.setResult(body)
-
-    afterCall(self, request, ob)
-
-afterCall = ZopePublication.afterCall
-ZopePublication.afterCall = newAfterCall

Copied: z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/handler.py (from rev 102636, z3ext.statusmessage/trunk/src/z3ext/statusmessage/handler.py)
===================================================================
--- z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/handler.py	                        (rev 0)
+++ z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/handler.py	2009-08-11 08:03:00 UTC (rev 102641)
@@ -0,0 +1,41 @@
+##############################################################################
+#
+# Copyright (c) 2008 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+from zope import component
+from z3ext.cacheheaders.interfaces import IAfterCallEvent
+
+from interfaces import IStatusMessage
+
+
+ at component.adapter(IAfterCallEvent)
+def afterCallHandler(event):
+    request = event.request
+    response = request.response
+
+    status = response.getStatus()
+    if status not in (302, 303):
+        service = IStatusMessage(request, None)
+        if service is not None:
+            messages = service.clear()
+
+            if messages:
+                msg = u'\n'.join(messages)
+                msg = msg.encode('utf-8', 'ignore')
+
+                body = response.consumeBody()
+                body = body.replace('<!--z3ext-statusmessage-->', msg, 1)
+                response.setResult(body)

Deleted: z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/interfaces.py
===================================================================
--- z3ext.statusmessage/trunk/src/z3ext/statusmessage/interfaces.py	2009-08-10 15:09:13 UTC (rev 102629)
+++ z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/interfaces.py	2009-08-11 08:03:00 UTC (rev 102641)
@@ -1,43 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2007 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""
-
-$Id$
-"""
-from zope import interface
-
-SESSIONKEY = 'z3ext.statusmessage'
-
-
-class IMessage(interface.Interface):
-    """ message """
-
-    def render(message):
-        """ render message """
-
-
-class IStatusMessage(interface.Interface):
-    """ message service """
-
-    def add(text, type='info'):
-        """ add message text as message to service """
-
-    def clear():
-        """ return all mesasges and clear """
-
-    def messages():
-        """ return all messages """
-
-    def __nonzero__():
-        """ check is service has messages """

Copied: z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/interfaces.py (from rev 102636, z3ext.statusmessage/trunk/src/z3ext/statusmessage/interfaces.py)
===================================================================
--- z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/interfaces.py	                        (rev 0)
+++ z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/interfaces.py	2009-08-11 08:03:00 UTC (rev 102641)
@@ -0,0 +1,43 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+from zope import interface
+
+SESSIONKEY = 'z3ext.statusmessage'
+
+
+class IMessage(interface.Interface):
+    """ message """
+
+    def render(message):
+        """ render message """
+
+
+class IStatusMessage(interface.Interface):
+    """ message service """
+
+    def add(text, type='info'):
+        """ add message text as message to service """
+
+    def clear():
+        """ return all mesasges and clear """
+
+    def messages():
+        """ return all messages """
+
+    def __nonzero__():
+        """ check is service has messages """

Deleted: z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/message.py
===================================================================
--- z3ext.statusmessage/trunk/src/z3ext/statusmessage/message.py	2009-08-10 15:09:13 UTC (rev 102629)
+++ z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/message.py	2009-08-11 08:03:00 UTC (rev 102641)
@@ -1,78 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2007 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""
-
-$Id$
-"""
-import cgi
-from zope import interface, component
-from zope.app.pagetemplate import ViewPageTemplateFile
-from zope.contentprovider.interfaces import IContentProvider
-from zope.publisher.interfaces.browser import IBrowserRequest
-
-from interfaces import IMessage
-
-
-class Message(object):
-    interface.implements(IMessage)
-    component.adapts(IBrowserRequest)
-
-    def __init__(self, request):
-        self.request = request
-
-
-class InformationMessage(Message):
-
-    cssClass = 'statusMessage'
-    index = ViewPageTemplateFile('message.pt')
-
-    @property
-    def context(self):
-        return self
-
-    def render(self, message):
-        return self.index(message=message)
-
-
-class WarningMessage(InformationMessage):
-
-    cssClass = 'statusWarningMessage'
-
-
-class ErrorMessage(InformationMessage):
-
-    cssClass = 'statusStopMessage'
-
-    def render(self, e):
-        if isinstance(e, Exception):
-            message = '%s: %s'%(e.__class__.__name__, cgi.escape(str(e), True))
-        else:
-            message = e
-
-        return super(ErrorMessage, self).render(message)
-
-
-class StatusMessage(object):
-    interface.implements(IContentProvider)
-    component.adapts(
-        interface.Interface, IBrowserRequest, interface.Interface)
-
-    def __init__(self, context, request, view):
-        self.context, self.request, self.view = context, request, view
-
-    def update(self):
-        pass
-
-    def render(self):
-        return u'<!--z3ext-statusmessage-->'

Copied: z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/message.py (from rev 102636, z3ext.statusmessage/trunk/src/z3ext/statusmessage/message.py)
===================================================================
--- z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/message.py	                        (rev 0)
+++ z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/message.py	2009-08-11 08:03:00 UTC (rev 102641)
@@ -0,0 +1,78 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+import cgi
+from zope import interface, component
+from zope.app.pagetemplate import ViewPageTemplateFile
+from zope.contentprovider.interfaces import IContentProvider
+from zope.publisher.interfaces.browser import IBrowserRequest
+
+from interfaces import IMessage
+
+
+class Message(object):
+    interface.implements(IMessage)
+    component.adapts(IBrowserRequest)
+
+    def __init__(self, request):
+        self.request = request
+
+
+class InformationMessage(Message):
+
+    cssClass = 'statusMessage'
+    index = ViewPageTemplateFile('message.pt')
+
+    @property
+    def context(self):
+        return self
+
+    def render(self, message):
+        return self.index(message=message)
+
+
+class WarningMessage(InformationMessage):
+
+    cssClass = 'statusWarningMessage'
+
+
+class ErrorMessage(InformationMessage):
+
+    cssClass = 'statusStopMessage'
+
+    def render(self, e):
+        if isinstance(e, Exception):
+            message = '%s: %s'%(e.__class__.__name__, cgi.escape(str(e), True))
+        else:
+            message = e
+
+        return super(ErrorMessage, self).render(message)
+
+
+class StatusMessage(object):
+    interface.implements(IContentProvider)
+    component.adapts(
+        interface.Interface, IBrowserRequest, interface.Interface)
+
+    def __init__(self, context, request, view):
+        self.context, self.request, self.view = context, request, view
+
+    def update(self):
+        pass
+
+    def render(self):
+        return u'<!--z3ext-statusmessage-->'

Deleted: z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/null.py
===================================================================
--- z3ext.statusmessage/trunk/src/z3ext/statusmessage/null.py	2009-08-10 15:09:13 UTC (rev 102629)
+++ z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/null.py	2009-08-11 08:03:00 UTC (rev 102641)
@@ -1,41 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2009 Zope Foundation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-""" 
-
-$Id$
-"""
-from zope import component, interface
-from zope.component import getAdapter
-from interfaces import IMessage, IStatusMessage
-
-
-class NullMessageService(object):
-    interface.implements(IStatusMessage)
-
-    def __init__(self, request):
-        self.request = request
-        self._messages = []
-
-    def add(self, text, type='info'):
-        message = getAdapter(self.request, IMessage, type)
-        self._messages.append(message.render(text))
-
-    def clear(self):
-        self._messages = []
-
-    def messages(self):
-        return tuple(self._messages)
-
-    def __nonzero__(self):
-        return bool(self._messages)

Copied: z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/null.py (from rev 102636, z3ext.statusmessage/trunk/src/z3ext/statusmessage/null.py)
===================================================================
--- z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/null.py	                        (rev 0)
+++ z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/null.py	2009-08-11 08:03:00 UTC (rev 102641)
@@ -0,0 +1,41 @@
+##############################################################################
+#
+# Copyright (c) 2009 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+from zope import component, interface
+from zope.component import getAdapter
+from interfaces import IMessage, IStatusMessage
+
+
+class NullMessageService(object):
+    interface.implements(IStatusMessage)
+
+    def __init__(self, request):
+        self.request = request
+        self._messages = []
+
+    def add(self, text, type='info'):
+        message = getAdapter(self.request, IMessage, type)
+        self._messages.append(message.render(text))
+
+    def clear(self):
+        self._messages = []
+
+    def messages(self):
+        return tuple(self._messages)
+
+    def __nonzero__(self):
+        return bool(self._messages)

Deleted: z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/session.py
===================================================================
--- z3ext.statusmessage/trunk/src/z3ext/statusmessage/session.py	2009-08-10 15:09:13 UTC (rev 102629)
+++ z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/session.py	2009-08-11 08:03:00 UTC (rev 102641)
@@ -1,81 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2007 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-"""
-
-$Id$
-"""
-from zope import interface, component
-from zope.component import getAdapter, queryUtility
-from zope.session.interfaces import ISession, ISessionDataContainer
-from zope.publisher.interfaces.browser import IBrowserRequest
-
-from null import NullMessageService
-from interfaces import SESSIONKEY, IMessage, IStatusMessage
-
-
- at component.adapter(IBrowserRequest)
- at interface.implementer(IStatusMessage)
-def getMessageService(request):
-    try:
-        session = ISession(request)
-    except:
-        return NullMessageService(request)
-
-    if queryUtility(ISessionDataContainer) is None:
-        return NullMessageService(request)
-
-    return MessageService(request, session)
-
-
-class MessageService(object):
-    """ message service """
-    component.adapts(IBrowserRequest, ISession)
-    interface.implements(IStatusMessage)
-
-    def __init__(self, request, session):
-        self.request = request
-        self.session = session
-
-    def add(self, text, type='info'):
-        message = getAdapter(self.request, IMessage, type)
-
-        try:
-            data = self.session[SESSIONKEY]
-            messages = data.get('messages', [])
-            text = message.render(text)
-            if text not in self.messages():
-                messages.append(text)
-            data['messages'] = messages
-        except Exception, e:
-            pass
-
-    def clear(self):
-        data = self.session.get(SESSIONKEY)
-        if data is not None:
-            messages = data.get('messages')
-            if messages:
-                del data['messages']
-                return messages
-        return ()
-
-    def messages(self):
-        data = self.session.get(SESSIONKEY)
-        if data is not None:
-            messages = data.get('messages')
-            if messages:
-                return messages
-        return ()
-
-    def __nonzero__(self):
-        return bool(self.messages())

Copied: z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/session.py (from rev 102636, z3ext.statusmessage/trunk/src/z3ext/statusmessage/session.py)
===================================================================
--- z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/session.py	                        (rev 0)
+++ z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/session.py	2009-08-11 08:03:00 UTC (rev 102641)
@@ -0,0 +1,81 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id$
+"""
+from zope import interface, component
+from zope.component import getAdapter, queryUtility
+from zope.session.interfaces import ISession, ISessionDataContainer
+from zope.publisher.interfaces.browser import IBrowserRequest
+
+from null import NullMessageService
+from interfaces import SESSIONKEY, IMessage, IStatusMessage
+
+
+ at component.adapter(IBrowserRequest)
+ at interface.implementer(IStatusMessage)
+def getMessageService(request):
+    try:
+        session = ISession(request)
+    except:
+        return NullMessageService(request)
+
+    if queryUtility(ISessionDataContainer) is None:
+        return NullMessageService(request)
+
+    return MessageService(request, session)
+
+
+class MessageService(object):
+    """ message service """
+    component.adapts(IBrowserRequest, ISession)
+    interface.implements(IStatusMessage)
+
+    def __init__(self, request, session):
+        self.request = request
+        self.session = session
+
+    def add(self, text, type='info'):
+        message = getAdapter(self.request, IMessage, type)
+
+        try:
+            data = self.session[SESSIONKEY]
+            messages = data.get('messages', [])
+            text = message.render(text)
+            if text not in self.messages():
+                messages.append(text)
+            data['messages'] = messages
+        except Exception, e:
+            pass
+
+    def clear(self):
+        data = self.session.get(SESSIONKEY)
+        if data is not None:
+            messages = data.get('messages')
+            if messages:
+                del data['messages']
+                return messages
+        return ()
+
+    def messages(self):
+        data = self.session.get(SESSIONKEY)
+        if data is not None:
+            messages = data.get('messages')
+            if messages:
+                return messages
+        return ()
+
+    def __nonzero__(self):
+        return bool(self.messages())

Deleted: z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/tests/ftesting.zcml
===================================================================
--- z3ext.statusmessage/trunk/src/z3ext/statusmessage/tests/ftesting.zcml	2009-08-10 15:09:13 UTC (rev 102629)
+++ z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/tests/ftesting.zcml	2009-08-11 08:03:00 UTC (rev 102641)
@@ -1,80 +0,0 @@
-<configure
-   xmlns="http://namespaces.zope.org/zope"
-   xmlns:browser="http://namespaces.zope.org/browser"
-   i18n_domain="zope">
-
-  <!-- This file is the equivalent of site.zcml and it is -->
-  <!-- used for functional testing setup -->
-
-  <include package="zope.component" file="meta.zcml" />
-  <include package="zope.securitypolicy" file="meta.zcml" />
-  <include package="zope.app.component" file="meta.zcml" />
-  <include package="zope.app.security" file="meta.zcml" />
-  <include package="zope.app.pagetemplate" file="meta.zcml" />
-
-  <include package="zope.securitypolicy" />
-  <include package="zope.contentprovider" />
-  <include package="zope.app.security" />
-  <include package="zope.app.zcmlfiles" />
-  <include package="zope.app.authentication" />
-  <include package="zope.session" />
-
-  <include package="z3ext.statusmessage" />
-
-  <browser:page
-     for="*"
-     name="test.html"
-     class="z3ext.statusmessage.tests.view.TestView"
-     permission="zope.Public" />
-
-  <browser:page
-     for="*"
-     name="test1.html"
-     class="z3ext.statusmessage.tests.view.TestView"
-     attribute="test"
-     permission="zope.Public" />
-
-  <browser:page
-     for="*"
-     name="test2.html"
-     class="z3ext.statusmessage.tests.view.TestView"
-     attribute="redirect"
-     permission="zope.Public" />
-
-  <securityPolicy
-     component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
-
-  <role id="zope.Anonymous" title="Everybody"
-        description="All users have this role implicitly" />
-  <role id="zope.Manager" title="Site Manager" />
-
-  <!-- Replace the following directive if you don't want public access -->
-  <grant permission="zope.View"
-         role="zope.Anonymous" />
-
-  <grant permission="zope.app.dublincore.view"
-         role="zope.Anonymous" />
-
-  <!-- Principals -->
-  <unauthenticatedPrincipal
-      id="zope.anybody"
-      title="Unauthenticated User" />
-
-  <!-- Principal that tests generally run as -->
-  <principal
-      id="zope.mgr"
-      title="Manager"
-      login="mgr"
-      password="mgrpw" />
-
-  <principal
-      id="zope.user"
-      title="User"
-      login="user"
-      password="userpw" />
-
-  <grant role="zope.Manager" principal="zope.mgr" />
-
-  <grantAll role="zope.Manager" />
-
-</configure>

Copied: z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/tests/ftesting.zcml (from rev 102636, z3ext.statusmessage/trunk/src/z3ext/statusmessage/tests/ftesting.zcml)
===================================================================
--- z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/tests/ftesting.zcml	                        (rev 0)
+++ z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/tests/ftesting.zcml	2009-08-11 08:03:00 UTC (rev 102641)
@@ -0,0 +1,81 @@
+<configure
+   xmlns="http://namespaces.zope.org/zope"
+   xmlns:browser="http://namespaces.zope.org/browser"
+   i18n_domain="zope">
+
+  <!-- This file is the equivalent of site.zcml and it is -->
+  <!-- used for functional testing setup -->
+
+  <include package="zope.component" file="meta.zcml" />
+  <include package="zope.securitypolicy" file="meta.zcml" />
+  <include package="zope.app.component" file="meta.zcml" />
+  <include package="zope.app.security" file="meta.zcml" />
+  <include package="zope.app.pagetemplate" file="meta.zcml" />
+
+  <include package="zope.securitypolicy" />
+  <include package="zope.contentprovider" />
+  <include package="zope.app.security" />
+  <include package="zope.app.zcmlfiles" />
+  <include package="zope.app.authentication" />
+  <include package="zope.session" />
+
+  <include package="z3ext.cacheheaders" />
+  <include package="z3ext.statusmessage" />
+
+  <browser:page
+     for="*"
+     name="test.html"
+     class="z3ext.statusmessage.tests.view.TestView"
+     permission="zope.Public" />
+
+  <browser:page
+     for="*"
+     name="test1.html"
+     class="z3ext.statusmessage.tests.view.TestView"
+     attribute="test"
+     permission="zope.Public" />
+
+  <browser:page
+     for="*"
+     name="test2.html"
+     class="z3ext.statusmessage.tests.view.TestView"
+     attribute="redirect"
+     permission="zope.Public" />
+
+  <securityPolicy
+     component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy" />
+
+  <role id="zope.Anonymous" title="Everybody"
+        description="All users have this role implicitly" />
+  <role id="zope.Manager" title="Site Manager" />
+
+  <!-- Replace the following directive if you don't want public access -->
+  <grant permission="zope.View"
+         role="zope.Anonymous" />
+
+  <grant permission="zope.app.dublincore.view"
+         role="zope.Anonymous" />
+
+  <!-- Principals -->
+  <unauthenticatedPrincipal
+      id="zope.anybody"
+      title="Unauthenticated User" />
+
+  <!-- Principal that tests generally run as -->
+  <principal
+      id="zope.mgr"
+      title="Manager"
+      login="mgr"
+      password="mgrpw" />
+
+  <principal
+      id="zope.user"
+      title="User"
+      login="user"
+      password="userpw" />
+
+  <grant role="zope.Manager" principal="zope.mgr" />
+
+  <grantAll role="zope.Manager" />
+
+</configure>

Deleted: z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/tests/tests.py
===================================================================
--- z3ext.statusmessage/trunk/src/z3ext/statusmessage/tests/tests.py	2009-08-10 15:09:13 UTC (rev 102629)
+++ z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/tests/tests.py	2009-08-11 08:03:00 UTC (rev 102641)
@@ -1,77 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2007 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-""" z3ext.statusmessage tests
-
-$Id$
-"""
-import os, unittest, doctest
-from zope.app.testing import setup
-
-from zope import interface, component
-from zope.component import provideAdapter
-from zope.session.interfaces import ISession, ISessionDataContainer
-from zope.session.session import RAMSessionDataContainer
-from zope.publisher.interfaces.browser import IBrowserRequest
-from zope.app.testing.functional import ZCMLLayer
-from zope.app.testing.functional import FunctionalDocFileSuite
-from zope.traversing.testing import setUp as setUpTraversing
-from z3ext.statusmessage import message
-
-
-statusmessageLayer = ZCMLLayer(
-    os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'),
-    __name__, 'statusmessageLayer', allow_teardown=True)
-
-
-class Session(dict):
-
-    def __getitem__(self, key):
-        if not self.has_key(key):
-            self[key] = {}
-
-        return super(Session, self).__getitem__(key)
-
-session = Session()
-
- at interface.implementer(ISession)
- at component.adapter(IBrowserRequest)
-def getSession(request):
-    return session
-
-
-def setUp(test):
-    setup.placelessSetUp()
-    setUpTraversing()
-    component.provideAdapter(getSession)
-    component.provideAdapter(message.StatusMessage, name='statusMessage')
-    component.provideUtility(RAMSessionDataContainer(), ISessionDataContainer)
-
-def tearDown(test):
-    session.__init__()
-    setup.placelessTearDown()
-
-
-def test_suite():
-    testbrowser = FunctionalDocFileSuite(
-        "testbrowser.txt",
-        optionflags=doctest.ELLIPSIS|doctest.NORMALIZE_WHITESPACE)
-    testbrowser.layer = statusmessageLayer
-
-    return unittest.TestSuite((
-            testbrowser,
-            doctest.DocFileSuite(
-                '../README.txt',
-                setUp=setUp, tearDown=tearDown,
-                optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS),
-            ))

Copied: z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/tests/tests.py (from rev 102636, z3ext.statusmessage/trunk/src/z3ext/statusmessage/tests/tests.py)
===================================================================
--- z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/tests/tests.py	                        (rev 0)
+++ z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/tests/tests.py	2009-08-11 08:03:00 UTC (rev 102641)
@@ -0,0 +1,78 @@
+##############################################################################
+#
+# Copyright (c) 2007 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+""" z3ext.statusmessage tests
+
+$Id$
+"""
+import os, unittest, doctest
+from zope.app.testing import setup
+
+from zope import interface, component
+from zope.component import provideAdapter
+from zope.session.interfaces import ISession, ISessionDataContainer
+from zope.session.session import RAMSessionDataContainer
+from zope.publisher.interfaces.browser import IBrowserRequest
+from zope.app.testing.functional import ZCMLLayer
+from zope.app.testing.functional import FunctionalDocFileSuite
+from zope.traversing.testing import setUp as setUpTraversing
+from z3ext.statusmessage import message
+
+
+statusmessageLayer = ZCMLLayer(
+    os.path.join(os.path.split(__file__)[0], 'ftesting.zcml'),
+    __name__, 'statusmessageLayer', allow_teardown=True)
+
+
+class Session(dict):
+
+    def __getitem__(self, key):
+        if not self.has_key(key):
+            self[key] = {}
+
+        return super(Session, self).__getitem__(key)
+
+session = Session()
+
+ at interface.implementer(ISession)
+ at component.adapter(IBrowserRequest)
+def getSession(request):
+    return session
+
+
+def setUp(test):
+    setup.placelessSetUp()
+    setUpTraversing()
+    component.provideAdapter(getSession)
+    component.provideAdapter(message.StatusMessage, name='statusMessage')
+    component.provideUtility(RAMSessionDataContainer(), ISessionDataContainer)
+
+
+def tearDown(test):
+    session.__init__()
+    setup.placelessTearDown()
+
+
+def test_suite():
+    testbrowser = FunctionalDocFileSuite(
+        "testbrowser.txt",
+        optionflags=doctest.ELLIPSIS|doctest.NORMALIZE_WHITESPACE)
+    testbrowser.layer = statusmessageLayer
+
+    return unittest.TestSuite((
+            testbrowser,
+            doctest.DocFileSuite(
+                '../README.txt',
+                setUp=setUp, tearDown=tearDown,
+                optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS),
+            ))

Deleted: z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/tests/view.py
===================================================================
--- z3ext.statusmessage/trunk/src/z3ext/statusmessage/tests/view.py	2009-08-10 15:09:13 UTC (rev 102629)
+++ z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/tests/view.py	2009-08-11 08:03:00 UTC (rev 102641)
@@ -1,35 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2008 Zope Corporation and Contributors.
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-##############################################################################
-""" 
-
-$Id:  2007-12-12 12:27:02Z fafhrd $
-"""
-from zope.app.pagetemplate import ViewPageTemplateFile
-from z3ext.statusmessage.interfaces import IStatusMessage
-
-
-class TestView(object):
-
-    index = ViewPageTemplateFile('test.pt')
-
-    def __call__(self):
-        return self.index()
-
-    def test(self):
-        IStatusMessage(self.request).add('Test message')
-        return self.index()
-
-    def redirect(self):
-        IStatusMessage(self.request).add('Test message with redirect')
-        self.request.response.redirect('test.html')

Copied: z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/tests/view.py (from rev 102636, z3ext.statusmessage/trunk/src/z3ext/statusmessage/tests/view.py)
===================================================================
--- z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/tests/view.py	                        (rev 0)
+++ z3ext.statusmessage/tags/1.4.0/src/z3ext/statusmessage/tests/view.py	2009-08-11 08:03:00 UTC (rev 102641)
@@ -0,0 +1,35 @@
+##############################################################################
+#
+# Copyright (c) 2008 Zope Foundation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""
+
+$Id:  2007-12-12 12:27:02Z fafhrd $
+"""
+from zope.app.pagetemplate import ViewPageTemplateFile
+from z3ext.statusmessage.interfaces import IStatusMessage
+
+
+class TestView(object):
+
+    index = ViewPageTemplateFile('test.pt')
+
+    def __call__(self):
+        return self.index()
+
+    def test(self):
+        IStatusMessage(self.request).add('Test message')
+        return self.index()
+
+    def redirect(self):
+        IStatusMessage(self.request).add('Test message with redirect')
+        self.request.response.redirect('test.html')



More information about the Checkins mailing list