Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
3cc1250f
Kaydet (Commit)
3cc1250f
authored
Mar 22, 2001
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Don't use __debug__ as if it were some module global. Use DEBUG
instead.
üst
6909642d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
ColorDelegator.py
Tools/idle/ColorDelegator.py
+15
-15
No files found.
Tools/idle/ColorDelegator.py
Dosyayı görüntüle @
3cc1250f
...
@@ -10,7 +10,7 @@ from IdleConf import idleconf
...
@@ -10,7 +10,7 @@ from IdleConf import idleconf
#$ win <Control-slash>
#$ win <Control-slash>
#$ unix <Control-slash>
#$ unix <Control-slash>
__debug__
=
0
DEBUG
=
0
def
any
(
name
,
list
):
def
any
(
name
,
list
):
...
@@ -84,13 +84,13 @@ class ColorDelegator(Delegator):
...
@@ -84,13 +84,13 @@ class ColorDelegator(Delegator):
def
notify_range
(
self
,
index1
,
index2
=
None
):
def
notify_range
(
self
,
index1
,
index2
=
None
):
self
.
tag_add
(
"TODO"
,
index1
,
index2
)
self
.
tag_add
(
"TODO"
,
index1
,
index2
)
if
self
.
after_id
:
if
self
.
after_id
:
if
__debug__
:
print
"colorizing already scheduled"
if
DEBUG
:
print
"colorizing already scheduled"
return
return
if
self
.
colorizing
:
if
self
.
colorizing
:
self
.
stop_colorizing
=
1
self
.
stop_colorizing
=
1
if
__debug__
:
print
"stop colorizing"
if
DEBUG
:
print
"stop colorizing"
if
self
.
allow_colorizing
:
if
self
.
allow_colorizing
:
if
__debug__
:
print
"schedule colorizing"
if
DEBUG
:
print
"schedule colorizing"
self
.
after_id
=
self
.
after
(
1
,
self
.
recolorize
)
self
.
after_id
=
self
.
after
(
1
,
self
.
recolorize
)
close_when_done
=
None
# Window to be closed when done colorizing
close_when_done
=
None
# Window to be closed when done colorizing
...
@@ -99,7 +99,7 @@ class ColorDelegator(Delegator):
...
@@ -99,7 +99,7 @@ class ColorDelegator(Delegator):
if
self
.
after_id
:
if
self
.
after_id
:
after_id
=
self
.
after_id
after_id
=
self
.
after_id
self
.
after_id
=
None
self
.
after_id
=
None
if
__debug__
:
print
"cancel scheduled recolorizer"
if
DEBUG
:
print
"cancel scheduled recolorizer"
self
.
after_cancel
(
after_id
)
self
.
after_cancel
(
after_id
)
self
.
allow_colorizing
=
0
self
.
allow_colorizing
=
0
self
.
stop_colorizing
=
1
self
.
stop_colorizing
=
1
...
@@ -113,41 +113,41 @@ class ColorDelegator(Delegator):
...
@@ -113,41 +113,41 @@ class ColorDelegator(Delegator):
if
self
.
after_id
:
if
self
.
after_id
:
after_id
=
self
.
after_id
after_id
=
self
.
after_id
self
.
after_id
=
None
self
.
after_id
=
None
if
__debug__
:
print
"cancel scheduled recolorizer"
if
DEBUG
:
print
"cancel scheduled recolorizer"
self
.
after_cancel
(
after_id
)
self
.
after_cancel
(
after_id
)
if
self
.
allow_colorizing
and
self
.
colorizing
:
if
self
.
allow_colorizing
and
self
.
colorizing
:
if
__debug__
:
print
"stop colorizing"
if
DEBUG
:
print
"stop colorizing"
self
.
stop_colorizing
=
1
self
.
stop_colorizing
=
1
self
.
allow_colorizing
=
not
self
.
allow_colorizing
self
.
allow_colorizing
=
not
self
.
allow_colorizing
if
self
.
allow_colorizing
and
not
self
.
colorizing
:
if
self
.
allow_colorizing
and
not
self
.
colorizing
:
self
.
after_id
=
self
.
after
(
1
,
self
.
recolorize
)
self
.
after_id
=
self
.
after
(
1
,
self
.
recolorize
)
if
__debug__
:
if
DEBUG
:
print
"auto colorizing turned"
,
self
.
allow_colorizing
and
"on"
or
"off"
print
"auto colorizing turned"
,
self
.
allow_colorizing
and
"on"
or
"off"
return
"break"
return
"break"
def
recolorize
(
self
):
def
recolorize
(
self
):
self
.
after_id
=
None
self
.
after_id
=
None
if
not
self
.
delegate
:
if
not
self
.
delegate
:
if
__debug__
:
print
"no delegate"
if
DEBUG
:
print
"no delegate"
return
return
if
not
self
.
allow_colorizing
:
if
not
self
.
allow_colorizing
:
if
__debug__
:
print
"auto colorizing is off"
if
DEBUG
:
print
"auto colorizing is off"
return
return
if
self
.
colorizing
:
if
self
.
colorizing
:
if
__debug__
:
print
"already colorizing"
if
DEBUG
:
print
"already colorizing"
return
return
try
:
try
:
self
.
stop_colorizing
=
0
self
.
stop_colorizing
=
0
self
.
colorizing
=
1
self
.
colorizing
=
1
if
__debug__
:
print
"colorizing..."
if
DEBUG
:
print
"colorizing..."
t0
=
time
.
clock
()
t0
=
time
.
clock
()
self
.
recolorize_main
()
self
.
recolorize_main
()
t1
=
time
.
clock
()
t1
=
time
.
clock
()
if
__debug__
:
print
"
%.3
f seconds"
%
(
t1
-
t0
)
if
DEBUG
:
print
"
%.3
f seconds"
%
(
t1
-
t0
)
finally
:
finally
:
self
.
colorizing
=
0
self
.
colorizing
=
0
if
self
.
allow_colorizing
and
self
.
tag_nextrange
(
"TODO"
,
"1.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
)
self
.
after_id
=
self
.
after
(
1
,
self
.
recolorize
)
if
self
.
close_when_done
:
if
self
.
close_when_done
:
top
=
self
.
close_when_done
top
=
self
.
close_when_done
...
@@ -227,7 +227,7 @@ class ColorDelegator(Delegator):
...
@@ -227,7 +227,7 @@ class ColorDelegator(Delegator):
self
.
tag_add
(
"TODO"
,
next
)
self
.
tag_add
(
"TODO"
,
next
)
self
.
update
()
self
.
update
()
if
self
.
stop_colorizing
:
if
self
.
stop_colorizing
:
if
__debug__
:
print
"colorizing stopped"
if
DEBUG
:
print
"colorizing stopped"
return
return
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment