[Zope-Checkins] CVS: Zope/lib/python/Zope/Startup - datatypes.py:1.2.2.4 handlers.py:1.2.2.5

Fred L. Drake, Jr. fred@zope.com
Fri, 21 Feb 2003 10:45:50 -0500


Update of /cvs-repository/Zope/lib/python/Zope/Startup
In directory cvs.zope.org:/tmp/cvs-serv32530/lib/python/Zope/Startup

Modified Files:
      Tag: new-install-branch
	datatypes.py handlers.py 
Log Message:
The SOFTWARE_HOME and ZOPE_HOME are being removed from the config
schema; these will always be computed based on the software that is
loading the configuration.


=== Zope/lib/python/Zope/Startup/datatypes.py 1.2.2.3 => 1.2.2.4 ===
--- Zope/lib/python/Zope/Startup/datatypes.py:1.2.2.3	Fri Feb 14 00:54:37 2003
+++ Zope/lib/python/Zope/Startup/datatypes.py	Fri Feb 21 10:45:49 2003
@@ -14,6 +14,8 @@
 
 """Datatypes for the Zope schema for use with ZConfig."""
 
+import os
+
 # generic datatypes
 
 def security_policy_implementation(value):
@@ -61,3 +63,13 @@
                 logger.addHandler(handler)
             self.resolved = logger
         return self.resolved
+
+# Datatype for the root configuration object
+# (adds the softwarehome and zopehome fields)
+
+def root_config(section):
+    here = os.path.dirname(os.path.abspath(__file__))
+    swhome = os.path.dirname(os.path.dirname(here))
+    section.softwarehome = swhome
+    section.zopehome = os.path.dirname(os.path.dirname(swhome))
+    return section


=== Zope/lib/python/Zope/Startup/handlers.py 1.2.2.4 => 1.2.2.5 ===
--- Zope/lib/python/Zope/Startup/handlers.py:1.2.2.4	Fri Feb 14 01:01:14 2003
+++ Zope/lib/python/Zope/Startup/handlers.py	Fri Feb 21 10:45:49 2003
@@ -17,16 +17,6 @@
         return value + os.sep
     return value
 
-def software_home(value):
-    value = _append_slash(value)
-    value and _setenv('SOFTWARE_HOME', value)
-    return value
-
-def zope_home(value):
-    value = _append_slash(value)
-    value and _setenv('ZOPE_HOME', value)
-    return value
-
 def instance_home(value):
     value = _append_slash(value)
     value and _setenv('INSTANCE_HOME', value)
@@ -134,11 +124,7 @@
         fixups of values that require knowledge about configuration
         values outside of their context. """
 
-        # set up defaults for zopehome and clienthome if they're
-        # not in the config
-        if config.zopehome is None:
-            config.zopehome = zope_home(
-                os.path.dirname(os.path.dirname(config.softwarehome)))
+        # set up default for clienthome if it's not in the config
         if config.clienthome is None:
             config.clienthome = client_home(
                 os.path.join(config.instancehome, 'var'))