[Checkins] SVN: zope.publisher/trunk/ Moved IMethodNotAllowed and MethodNotAllowed from zope.app.http to

Shane Hathaway shane at hathawaymix.org
Fri May 22 21:38:43 EDT 2009


Log message for revision 100270:
  Moved IMethodNotAllowed and MethodNotAllowed from zope.app.http to
  zope.publisher.interfaces.http, fixing dependency cycles involving
  zope.app.http.
  

Changed:
  U   zope.publisher/trunk/CHANGES.txt
  U   zope.publisher/trunk/setup.py
  U   zope.publisher/trunk/src/zope/publisher/interfaces/http.py

-=-
Modified: zope.publisher/trunk/CHANGES.txt
===================================================================
--- zope.publisher/trunk/CHANGES.txt	2009-05-23 01:02:24 UTC (rev 100269)
+++ zope.publisher/trunk/CHANGES.txt	2009-05-23 01:38:43 UTC (rev 100270)
@@ -1,10 +1,12 @@
 CHANGES
 =======
 
-3.7.1 (unreleased)
+3.8.0 (unreleased)
 ------------------
 
-- TBD
+- Moved IMethodNotAllowed and MethodNotAllowed from zope.app.http to
+  zope.publisher.interfaces.http, fixing dependency cycles involving
+  zope.app.http.
 
 3.7.0 (2009-05-13)
 ------------------

Modified: zope.publisher/trunk/setup.py
===================================================================
--- zope.publisher/trunk/setup.py	2009-05-23 01:02:24 UTC (rev 100269)
+++ zope.publisher/trunk/setup.py	2009-05-23 01:38:43 UTC (rev 100270)
@@ -23,7 +23,7 @@
 """
 
 setup(name='zope.publisher',
-      version='3.7.1dev',
+      version='3.8.0',
       url='http://pypi.python.org/pypi/zope.publisher',
       license='ZPL 2.1',
       author='Zope Corporation and Contributors',

Modified: zope.publisher/trunk/src/zope/publisher/interfaces/http.py
===================================================================
--- zope.publisher/trunk/src/zope/publisher/interfaces/http.py	2009-05-23 01:02:24 UTC (rev 100269)
+++ zope.publisher/trunk/src/zope/publisher/interfaces/http.py	2009-05-23 01:38:43 UTC (rev 100270)
@@ -20,6 +20,8 @@
 
 from zope.interface import Interface
 from zope.interface import Attribute
+from zope.interface import implements
+from zope.interface.common.interfaces import IException
 
 from zope.publisher.interfaces import IApplicationRequest
 from zope.publisher.interfaces import IPublishTraverse
@@ -471,3 +473,25 @@
     """
     request = Attribute(u'The application request whose virtual host info has '
                         u'been altered')
+
+
+class IMethodNotAllowed(IException):
+    """An exception that signals the 405 Method Not Allowed HTTP error"""
+
+    object = Attribute("""The object on which the error occurred""")
+
+    request = Attribute("""The request in which the error occurred""")
+
+
+class MethodNotAllowed(Exception):
+    """An exception that signals the 405 Method Not Allowed HTTP error"""
+
+    implements(IMethodNotAllowed)
+
+    def __init__(self, object, request):
+        self.object = object
+        self.request = request
+
+    def __str__(self):
+        return "%r, %r" % (self.object, self.request)
+



More information about the Checkins mailing list