[Zope3-checkins] CVS: Zope3/src/zope/exceptions - _duplicate.py:1.5 _forbidden.py:1.5 _zope_error.py:1.6 unauthorized.py:1.6

Steve Alexander steve@cat-box.net
Sat, 7 Jun 2003 02:54:55 -0400


Update of /cvs-repository/Zope3/src/zope/exceptions
In directory cvs.zope.org:/tmp/cvs-serv6903/src/zope/exceptions

Modified Files:
	_duplicate.py _forbidden.py _zope_error.py unauthorized.py 
Log Message:
Removed use of old "from zope.interface.implements ..." api.


=== Zope3/src/zope/exceptions/_duplicate.py 1.4 => 1.5 ===
--- Zope3/src/zope/exceptions/_duplicate.py:1.4	Tue Feb 11 11:00:06 2003
+++ Zope3/src/zope/exceptions/_duplicate.py	Sat Jun  7 02:54:24 2003
@@ -15,12 +15,11 @@
 $Id$
 """
 from zope.exceptions import ZopeError, IZopeError
-from zope.interface.implements import implements
-
-class DuplicationError(ZopeError):
-    """A duplicate registration was attempted"""
+from zope.interface import implements
 
 class IDuplicationError(IZopeError):
     pass
 
-implements(DuplicationError, IDuplicationError)
+class DuplicationError(ZopeError):
+    """A duplicate registration was attempted"""
+    implements(IDuplicationError)


=== Zope3/src/zope/exceptions/_forbidden.py 1.4 => 1.5 ===
--- Zope3/src/zope/exceptions/_forbidden.py:1.4	Tue Feb 11 11:00:06 2003
+++ Zope3/src/zope/exceptions/_forbidden.py	Sat Jun  7 02:54:24 2003
@@ -16,21 +16,22 @@
 $Id$
 """
 from zope.exceptions import ZopeError, IZopeError
-from zope.interface.implements import implements
+from zope.interface import implements
 from zope.interface.common.interfaces import IAttributeError
 
+class IForbidden(IZopeError):
+    pass
+
 class Forbidden(ZopeError):
     """A resource cannot be accessed under any circumstances
     """
+    implements(IForbidden)
 
-class IForbidden(IZopeError):
+class IForbiddenAttribute(IForbidden, IAttributeError):
     pass
 
 class ForbiddenAttribute(Forbidden, AttributeError):
     """An attribute is unavailable because it is forbidden (private)
     """
-class IForbiddenAttribute(IForbidden, IAttributeError):
-    pass
+    implements(IForbiddenAttribute)
 
-implements(Forbidden, IForbidden)
-implements(ForbiddenAttribute, IForbiddenAttribute)


=== Zope3/src/zope/exceptions/_zope_error.py 1.5 => 1.6 ===
--- Zope3/src/zope/exceptions/_zope_error.py:1.5	Mon Feb 17 13:01:13 2003
+++ Zope3/src/zope/exceptions/_zope_error.py	Sat Jun  7 02:54:24 2003
@@ -16,12 +16,11 @@
 $Id$
 """
 from zope.interface.common.interfaces import IException
-from zope.interface.implements import implements
-
-class ZopeError(Exception):
-    """Generic base class for Zope errors."""
+from zope.interface import implements
 
 class IZopeError(IException):
     pass
 
-implements(ZopeError, IZopeError)
+class ZopeError(Exception):
+    """Generic base class for Zope errors."""
+    implements(IZopeError)


=== Zope3/src/zope/exceptions/unauthorized.py 1.5 => 1.6 ===
--- Zope3/src/zope/exceptions/unauthorized.py:1.5	Mon Feb 17 13:01:13 2003
+++ Zope3/src/zope/exceptions/unauthorized.py	Sat Jun  7 02:54:24 2003
@@ -18,11 +18,16 @@
 from types import StringType
 from zope.exceptions import ZopeError
 from zope.exceptions import IZopeError
-from zope.interface.implements import implements
+from zope.interface import implements
+
+class IUnauthorized(IZopeError):
+    pass
 
 class Unauthorized(ZopeError):
     """Some user wasn't allowed to access a resource"""
 
+    implements(IUnauthorized)
+
     def __init__(self, message=None, value=None, needed=None, name=None, **kw):
         """Possible signatures:
 
@@ -75,7 +80,3 @@
         c = getattr(c, '__name__', 'object')
         return "a particular %s" % c
 
-class IUnauthorized(IZopeError):
-    pass
-
-implements(Unauthorized, IUnauthorized)