I need ZEO to be able to find non-packaged products for conflict resolution 
purposes. As ZEO AFAIK doesn't support this I gave it a quick try. I reached 
the "works for me" state, that I now would like to get feedback on.

Basically, I transposed Zope's "products" config option to ZEO.

Did I miss anything already existing to achieve this ?
Is such change (functionality-wise) welcome in ZEO ?
If it is, is it acceptable in its current form ?

diff --git a/src/ZEO/component.xml b/src/ZEO/component.xml
index 39cf46b..f36d9d1 100644
--- a/src/ZEO/component.xml
+++ b/src/ZEO/component.xml
@@ -122,6 +122,14 @@

+  <multikey name="products" datatype="existing-directory">
+    <description>
+      This specifies additional product directories which are added to
+      Products.__path__.  Directories are added in the order in which
+      they are specified.
+    </description>
+  </multikey>

diff --git a/src/ZEO/runzeo.py b/src/ZEO/runzeo.py
index b2e24e7..2af7635 100644
--- a/src/ZEO/runzeo.py
+++ b/src/ZEO/runzeo.py
@@ -115,6 +115,7 @@ class ZEOOptionsMixin:
                  None, 'auth-realm=')
         self.add('pid_file', 'zeo.pid_filename',
                  None, 'pid-file=')
+        self.add('products', 'zeo.products', None, 'products=')

 class ZEOOptions(ZDOptions, ZEOOptionsMixin):

@@ -150,6 +151,12 @@ class ZEOServer:
         self.options = options

     def main(self):
+        import Products
+        L = []
+        for d in self.options.products + Products.__path__:
+            if d not in L:
+                L.append(d)
+        Products.__path__[:] = L
Vincent Pelletier
For more information about ZODB, see the ZODB Wiki:

ZODB-Dev mailing list  -  ZODB-Dev@zope.org

Reply via email to