Updated ZEO connection interface ZTK-1.1
authorThierry Florac <tflorac@ulthar.net>
Mon, 24 Sep 2012 19:42:56 +0200
branchZTK-1.1
changeset 176 a7275e2a9252
parent 175 590c2e6d725e
child 177 b9ad5a9614c4
Updated ZEO connection interface
src/ztfy/utils/interfaces.py
src/ztfy/utils/zodb.py
--- a/src/ztfy/utils/interfaces.py	Mon Sep 24 19:42:40 2012 +0200
+++ b/src/ztfy/utils/interfaces.py	Mon Sep 24 19:42:56 2012 +0200
@@ -24,7 +24,7 @@
 
 # import Zope3 packages
 from zope.interface import Interface
-from zope.schema import TextLine, Int, Password
+from zope.schema import TextLine, Int, Password, Bool
 
 # import local packages
 
@@ -179,6 +179,16 @@
                             description=_("Realm name on ZEO server"),
                             required=False)
 
+    blob_dir = TextLine(title=_("BLOBs directory"),
+                        description=_("Directory path for blob data"),
+                        required=False)
+
+    shared_blob_dir = Bool(title=_("Shared BLOBs directory ?"),
+                           description=_("""Flag whether the blob_dir is a server-shared filesystem """
+                                         """that should be used instead of transferring blob data over zrpc."""),
+                           required=True,
+                           default=False)
+
     def getSettings(self):
         """Get ZEO connection setting as a JSON dict"""
 
--- a/src/ztfy/utils/zodb.py	Mon Sep 24 19:42:40 2012 +0200
+++ b/src/ztfy/utils/zodb.py	Mon Sep 24 19:42:56 2012 +0200
@@ -51,6 +51,8 @@
     username = FieldProperty(IZEOConnection['username'])
     password = FieldProperty(IZEOConnection['password'])
     server_realm = FieldProperty(IZEOConnection['server_realm'])
+    blob_dir = FieldProperty(IZEOConnection['blob_dir'])
+    shared_blob_dir = FieldProperty(IZEOConnection['shared_blob_dir'])
 
     def getSettings(self):
         result = {}
@@ -71,6 +73,8 @@
                                               username=self.username or '',
                                               password=self.password or '',
                                               realm=self.server_realm,
+                                              blob_dir=self.blob_dir,
+                                              shared_blob_dir=self.shared_blob_dir,
                                               wait=wait)
         db = DB(storage)
         return (storage, db) if get_storage else db