[Zope-Checkins] CVS: Zope/lib/python/OFS - Application.py:1.189 ObjectManager.py:1.162

Fred L. Drake, Jr. fred@zope.com
Tue, 11 Feb 2003 12:17:37 -0500


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

Modified Files:
	Application.py ObjectManager.py 
Log Message:
Add the App.config module and use the API it exports to get configuration
values.


=== Zope/lib/python/OFS/Application.py 1.188 => 1.189 ===
--- Zope/lib/python/OFS/Application.py:1.188	Tue Aug 20 15:37:52 2002
+++ Zope/lib/python/OFS/Application.py	Tue Feb 11 12:17:05 2003
@@ -373,13 +373,13 @@
     # However, make sure that if the examples have been added already
     # and then deleted that we don't add them again.
 
-
     if not hasattr(app, 'Examples') and not \
        hasattr(app, '_Zope25_examples_have_been_added'):
 
-        examples_path = os.path.join(Globals.ZOPE_HOME, \
-             'import', 'Examples.zexp')
-
+        import App.config
+        cfg = App.config.getConfiguration()
+        examples_path = os.path.join(cfg.zopehome, 'import',
+                                     'Examples.zexp')
         if os.path.isfile(examples_path):
             app._importObjectFromFile(examples_path, verify=0)
             app._Zope25_examples_have_been_added=1


=== Zope/lib/python/OFS/ObjectManager.py 1.161 => 1.162 ===
--- Zope/lib/python/OFS/ObjectManager.py:1.161	Tue Feb  4 01:48:26 2003
+++ Zope/lib/python/OFS/ObjectManager.py	Tue Feb 11 12:17:06 2003
@@ -32,6 +32,7 @@
 from cStringIO import StringIO
 import marshal
 import App.Common
+from App.config import getConfiguration
 from AccessControl import getSecurityManager
 from zLOG import LOG, ERROR
 import sys,fnmatch,copy
@@ -499,7 +500,8 @@
                                    'inline;filename=%s.%s' % (id, suffix))
             return f.getvalue()
 
-        f = os.path.join(CLIENT_HOME, '%s.%s' % (id, suffix))
+        cfg = getConfiguration()
+        f = os.path.join(cfg.clienthome, '%s.%s' % (id, suffix))
         if toxml:
             XMLExportImport.exportXML(ob._p_jar, ob._p_oid, f)
         else:
@@ -520,8 +522,9 @@
         if dirname:
             raise BadRequestException, 'Invalid file name %s' % escape(file)
 
-        instance_home = INSTANCE_HOME
-        zope_home = ZOPE_HOME
+        cfg = getConfiguration()
+        instance_home = cfg.instancehome
+        zope_home = cfg.zopehome
 
         for impath in (instance_home, zope_home):
             filepath = os.path.join(impath, 'import', file)