[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/security/adapter.py Merged from ZopeX3-3.0 branch:

Jim Fulton jim at zope.com
Fri Aug 13 16:32:40 EDT 2004


Log message for revision 27133:
  Merged from ZopeX3-3.0 branch:
  
    r27118 | jim | 2004-08-13 14:04:39 -0400 (Fri, 13 Aug 2004) | 3 lines
  
  Now give adapted factories the __module__ and __name__ of the
  originals, so as to make apidoc happy.
  


Changed:
  U   Zope3/trunk/src/zope/app/security/adapter.py


-=-
Modified: Zope3/trunk/src/zope/app/security/adapter.py
===================================================================
--- Zope3/trunk/src/zope/app/security/adapter.py	2004-08-13 20:31:47 UTC (rev 27132)
+++ Zope3/trunk/src/zope/app/security/adapter.py	2004-08-13 20:32:40 UTC (rev 27133)
@@ -119,12 +119,17 @@
          >>> getProxiedObject(TL(p)).__parent__ is o
          True
 
+       The factory adapter has the __name__ and __module__ of the factory it adapts:
+
+         >>> (TA.__module__, TA.__name__) == (A.__module__, A.__name__)
+         True
+
        """
 
-    __slots__ = ('factory', )
-
     def __init__(self, factory):
         self.factory = factory
+        self.__name__ = factory.__name__
+        self.__module__ = factory.__module__
 
     def __call__(self, *args):
         for arg in args:



More information about the Zope3-Checkins mailing list