[Zope3-checkins] SVN: Zope3/branches/philikon-reduce-zcml/src/bugtracker/ Get rid of <vocabulary /> directives in bugtracker; this should be all in

Philipp von Weitershausen philikon at philikon.de
Wed Mar 15 08:08:59 EST 2006


Log message for revision 66028:
  Get rid of <vocabulary /> directives in bugtracker; this should be all in
  the Zope 3 tree (except unit tests).
  

Changed:
  U   Zope3/branches/philikon-reduce-zcml/src/bugtracker/configure.zcml
  U   Zope3/branches/philikon-reduce-zcml/src/bugtracker/vocabulary.py

-=-
Modified: Zope3/branches/philikon-reduce-zcml/src/bugtracker/configure.zcml
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/bugtracker/configure.zcml	2006-03-15 13:06:38 UTC (rev 66027)
+++ Zope3/branches/philikon-reduce-zcml/src/bugtracker/configure.zcml	2006-03-15 13:08:59 UTC (rev 66028)
@@ -90,25 +90,30 @@
 
   <!-- Setting up the vocabularies for the bug tracker -->  
 
-  <vocabulary
+  <utility
+     component=".vocabulary.StatusVocabulary"
      name="Stati"
-     factory=".vocabulary.StatusVocabulary" />
+     />
 
-  <vocabulary
+  <utility
+     component=".vocabulary.ReleaseVocabulary"
      name="Releases"
-     factory=".vocabulary.ReleaseVocabulary" />
+     />
 
-  <vocabulary
+  <utility
+     component=".vocabulary.PriorityVocabulary"
      name="Priorities"
-     factory=".vocabulary.PriorityVocabulary" />
+     />
 
-  <vocabulary
+  <utility
+     component=".vocabulary.BugTypeVocabulary"
      name="BugTypes"
-     factory=".vocabulary.BugTypeVocabulary" />
+     />
 
-  <vocabulary
+  <utility
+     component=".vocabulary.UserVocabulary"
      name="Users"
-     factory=".vocabulary.UserVocabulary" />
+     />
 
   <content class=".vocabulary.ManagableVocabulary">
     <allow interface="zope.schema.interfaces.IVocabularyTokenized"/>

Modified: Zope3/branches/philikon-reduce-zcml/src/bugtracker/vocabulary.py
===================================================================
--- Zope3/branches/philikon-reduce-zcml/src/bugtracker/vocabulary.py	2006-03-15 13:06:38 UTC (rev 66027)
+++ Zope3/branches/philikon-reduce-zcml/src/bugtracker/vocabulary.py	2006-03-15 13:08:59 UTC (rev 66028)
@@ -18,13 +18,14 @@
 from persistent import Persistent
 from persistent.dict import PersistentDict
 
-from zope.interface import implements
+from zope.interface import implements, classProvides
 from zope.schema.interfaces import ITokenizedTerm, ITitledTokenizedTerm
 from zope.schema.interfaces import IVocabulary, IVocabularyTokenized
 from zope.schema.vocabulary import getVocabularyRegistry
 from zope.security.proxy import removeSecurityProxy 
 
 from zope.app import zapi
+from zope.app.schema.interfaces import IVocabularyFactory
 from zope.app.annotation.interfaces import IAnnotatable, IAnnotations
 
 from bugtracker.interfaces import IManagableVocabulary, IBugTracker
@@ -131,8 +132,8 @@
 
 
 class StatusVocabulary(ManagableVocabulary):
-
     implements(IStatusVocabulary)
+    classProvides(IVocabularyFactory)
 
     key = 'bugtracker.status.values'
     interface = IBugTracker
@@ -141,8 +142,8 @@
 
 
 class ReleaseVocabulary(ManagableVocabulary):
-
     implements(IReleaseVocabulary)
+    classProvides(IVocabularyFactory)
 
     key = 'bugtracker.release.values'
     interface = IBugTracker
@@ -151,8 +152,8 @@
 
 
 class PriorityVocabulary(ManagableVocabulary):
-
     implements(IPriorityVocabulary)
+    classProvides(IVocabularyFactory)
 
     key = 'bugtracker.priority.values'
     interface = IBugTracker
@@ -161,8 +162,8 @@
 
 
 class BugTypeVocabulary(ManagableVocabulary):
-
     implements(IBugTypeVocabulary)
+    classProvides(IVocabularyFactory)
 
     key = 'bugtracke.bugtype.values'
     interface = IBugTracker
@@ -171,8 +172,8 @@
 
 
 class UserTerm(Persistent):
-
     implements(ITitledTokenizedTerm)
+    classProvides(IVocabularyFactory)
 
     def __init__(self, principal):
         # This is safe here, since we only read non-critical data
@@ -187,8 +188,8 @@
 
 
 class UserVocabulary(object):
-
     implements(IVocabulary, IVocabularyTokenized)
+    classProvides(IVocabularyFactory)
 
     def __init__(self, context):
         self.auth = zapi.principals()



More information about the Zope3-Checkins mailing list