1
2
3
4
5
6
7
8
9
10
11 __doc__="""ZodbConnection
12 """
13 from Products.ZenUtils.GlobalConfig import globalConfToDict
14 from zope.interface import Interface
15 from zope.interface import implements
16 from zope.component import queryUtility
17
20 """Return the a ZODB connection Factory by name or look up in global.conf."""
21
23 implements(IZodbFactoryLookup)
24
25 - def get(self, name=None):
26 """Return the ZODB connection factory by name or look up in global.conf."""
27 if name is None:
28 settings = globalConfToDict()
29 name = settings.get('zodb-db-type', 'mysql')
30 connectionFactory = queryUtility(IZodbFactory, name)
31 return connectionFactory
32
33
35
37 """Return a zope.conf style stanza for the zodb connection."""
38
40 """Return a zope.conf style stanza for the zodb_session connection."""
41
43 """Return a ZODB connection."""
44
46 """basic command line options associated with zodb connections"""
47