[Zope-Checkins] SVN: Zope/trunk/src/Zope2/App/s Factor out zope.schema.vocabulary support

Hanno Schlichting hannosch at hannosch.eu
Sat Jun 12 12:56:57 EDT 2010


Log message for revision 113398:
  Factor out zope.schema.vocabulary support
  

Changed:
  U   Zope/trunk/src/Zope2/App/schema.py
  U   Zope/trunk/src/Zope2/App/startup.py

-=-
Modified: Zope/trunk/src/Zope2/App/schema.py
===================================================================
--- Zope/trunk/src/Zope2/App/schema.py	2010-06-12 14:16:24 UTC (rev 113397)
+++ Zope/trunk/src/Zope2/App/schema.py	2010-06-12 16:56:57 UTC (rev 113398)
@@ -16,6 +16,7 @@
 from zope.interface import implements
 from zope.schema.interfaces import IVocabularyFactory
 from zope.schema.interfaces import IVocabularyRegistry
+from zope.schema.vocabulary import setVocabularyRegistry
 
 
 class Zope2VocabularyRegistry(object):
@@ -30,3 +31,7 @@
         """
         factory = getUtility(IVocabularyFactory, name)
         return factory(context)
+
+
+def configure_vocabulary_registry():
+    setVocabularyRegistry(Zope2VocabularyRegistry())

Modified: Zope/trunk/src/Zope2/App/startup.py
===================================================================
--- Zope/trunk/src/Zope2/App/startup.py	2010-06-12 14:16:24 UTC (rev 113397)
+++ Zope/trunk/src/Zope2/App/startup.py	2010-06-12 16:56:57 UTC (rev 113398)
@@ -16,7 +16,6 @@
 from zope.component import queryMultiAdapter
 from zope.event import notify
 from zope.processlifetime import DatabaseOpened
-from zope.schema.vocabulary import setVocabularyRegistry
 
 from AccessControl.SecurityManagement import newSecurityManager
 from AccessControl.SecurityManagement import noSecurityManager
@@ -110,8 +109,8 @@
     load_site()
 
     # Set up Zope2 specific vocabulary registry
-    from .schema import Zope2VocabularyRegistry
-    setVocabularyRegistry(Zope2VocabularyRegistry())
+    from .schema import configure_vocabulary_registry
+    configure_vocabulary_registry()
 
     # Set up the "app" object that automagically opens
     # connections



More information about the Zope-Checkins mailing list