[Python-checkins] CVS: python/dist/src/Tools/idle ColorDelegator.py,1.11,1.12

Guido van Rossum gvanrossum@users.sourceforge.net
2001年3月22日 09:27:15 -0800


Update of /cvsroot/python/python/dist/src/Tools/idle
In directory usw-pr-cvs1:/tmp/cvs-serv17150
Modified Files:
	ColorDelegator.py 
Log Message:
Don't use __debug__ as if it were some module global. Use DEBUG
instead.
Index: ColorDelegator.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/idle/ColorDelegator.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** ColorDelegator.py	2001年01月19日 10:41:49	1.11
--- ColorDelegator.py	2001年03月22日 17:27:13	1.12
***************
*** 11,15 ****
 #$ unix <Control-slash>
 
! __debug__ = 0
 
 
--- 11,15 ----
 #$ unix <Control-slash>
 
! DEBUG = 0
 
 
***************
*** 85,95 ****
 self.tag_add("TODO", index1, index2)
 if self.after_id:
! if __debug__: print "colorizing already scheduled"
 return
 if self.colorizing:
 self.stop_colorizing = 1
! if __debug__: print "stop colorizing"
 if self.allow_colorizing:
! if __debug__: print "schedule colorizing"
 self.after_id = self.after(1, self.recolorize)
 
--- 85,95 ----
 self.tag_add("TODO", index1, index2)
 if self.after_id:
! if DEBUG: print "colorizing already scheduled"
 return
 if self.colorizing:
 self.stop_colorizing = 1
! if DEBUG: print "stop colorizing"
 if self.allow_colorizing:
! if DEBUG: print "schedule colorizing"
 self.after_id = self.after(1, self.recolorize)
 
***************
*** 100,104 ****
 after_id = self.after_id
 self.after_id = None
! if __debug__: print "cancel scheduled recolorizer"
 self.after_cancel(after_id)
 self.allow_colorizing = 0
--- 100,104 ----
 after_id = self.after_id
 self.after_id = None
! if DEBUG: print "cancel scheduled recolorizer"
 self.after_cancel(after_id)
 self.allow_colorizing = 0
***************
*** 114,126 ****
 after_id = self.after_id
 self.after_id = None
! if __debug__: print "cancel scheduled recolorizer"
 self.after_cancel(after_id)
 if self.allow_colorizing and self.colorizing:
! if __debug__: print "stop colorizing"
 self.stop_colorizing = 1
 self.allow_colorizing = not self.allow_colorizing
 if self.allow_colorizing and not self.colorizing:
 self.after_id = self.after(1, self.recolorize)
! if __debug__:
 print "auto colorizing turned", self.allow_colorizing and "on" or "off"
 return "break"
--- 114,126 ----
 after_id = self.after_id
 self.after_id = None
! if DEBUG: print "cancel scheduled recolorizer"
 self.after_cancel(after_id)
 if self.allow_colorizing and self.colorizing:
! if DEBUG: print "stop colorizing"
 self.stop_colorizing = 1
 self.allow_colorizing = not self.allow_colorizing
 if self.allow_colorizing and not self.colorizing:
 self.after_id = self.after(1, self.recolorize)
! if DEBUG:
 print "auto colorizing turned", self.allow_colorizing and "on" or "off"
 return "break"
***************
*** 129,152 ****
 self.after_id = None
 if not self.delegate:
! if __debug__: print "no delegate"
 return
 if not self.allow_colorizing:
! if __debug__: print "auto colorizing is off"
 return
 if self.colorizing:
! if __debug__: print "already colorizing"
 return
 try:
 self.stop_colorizing = 0
 self.colorizing = 1
! if __debug__: print "colorizing..."
 t0 = time.clock()
 self.recolorize_main()
 t1 = time.clock()
! if __debug__: print "%.3f seconds" % (t1-t0)
 finally:
 self.colorizing = 0
 if self.allow_colorizing and self.tag_nextrange("TODO", "1.0"):
! if __debug__: print "reschedule colorizing"
 self.after_id = self.after(1, self.recolorize)
 if self.close_when_done:
--- 129,152 ----
 self.after_id = None
 if not self.delegate:
! if DEBUG: print "no delegate"
 return
 if not self.allow_colorizing:
! if DEBUG: print "auto colorizing is off"
 return
 if self.colorizing:
! if DEBUG: print "already colorizing"
 return
 try:
 self.stop_colorizing = 0
 self.colorizing = 1
! if DEBUG: print "colorizing..."
 t0 = time.clock()
 self.recolorize_main()
 t1 = time.clock()
! if DEBUG: print "%.3f seconds" % (t1-t0)
 finally:
 self.colorizing = 0
 if self.allow_colorizing and self.tag_nextrange("TODO", "1.0"):
! if DEBUG: print "reschedule colorizing"
 self.after_id = self.after(1, self.recolorize)
 if self.close_when_done:
***************
*** 228,232 ****
 self.update()
 if self.stop_colorizing:
! if __debug__: print "colorizing stopped"
 return
 
--- 228,232 ----
 self.update()
 if self.stop_colorizing:
! if DEBUG: print "colorizing stopped"
 return
 

AltStyle によって変換されたページ (->オリジナル) /