[Zope3-checkins] SVN: Zope3/branches/philikon-reduce-zcml/src/zope/app/ Convert a bunch of <vocabulary /> directives to <utility />, with the necessary

Philipp von Weitershausen philikon at philikon.de
Mon Feb 27 12:27:24 EST 2006


Log message for revision 65520:
  Convert a bunch of <vocabulary /> directives to <utility />, with the necessary
  (minor) changes to the vocabulary components themselves.
  

Changed:
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/authentication/configure.zcml
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/authentication/password.py
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/authentication/password.zcml
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/authentication/vocabulary.py
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/cache/caching.py
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/cache/configure.zcml
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/mail/configure.zcml
  A   Zope3/branches/philikon-reduce-zcml/src/zope/app/mail/vocabulary.py
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/configure.zcml
  U   Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/vocabulary.py

-=-
Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/authentication/configure.zcml
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/authentication/configure.zcml	2006-02-27 17:27:09 UTC (rev 65519)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/authentication/configure.zcml	2006-02-27 17:27:23 UTC (rev 65520)
@@ -22,15 +22,15 @@
     provides=".interfaces.IQueriableAuthenticator"
     factory=".authentication.QuerySchemaSearchAdapter" />
 
-  <vocabulary
-    name="CredentialsPlugins"
-    factory=".vocabulary.credentialsPlugins"
-   />
+  <utility
+      component=".vocabulary.credentialsPlugins"
+      name="CredentialsPlugins"
+      />
 
-  <vocabulary
-    name="AuthenticatorPlugins"
-    factory=".vocabulary.authenticatorPlugins"
-   />
+  <utility
+      component=".vocabulary.authenticatorPlugins"
+      name="AuthenticatorPlugins"
+      />
 
   <utility
       name="No Challenge if Authenticated"

Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/authentication/password.py
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/authentication/password.py	2006-02-27 17:27:09 UTC (rev 65519)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/authentication/password.py	2006-02-27 17:27:23 UTC (rev 65520)
@@ -19,7 +19,9 @@
 import md5
 import sha
 
-from zope.interface import implements
+from zope.interface import implements, classProvides
+from zope.app.schema.interfaces import IVocabularyFactory
+from zope.app.component.vocabulary import UtilityVocabulary
 
 from zope.app.authentication.interfaces import IPasswordManager
 
@@ -102,3 +104,8 @@
     ("MD5", MD5PasswordManager()),
     ("SHA1", SHA1PasswordManager()),
 ]
+
+class PasswordManagerNamesVocabulary(UtilityVocabulary):
+    classProvides(IVocabularyFactory)
+    interface = IPasswordManager
+    nameOnly = True

Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/authentication/password.zcml
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/authentication/password.zcml	2006-02-27 17:27:09 UTC (rev 65519)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/authentication/password.zcml	2006-02-27 17:27:23 UTC (rev 65520)
@@ -2,11 +2,9 @@
     xmlns="http://namespaces.zope.org/zope"
     i18n_domain="zope">
 
-  <vocabulary
+  <utility
+    component=".password.PasswordManagerNamesVocabulary"
     name="Password Manager Names"
-    factory="zope.app.component.vocabulary.UtilityVocabulary"
-    interface="zope.app.authentication.interfaces.IPasswordManager"
-    nameOnly="True"
     />
 
   <class class=".password.PlainTextPasswordManager">

Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/authentication/vocabulary.py
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/authentication/vocabulary.py	2006-02-27 17:27:09 UTC (rev 65519)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/authentication/vocabulary.py	2006-02-27 17:27:23 UTC (rev 65520)
@@ -26,6 +26,7 @@
 import zope.app.dublincore.interfaces
 from zope.app.component.interfaces import ILocalUtility
 from zope.app.i18n import ZopeMessageFactory as _
+from zope.app.schema.interfaces import IVocabularyFactory
 
 from zope.app.authentication import interfaces
 
@@ -89,6 +90,10 @@
     return _pluginVocabulary(
         context, interfaces.IAuthenticatorPlugin, 'authenticatorPlugins')
 
+interface.alsoProvides(authenticatorPlugins, IVocabularyFactory)
+
 def credentialsPlugins(context):
     return _pluginVocabulary(
         context, interfaces.ICredentialsPlugin, 'credentialsPlugins')
