Commit 388b49d4 authored by Fred Drake's avatar Fred Drake

simplify getSchema(); this version is more robust in locating the

ZConfig schema for Zope, and requires less magic
parent ce82077e
...@@ -30,14 +30,8 @@ from App.config import getConfiguration ...@@ -30,14 +30,8 @@ from App.config import getConfiguration
TEMPNAME = tempfile.mktemp() TEMPNAME = tempfile.mktemp()
TEMPPRODUCTS = os.path.join(TEMPNAME, "Products") TEMPPRODUCTS = os.path.join(TEMPNAME, "Products")
try:
__file__
except NameError:
import sys
__file__ = sys.argv[0]
def getSchema(): def getSchema():
startup = os.path.dirname(os.path.dirname(__file__)) startup = os.path.dirname(os.path.realpath(Zope.Startup.__file__))
schemafile = os.path.join(startup, 'zopeschema.xml') schemafile = os.path.join(startup, 'zopeschema.xml')
return ZConfig.loadSchema(schemafile) return ZConfig.loadSchema(schemafile)
......
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