[Zope-Checkins] CVS: Zope/lib/python - Globals.py:1.48

Andreas Jung andreas@zope.com
Wed, 31 Oct 2001 13:29:29 -0500


Update of /cvs-repository/Zope/lib/python
In directory cvs.zope.org:/tmp/cvs-serv25021/lib/python

Modified Files:
	Globals.py 
Log Message:
unified handling of _DEBUG variables


=== Zope/lib/python/Globals.py 1.47 => 1.48 ===
 from App.ImageFile import ImageFile
 
-DevelopmentMode=None
 VersionNameName='Zope-Version'
 
 data_dir = os.path.join(INSTANCE_HOME, 'var')
-
-for n in 'Z', 'BOBO':
-    if os.environ.has_key('%s_DEBUG_MODE' % n):
-        n=string.lower(os.environ['%s_DEBUG_MODE' % n])
-        if n=='no' or n=='off': continue
-        try: n=string.atoi(n)
-        except: pass
-        if n: DevelopmentMode=1
-
 opened=[]
 
+# Check,if DEBUG variables are set
+DevelopmentMode=None
+
+z1 = os.environ.get('Z_DEBUG_MODE','')
+z2 = os.environ.get('BOBO_DEBUG_MODE','')
 
+if z1.lower() in ('yes','y') or z1.isdigit():
+    DevelopmentMode=1
+elif z2.lower() in ('yes','y') or z2.isdigit():
+    DevelopmentMode=1