[Checkins] SVN: zc.recipe.filestorage/trunk/zc/recipe/filestorage/__init__.py added support for the new ZODB blobs

Christian Zagrodnick cz at gocept.com
Thu Jun 14 07:05:22 EDT 2007


Log message for revision 76688:
  added support for the new ZODB blobs

Changed:
  U   zc.recipe.filestorage/trunk/zc/recipe/filestorage/__init__.py

-=-
Modified: zc.recipe.filestorage/trunk/zc/recipe/filestorage/__init__.py
===================================================================
--- zc.recipe.filestorage/trunk/zc/recipe/filestorage/__init__.py	2007-06-14 10:50:56 UTC (rev 76687)
+++ zc.recipe.filestorage/trunk/zc/recipe/filestorage/__init__.py	2007-06-14 11:05:21 UTC (rev 76688)
@@ -19,6 +19,7 @@
 
     def __init__(self, buildout, name, options):
         self.name, self.options = name, options
+
         path = options.get('path')
         if path is None:
             path = os.path.join(buildout['buildout']['parts-directory'],
@@ -30,10 +31,20 @@
                 logging.getLogger('zc.recipe.filestorage').error(
                     "%s does not exixt", path)
             self.make_part = False
-
         options['path'] = path
-        options['zconfig'] = template % path
 
+        blob_dir = options.get('blob-dir')
+        if blob_dir is None:
+            template = plain_template
+        else:
+            template = blob_template
+            blob_dir = os.path.join(buildout['buildout']['directory'],
+                                    blob_dir)
+        options['blob-dir'] = blob_dir
+
+        options['zconfig'] = template % {'path': path,
+                                         'blob-dir': blob_dir}
+
     def install(self):
         if self.make_part:
             part = os.path.dirname(self.options['path'])
@@ -44,10 +55,21 @@
     def update(self):
         pass
 
-template = """\
+plain_template = """\
 <zodb>
   <filestorage>
-    path %s
+    path %(path)s
   </filestorage>
 </zodb>
 """
+
+blob_template = """\
+<zodb>
+  <blobstorage>
+    blob-dir = %(blob-dir)s
+    <filestorage>
+      path %(path)s
+    </filestorage>
+  </blobstorage>
+</zodb>
+"""



More information about the Checkins mailing list