[Zope-CVS] CVS: Products/PluginRegistry - utils.py:1.3

Kapil Thangavelu hazmat at objectrealms.net
Mon Jan 31 14:02:05 EST 2005


Update of /cvs-repository/Products/PluginRegistry
In directory cvs.zope.org:/tmp/cvs-serv10095

Modified Files:
	utils.py 
Log Message:
 - fix up product dir detection.



=== Products/PluginRegistry/utils.py 1.2 => 1.3 ===
--- Products/PluginRegistry/utils.py:1.2	Wed Apr 28 15:36:18 2004
+++ Products/PluginRegistry/utils.py	Mon Jan 31 14:02:04 2005
@@ -15,6 +15,8 @@
 import os
 import unittest
 
+from Globals import package_home
+
 try:
     from zope.interface import directlyProvides
 except ImportError:
@@ -23,14 +25,8 @@
                                tuple( interfaces )
                              )
 
-product_dir, utils_module_file = os.path.split( __file__ )
-
-product_prefix = product_dir
-while product_prefix:
-    product_prefix, module = os.path.split( product_prefix )
-    if module == 'Products':
-        break
-
+product_dir = package_home( globals() )
+product_prefix = os.path.join( os.path.split(product_dir)[:-1] )
 
 _wwwdir = os.path.join( product_dir, 'www' )
 



More information about the Zope-CVS mailing list