[Zope3-checkins] CVS: Zope3/src/zope/app/component - contentdirective.py:1.8

Sidnei da Silva sidnei at x3ng.com.br
Tue Aug 5 11:25:29 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/component
In directory cvs.zope.org:/tmp/cvs-serv14539/src/zope/app/component

Modified Files:
	contentdirective.py 
Log Message:
Reasonably big batch of changes. Added methods to query factories by interface. Added tests for them. Registered all fields from zope.schema as factories. Added basic tests for that. Made the contentdirective use a dottedname instead of a class as the id when an id is not provided. Cleanspace Whitening here and there.

=== Zope3/src/zope/app/component/contentdirective.py 1.7 => 1.8 ===
--- Zope3/src/zope/app/component/contentdirective.py:1.7	Mon Aug  4 19:12:44 2003
+++ Zope3/src/zope/app/component/contentdirective.py	Tue Aug  5 10:24:53 2003
@@ -31,6 +31,11 @@
 
 PublicPermission = 'zope.Public'
 
+def dottedName(klass):
+    if klass is None:
+        return 'None'
+    return klass.__module__ + '.' + klass.__name__
+
 class ProtectionDeclarationException(Exception):
     """Security-protection-specific exceptions."""
     pass
@@ -47,7 +52,7 @@
 class ContentDirective:
 
     def __init__(self, _context, class_):
-        self.__id = class_
+        self.__id = dottedName(class_)
         self.__class = class_
         if isinstance(self.__class, ModuleType):
             raise ConfigurationError('Content class attribute must be a class')




More information about the Zope3-Checkins mailing list