[Checkins] SVN: zc.recipe.filestorage/trunk/ let update() re-create
the part directory if it gets deleted and is under
Fred L. Drake, Jr.
fdrake at gmail.com
Tue Oct 30 22:26:44 EDT 2007
Log message for revision 81259:
let update() re-create the part directory if it gets deleted and is under
the control of the recipe
Changed:
U zc.recipe.filestorage/trunk/README.txt
U zc.recipe.filestorage/trunk/zc/recipe/filestorage/__init__.py
-=-
Modified: zc.recipe.filestorage/trunk/README.txt
===================================================================
--- zc.recipe.filestorage/trunk/README.txt 2007-10-31 01:22:13 UTC (rev 81258)
+++ zc.recipe.filestorage/trunk/README.txt 2007-10-31 02:26:43 UTC (rev 81259)
@@ -68,13 +68,25 @@
>>> os.listdir(d)
['db']
-The update method doesn't do anything, as the database part's directory
+The update method doesn't do much, as the database part's directory
already exists, but it is present, so buildout doesn't complain and doesn't
accidentally run install() again::
>>> recipe.update()
+If the storage's directory is removed, is it re-added by the update method::
+ >>> os.rmdir(os.path.join(d, 'db'))
+ >>> os.listdir(d)
+ []
+ >>> recipe.update()
+ >>> os.listdir(d)
+ ['db']
+
+This is useful in development when the directory containing the database is
+removed in order to start the database from scratch.
+
+
To do
-----
Modified: zc.recipe.filestorage/trunk/zc/recipe/filestorage/__init__.py
===================================================================
--- zc.recipe.filestorage/trunk/zc/recipe/filestorage/__init__.py 2007-10-31 01:22:13 UTC (rev 81258)
+++ zc.recipe.filestorage/trunk/zc/recipe/filestorage/__init__.py 2007-10-31 02:26:43 UTC (rev 81259)
@@ -1,6 +1,6 @@
##############################################################################
#
-# Copyright (c) 2006 Zope Corporation and Contributors.
+# Copyright (c) 2006, 2007 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
@@ -56,7 +56,7 @@
return ()
def update(self):
- pass
+ self.install()
plain_template = """\
<zodb>
More information about the Checkins
mailing list