Commit 3bff875f authored by 's avatar

merged in Evans product lookup update

parent 21ee43e6
......@@ -86,11 +86,12 @@ __doc__='''Standard routines for handling extensions.
Extensions currently include external methods and pluggable brains.
$Id: Extensions.py,v 1.12 1999/11/08 17:09:27 brian Exp $'''
__version__='$Revision: 1.12 $'[11:-2]
$Id: Extensions.py,v 1.13 2000/06/26 19:52:46 brian Exp $'''
__version__='$Revision: 1.13 $'[11:-2]
from string import find, split
import os, zlib, rotor
import Products
path_split=os.path.split
path_join=os.path.join
exists=os.path.exists
......@@ -149,16 +150,17 @@ def getPath(prefix, name, checkProduct=1, suffixes=('',)):
if d: raise ValueError, (
'The file name, %s, should be a simple file name' % name)
if checkProduct:
l = find(name, '.')
if l > 0:
p = name[:l]
n = name[l + 1:]
for product_dir in Products.__path__:
r = _getPath(product_dir, '%s/%s/' % (p, prefix), n, suffixes)
if r is not None: return r
sw=path_split(path_split(SOFTWARE_HOME)[0])[0]
for home in (INSTANCE_HOME, sw):
if checkProduct:
l=find(name, '.')
if l > 0:
p=name[:l]
n=name[l+1:]
r=_getPath(home, "lib/python/Products/%s/%s/" % (p,prefix),
n, suffixes)
if r is not None: return r
r=_getPath(home, prefix, name, suffixes)
if r is not None: return r
......
......@@ -307,9 +307,7 @@ class Product(Folder, PermissionManager):
manage_readme=Globals.HTMLFile('readme',globals())
def manage_get_product_readme__(self):
try:
return open(os.path.join(
SOFTWARE_HOME, 'Products', self.id,'README.txt'
)).read()
return open(os.path.join(self.home, 'README.txt')).read()
except: return ''
def permissionMappingPossibleValues(self):
......@@ -437,6 +435,7 @@ def initializeProduct(productp, name, home, app):
product.manage_options=Folder.manage_options
product.icon='p_/InstalledProduct_icon'
product.version=fver
product.home=home
product._distribution=None
product.manage_distribution=None
product.thisIsAnInstalledProduct=1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment