Commit 2366948f authored by Ken Manheimer's avatar Ken Manheimer

package_home(): Only strip off the stuff after the "." from the

__name__ if there *is* a "." in the name.  (Products passed in
directly don't have one, f'rinstance.)
parent bee95153
......@@ -85,7 +85,7 @@
"""Global definitions"""
__version__='$Revision: 1.34 $'[11:-2]
__version__='$Revision: 1.35 $'[11:-2]
import sys, os
from DateTime import DateTime
......@@ -97,7 +97,10 @@ def package_home(globals_dict):
__name__=globals_dict['__name__']
m=sys.modules[__name__]
if hasattr(m,'__path__'): return m.__path__[0]
return sys.modules[__name__[:rfind(__name__,'.')]].__path__[0]
if "." in __name__:
return sys.modules[__name__[:rfind(__name__,'.')]].__path__[0]
else:
return __name__
try: home=os.environ['SOFTWARE_HOME']
except:
......
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