# HG changeset patch # User Thierry Florac # Date 1348161181 -7200 # Node ID a08e9a1c5b07897e0f8a7f50e5460af270ac87ee # Parent b4b587dd45ca07be1d2c4b9d35ba899824ddb40e Add ZEO connections vocabulary diff -r b4b587dd45ca -r a08e9a1c5b07 src/ztfy/utils/zodb.py --- a/src/ztfy/utils/zodb.py Thu Sep 20 17:06:22 2012 +0200 +++ b/src/ztfy/utils/zodb.py Thu Sep 20 19:13:01 2012 +0200 @@ -17,11 +17,12 @@ # import standard packages from persistent import Persistent +from persistent.interfaces import IPersistent +from transaction.interfaces import ITransactionManager # import Zope3 interfaces -from persistent.interfaces import IPersistent -from transaction.interfaces import ITransactionManager from ZODB.interfaces import IConnection +from zope.schema.interfaces import IVocabularyFactory # import local interfaces from ztfy.utils.interfaces import IZEOConnection @@ -30,8 +31,9 @@ from ZEO import ClientStorage from ZODB import DB from zope.component import adapter +from zope.componentvocabulary.vocabulary import UtilityVocabulary from zope.container.contained import Contained -from zope.interface import implementer, implements +from zope.interface import implementer, implements, classProvides from zope.schema.fieldproperty import FieldProperty # import local packages @@ -65,6 +67,14 @@ """Persistent ZEO connection settings utility""" +class ZEOConnectionVocabulary(UtilityVocabulary): + """ZEO connections vocabulary""" + + classProvides(IVocabularyFactory) + + interface = IZEOConnection + nameOnly = True + # IPersistent adapters copied from zc.twist package # also register this for adapting from IConnection diff -r b4b587dd45ca -r a08e9a1c5b07 src/ztfy/utils/zodb.zcml --- a/src/ztfy/utils/zodb.zcml Thu Sep 20 17:06:22 2012 +0200 +++ b/src/ztfy/utils/zodb.zcml Thu Sep 20 19:13:01 2012 +0200 @@ -18,4 +18,8 @@ permission="zope.ManageServices" /> + + \ No newline at end of file