[Zope-Checkins] CVS: Zope/lib/python/ZPublisher - Publish.py:1.151

Andreas Jung andreas@zope.com
Thu, 25 Oct 2001 10:33:02 -0400


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

Modified Files:
	Publish.py 
Log Message:
minor code cleanup so my brain will no longer hurt


=== Zope/lib/python/ZPublisher/Publish.py 1.150 => 1.151 ===
             if hasattr(module,'__bobo_debug_mode__'):
                 debug_mode=not not module.__bobo_debug_mode__
-            elif (os.environ.has_key('Z_DEBUG_MODE') or
-                  os.environ.has_key('BOBO_DEBUG_MODE')):
-                if os.environ.has_key('Z_DEBUG_MODE'):
-                    debug_mode=lower(os.environ['Z_DEBUG_MODE'])
+            elif:
+
+                z1 = os.environ.get('Z_DEBUG_MODE',None)
+                z2 = os.environ.get('BOBO_DEBUG_MODE',None)
+            
+                if z1.lower() in ('yes','y') or z1.isdigit():
+                    debug_mode = 1
+                elif z2.lower() in ('yes','y') or z2.isdigit():
+                    debug_mode = 1
                 else:
-                    debug_mode=lower(os.environ['BOBO_DEBUG_MODE'])
-                if debug_mode=='y' or debug_mode=='yes':
-                    debug_mode=1
-                else:
-                    try: debug_mode=atoi(debug_mode)
-                    except: debug_mode=None
+                    debug_mode = None
+
             else: debug_mode=None
 
             if hasattr(module,'__bobo_before__'):