Commit 48b2f029 authored by Rocky Burt's avatar Rocky Burt

Put in an extra check to handle packages that had namespace packages.

parent 5f5aa929
......@@ -98,12 +98,16 @@ def getPath(prefix, name, checkProduct=1, suffixes=('',)):
if result is None:
try:
l = name.find('.')
l = name.rfind('.')
if l > 0:
realName = name[l + 1:]
toplevel = name[:l]
m = __import__(toplevel)
pos = toplevel.rfind('.')
if pos > -1:
m = __import__(toplevel, globals(), {}, toplevel[pos+1:])
else:
m = __import__(toplevel)
d = os.path.join(m.__path__[0], prefix, realName)
......
......@@ -40,7 +40,13 @@ def _product_packages():
for product_id in products.objectIds():
product = products[product_id]
if hasattr(product, 'package_name'):
packages[product_id] = __import__(product.package_name)
pos = product.package_name.rfind('.')
if pos > -1:
packages[product_id] = __import__(product.package_name,
globals(), {},
product.package_name[pos+1:])
else:
packages[product_id] = __import__(product.package_name)
elif old_product_packages.has_key(product_id):
packages[product_id] = old_product_packages[product_id]
finally:
......
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