Commit fdb31b47 authored by Jim Fulton's avatar Jim Fulton

Made the logic for getting SOFTWARE_HOME a bit more robust, so that

it handles relative paths and paths starting with '.' and '..'.
parent c6c2a516
......@@ -19,9 +19,14 @@ Zope Changes
- Default bobobase now includes a Zope button along with a link
to the Zope site. This satisfies the ZPL attribution requirement.
The button is created by a new builtin method 'ZopeAttributionButton'.
Also, both the source and the binary distributions now have the
same default bobobase.
The button is created by a new builtin method
'ZopeAttributionButton'. Also, both the source and the binary
distributions now have the same default bobobase.
- Made the logic for getting SOFTWARE_HOME a bit more robust, so that
it handles relative paths and paths starting with '.' and '..'.
This is useful when simply importing Main from the Python
prompt in the lib/python directory.
Bugs Fixed
......
......@@ -85,7 +85,7 @@
"""Global definitions"""
__version__='$Revision: 1.29 $'[11:-2]
__version__='$Revision: 1.30 $'[11:-2]
import sys, os
from DateTime import DateTime
......@@ -104,7 +104,15 @@ except:
import Products
home=package_home(Products.__dict__)
d,e=os.path.split(home)
if d: home=d
if d:
if d[:1] == '.':
home=os.getcwd()
if d[:2] == '..':
home=os.path.split(home)[0]+d[2:]
else:
home=home+d[1:]
else:
home=os.getcwd()
SOFTWARE_HOME=sys.modules['__builtin__'].SOFTWARE_HOME=home
......
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