[Zope-Checkins]
SVN: Zope/trunk/lib/python/Zope2/Startup/datatypes.py
added support for zdaemoni 2 (expects to use a 'maaping' attribute
Andreas Jung
andreas at andreas-jung.com
Thu Dec 27 08:52:39 EST 2007
Log message for revision 82466:
added support for zdaemoni 2 (expects to use a 'maaping' attribute
of the environ)
(This patch landed first on the 2.11 branch (by TS))
Changed:
U Zope/trunk/lib/python/Zope2/Startup/datatypes.py
-=-
Modified: Zope/trunk/lib/python/Zope2/Startup/datatypes.py
===================================================================
--- Zope/trunk/lib/python/Zope2/Startup/datatypes.py 2007-12-27 13:50:07 UTC (rev 82465)
+++ Zope/trunk/lib/python/Zope2/Startup/datatypes.py 2007-12-27 13:52:38 UTC (rev 82466)
@@ -15,6 +15,7 @@
"""Datatypes for the Zope schema for use with ZConfig."""
import os
+from UserDict import UserDict
from ZConfig.components.logger import logger
from ZODB.config import ZODBDatabase
@@ -108,6 +109,13 @@
ob = importable_name(name) # will fail in course
return name
+
+class zdaemonEnvironDict(UserDict):
+ # zdaemon 2 expects to use a 'mapping' attribute of the environ object.
+ @property
+ def mapping(self):
+ return self.data
+
# Datatype for the root configuration object
# (adds the softwarehome and zopehome fields; default values for some
# computed paths, configures the dbtab)
@@ -120,9 +128,9 @@
section.softwarehome = swhome
section.zopehome = os.path.dirname(os.path.dirname(swhome))
if section.environment is None:
- section.environment = {}
+ section.environment = zdaemonEnvironDict()
if section.cgi_environment is None:
- section.cgi_environment = {}
+ section.cgi_environment = zdaemonEnvironDict()
if section.clienthome is None:
section.clienthome = os.path.join(section.instancehome, "var")
# set up defaults for pid_filename and lock_filename if they're
More information about the Zope-Checkins
mailing list