[Zope-Checkins] CVS: Zope2 - ObjectManager.py:1.121.4.9

Brian Lloyd brian@digicool.com
Mon, 26 Mar 2001 14:51:06 -0500 (EST)


Update of /cvs-repository/Zope2/lib/python/OFS
In directory korak:/home/brian/temp/zope-23-branch/lib/python/OFS

Modified Files:
      Tag: zope-2_3-branch
	ObjectManager.py 
Log Message:
fixed lookup of SOFTWARE_HOME import directory



--- Updated File ObjectManager.py in package Zope2 --
--- ObjectManager.py	2001/03/01 16:00:27	1.121.4.8
+++ ObjectManager.py	2001/03/26 19:51:06	1.121.4.9
@@ -536,9 +536,15 @@
         dirname, file=os.path.split(file)
         if dirname:
             raise 'Bad Request', 'Invalid file name %s' % file
-        for impath in (INSTANCE_HOME, SOFTWARE_HOME):
-            file=os.path.join(impath, 'import', file)
-            if os.path.exists(file):
+
+        instance_home = INSTANCE_HOME
+        software_home = os.path.join(SOFTWARE_HOME, '..%s..' % os.sep)
+        software_home = os.path.normpath(software_home)
+        
+        
+        for impath in (instance_home, software_home):
+            filepath = os.path.join(impath, 'import', file)
+            if os.path.exists(filepath):
                 break
         else:
             raise 'Bad Request', 'File does not exist: %s' % file
@@ -550,7 +556,7 @@
             obj=obj.aq_parent
             connection=obj._p_jar
         ob=connection.importFile(
-            file, customImporters=customImporters)
+            filepath, customImporters=customImporters)
         if REQUEST: self._verifyObjectPaste(ob, validate_src=0)
         #id=ob.getId()
         #can't use above getId() call, it fails on 'old' exported objects