[Zope3-checkins] SVN: Zope3/branches/ZopeX3-3.0/src/zope/app/security/adapter.py Now give adapted factories the __module__ and __name__ of the

Jim Fulton jim at zope.com
Fri Aug 13 14:04:39 EDT 2004


Log message for revision 27118:
  Now give adapted factories the __module__ and __name__ of the
  originals, so as to make apidoc happy.
  


Changed:
  U   Zope3/branches/ZopeX3-3.0/src/zope/app/security/adapter.py


-=-
Modified: Zope3/branches/ZopeX3-3.0/src/zope/app/security/adapter.py
===================================================================
--- Zope3/branches/ZopeX3-3.0/src/zope/app/security/adapter.py	2004-08-13 17:53:15 UTC (rev 27117)
+++ Zope3/branches/ZopeX3-3.0/src/zope/app/security/adapter.py	2004-08-13 18:04:39 UTC (rev 27118)
@@ -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