fle3-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fle3-dev] zope_path -> $ZOPE_PATH


From: Bo Granlund
Subject: [Fle3-dev] zope_path -> $ZOPE_PATH
Date: Mon Jun 17 21:24:02 2002
User-agent: Mutt/1.2.5i

Please apply the following. Makes my life easier. :)

Bo

Index: tests/__init__.py
===================================================================
RCS file: /cvs/FLE/tests/__init__.py,v
retrieving revision 1.54
diff -u -r1.54 __init__.py
--- tests/__init__.py   14 Jun 2002 13:40:56 -0000      1.54
+++ tests/__init__.py   18 Jun 2002 01:18:40 -0000
@@ -167,12 +167,11 @@
 # Here's the initialization code.
 print "Setting up environment..."
 import sys, os, re, string
-if not os.path.exists('zope_path'):
-    print """ERROR: File 'zope_path' not found. Please create the file and 
enter the directory to Zope's python libraries."""
-
-f=open('zope_path','r')
-zope_path = f.read().strip()
-f.close()
+try:
+    zope_path = os.environ["ZOPE_PATH"]
+except KeyError:
+    print """ERROR: The environmental variable ZOPE_PATH was not found. Please 
set it to the directory that contains Zope's python libraries. (example: 
ZOPE_PATH=/usr/local/zope/lib/python python tests/test.py)."""
+    sys.exit(1)
 sys.path.insert(0,zope_path)
 
 _dbdir=os.path.join(os.getcwd(),'tests/workdb')





reply via email to

[Prev in Thread] Current Thread [Next in Thread]