Commit db0ba0b4 authored by Evan Simpson's avatar Evan Simpson

Add ability to have a lib/python in the INSTANCE_HOME

parent 35e091ca
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
"""Commonly used utility functions.""" """Commonly used utility functions."""
__version__='$Revision: 1.5 $'[11:-2] __version__='$Revision: 1.6 $'[11:-2]
import os, sys, Products, string import os, sys, Products, string
from Common import package_home from Common import package_home
...@@ -105,14 +105,19 @@ except: ...@@ -105,14 +105,19 @@ except:
sys.modules['__builtin__'].SOFTWARE_HOME=SOFTWARE_HOME=home sys.modules['__builtin__'].SOFTWARE_HOME=SOFTWARE_HOME=home
try: chome=os.environ['INSTANCE_HOME'] try:
chome=os.environ['INSTANCE_HOME']
except: except:
chome=home chome=home
d,e=path_split(chome) d,e=path_split(chome)
if e=='python': if e=='python':
d,e=path_split(d) d,e=path_split(d)
if e=='lib': chome=d or os.getcwd() if e=='lib': chome=d or os.getcwd()
else:
inst_ppath = path_join(chome, 'lib', 'python')
if os.path.isdir(inst_ppath):
sys.path.insert(0, inst_ppath)
sys.modules['__builtin__'].INSTANCE_HOME=INSTANCE_HOME=chome sys.modules['__builtin__'].INSTANCE_HOME=INSTANCE_HOME=chome
# CLIENT_HOME allows ZEO clients to easily keep distinct pid and # CLIENT_HOME allows ZEO clients to easily keep distinct pid and
......
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