+
+interface.alsoProvides(credentialsPlugins, IVocabularyFactory)

Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/cache/caching.py
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/cache/caching.py	2006-02-27 17:27:09 UTC (rev 65519)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/cache/caching.py	2006-02-27 17:27:23 UTC (rev 65520)
@@ -17,9 +17,12 @@
 """
 __docformat__ = 'restructuredtext'
 
+from zope.interface import classProvides
+from zope.component import ComponentLookupError
 from zope.app import zapi
 from zope.app.cache.interfaces import ICacheable, ICache
-from zope.component import ComponentLookupError
+from zope.app.component.vocabulary import UtilityVocabulary
+from zope.app.schema.interfaces import IVocabularyFactory
 
 def getCacheForObject(obj):
     """Returns the cache associated with `obj` or ``None``."""
@@ -37,3 +40,8 @@
         return zapi.getPath(obj)
     except (ComponentLookupError, TypeError):
         return None
+
+class CacheNamesVocabulary(UtilityVocabulary):
+    classProvides(IVocabularyFactory)
+    interface = ICache
+    nameOnly = True

Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/cache/configure.zcml
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/cache/configure.zcml	2006-02-27 17:27:09 UTC (rev 65519)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/cache/configure.zcml	2006-02-27 17:27:23 UTC (rev 65520)
@@ -23,13 +23,11 @@
         />
   </localUtility>
 
-  <vocabulary
+  <utility
+      component=".caching.CacheNamesVocabulary"
       name="Cache Names"
-      factory="zope.app.component.vocabulary.UtilityVocabulary"
-      interface="zope.app.cache.interfaces.ICache"
-      nameOnly="True" />
+      />
 
-
   <!-- Include browser package -->
 
   <include package=".browser" />

Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/mail/configure.zcml
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/mail/configure.zcml	2006-02-27 17:27:09 UTC (rev 65519)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/mail/configure.zcml	2006-02-27 17:27:23 UTC (rev 65520)
@@ -23,11 +23,9 @@
 
   <interface interface="zope.app.mail.interfaces.IMailDelivery" />
 
-  <vocabulary
+  <utility
+      component=".vocabulary.MailDeliveryNames"
       name="Mail Delivery Names"
-      factory="zope.app.component.vocabulary.UtilityVocabulary"
-      interface="zope.app.mail.interfaces.IMailDelivery"
-      nameOnly="True" />
+      />
 
-
 </configure>

Added: Zope3/branches/philikon-reduce-zcml/src/zope/app/mail/vocabulary.py
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/mail/vocabulary.py	2006-02-27 17:27:09 UTC (rev 65519)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/mail/vocabulary.py	2006-02-27 17:27:23 UTC (rev 65520)
@@ -0,0 +1,25 @@
+##############################################################################
+#
+# Copyright (c) 2006 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Mail vocabularies
+
+$Id$
+"""
+__docformat__ = 'restructuredtext'
+
+from zope.interface import classProvides
+from zope.app.schema.interfaces import IVocabularyFactory
+from zope.app.component.vocabulary import UtilityVocabulary
+
+class MailDeliveryNames(UtilityVocabulary):
+    classProvides(IVocabularyFactory)


Property changes on: Zope3/branches/philikon-reduce-zcml/src/zope/app/mail/vocabulary.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/configure.zcml
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/configure.zcml	2006-02-27 17:27:09 UTC (rev 65519)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/configure.zcml	2006-02-27 17:27:23 UTC (rev 65520)
@@ -5,9 +5,11 @@
 
   <!-- Source Type Vocabulary Setup -->
 
-  <vocabulary
+  <utility
+      component=".vocabulary.SourceTypeVocabulary"
+      provides="zope.app.schema.interfaces.IVocabularyFactory"
       name="SourceTypes"
-      factory=".vocabulary.SourceTypeVocabulary" />
+      />
 
   <!-- Plain Text Support -->
 

Modified: Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/vocabulary.py
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/vocabulary.py	2006-02-27 17:27:09 UTC (rev 65519)
+++ Zope3/branches/philikon-reduce-zcml/src/zope/app/renderer/vocabulary.py	2006-02-27 17:27:23 UTC (rev 65520)
@@ -15,12 +15,16 @@
 
 $Id$
 """
+from zope.interface import alsoProvides
 from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
 
 from zope.app import zapi
 from zope.app.renderer.interfaces import ISource
+from zope.app.schema.interfaces import IVocabularyFactory
 
 def SourceTypeVocabulary(context):
     return SimpleVocabulary(
         [SimpleTerm(name, title=factory.title) for name, factory in 
          zapi.getFactoriesFor(ISource)])
+
+alsoProvides(SourceTypeVocabulary, IVocabularyFactory)



More information about the Zope3-Checkins mailing list