summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-03-22 17:27:13 (GMT)
committerGuido van Rossum <guido@python.org>2001-03-22 17:27:13 (GMT)
commit3cc1250f168209f3333e4f60e71f65efb1e8f18b (patch)
treeac16d4d0ae389443fad26a2c0927a5c29436111a /Tools
parent6909642d3896c62df07a85606548f5e6b852c05a (diff)
downloadcpython-3cc1250f168209f3333e4f60e71f65efb1e8f18b.zip
cpython-3cc1250f168209f3333e4f60e71f65efb1e8f18b.tar.gz
cpython-3cc1250f168209f3333e4f60e71f65efb1e8f18b.tar.bz2
Don't use __debug__ as if it were some module global. Use DEBUG
instead.
Diffstat (limited to 'Tools')
-rw-r--r--Tools/idle/ColorDelegator.py30
1 files changed, 15 insertions, 15 deletions
diff --git a/Tools/idle/ColorDelegator.py b/Tools/idle/ColorDelegator.py
index 6722cfd..3d2ecef 100644
--- a/Tools/idle/ColorDelegator.py
+++ b/Tools/idle/ColorDelegator.py
@@ -10,7 +10,7 @@ from IdleConf import idleconf
#$ win <Control-slash>
#$ unix <Control-slash>
-__debug__ = 0
+DEBUG = 0
def any(name, list):
@@ -84,13 +84,13 @@ class ColorDelegator(Delegator):
def notify_range(self, index1, index2=None):
self.tag_add("TODO", index1, index2)
if self.after_id:
- if __debug__: print "colorizing already scheduled"
+ if DEBUG: print "colorizing already scheduled"
return
if self.colorizing:
self.stop_colorizing = 1
- if __debug__: print "stop colorizing"
+ if DEBUG: print "stop colorizing"
if self.allow_colorizing:
- if __debug__: print "schedule colorizing"
+ if DEBUG: print "schedule colorizing"
self.after_id = self.after(1, self.recolorize)
close_when_done = None # Window to be closed when done colorizing
@@ -99,7 +99,7 @@ class ColorDelegator(Delegator):
if self.after_id:
after_id = self.after_id
self.after_id = None
- if __debug__: print "cancel scheduled recolorizer"
+ if DEBUG: print "cancel scheduled recolorizer"
self.after_cancel(after_id)
self.allow_colorizing = 0
self.stop_colorizing = 1
@@ -113,41 +113,41 @@ class ColorDelegator(Delegator):
if self.after_id:
after_id = self.after_id
self.after_id = None
- if __debug__: print "cancel scheduled recolorizer"
+ if DEBUG: print "cancel scheduled recolorizer"
self.after_cancel(after_id)
if self.allow_colorizing and self.colorizing:
- if __debug__: print "stop 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__:
+ if DEBUG:
print "auto colorizing turned", self.allow_colorizing and "on" or "off"
return "break"
def recolorize(self):
self.after_id = None
if not self.delegate:
- if __debug__: print "no delegate"
+ if DEBUG: print "no delegate"
return
if not self.allow_colorizing:
- if __debug__: print "auto colorizing is off"
+ if DEBUG: print "auto colorizing is off"
return
if self.colorizing:
- if __debug__: print "already colorizing"
+ if DEBUG: print "already colorizing"
return
try:
self.stop_colorizing = 0
self.colorizing = 1
- if __debug__: print "colorizing..."
+ if DEBUG: print "colorizing..."
t0 = time.clock()
self.recolorize_main()
t1 = time.clock()
- if __debug__: print "%.3f seconds" % (t1-t0)
+ 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"
+ if DEBUG: print "reschedule colorizing"
self.after_id = self.after(1, self.recolorize)
if self.close_when_done:
top = self.close_when_done
@@ -227,7 +227,7 @@ class ColorDelegator(Delegator):
self.tag_add("TODO", next)
self.update()
if self.stop_colorizing:
- if __debug__: print "colorizing stopped"
+ if DEBUG: print "colorizing stopped"
return