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
35e55da7
Kaydet (Commit)
35e55da7
authored
Eki 14, 1998
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Polish the Debugger GUI a bit.
Closing it now also does the right thing.
üst
fc6aba50
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
20 deletions
+52
-20
Debugger.py
Tools/idle/Debugger.py
+36
-12
PyShell.py
Tools/idle/PyShell.py
+16
-8
No files found.
Tools/idle/Debugger.py
Dosyayı görüntüle @
35e55da7
...
@@ -6,13 +6,26 @@ from Tkinter import *
...
@@ -6,13 +6,26 @@ from Tkinter import *
class
Debugger
(
bdb
.
Bdb
):
class
Debugger
(
bdb
.
Bdb
):
interacting
=
0
def
__init__
(
self
,
pyshell
):
def
__init__
(
self
,
pyshell
):
bdb
.
Bdb
.
__init__
(
self
)
bdb
.
Bdb
.
__init__
(
self
)
self
.
pyshell
=
pyshell
self
.
pyshell
=
pyshell
self
.
make_gui
()
self
.
make_gui
()
def
close
(
self
):
def
close
(
self
):
if
self
.
interacting
:
self
.
top
.
bell
()
return
self
.
pyshell
.
close_debugger
()
self
.
top
.
destroy
()
self
.
top
.
destroy
()
def
run
(
self
,
*
args
):
try
:
self
.
interacting
=
1
return
apply
(
bdb
.
Bdb
.
run
,
(
self
,)
+
args
)
finally
:
self
.
interacting
=
0
def
user_line
(
self
,
frame
):
def
user_line
(
self
,
frame
):
self
.
interaction
(
frame
)
self
.
interaction
(
frame
)
...
@@ -29,8 +42,9 @@ class Debugger(bdb.Bdb):
...
@@ -29,8 +42,9 @@ class Debugger(bdb.Bdb):
self
.
flist
=
pyshell
.
flist
self
.
flist
=
pyshell
.
flist
self
.
root
=
root
=
pyshell
.
root
self
.
root
=
root
=
pyshell
.
root
self
.
top
=
top
=
Toplevel
(
root
)
self
.
top
=
top
=
Toplevel
(
root
)
top
.
wm_protocol
(
"WM_DELETE_WINDOW"
,
self
.
close
)
self
.
bframe
=
bframe
=
Frame
(
top
)
self
.
bframe
=
bframe
=
Frame
(
top
)
self
.
bframe
.
pack
()
self
.
bframe
.
pack
(
anchor
=
"w"
)
self
.
buttons
=
bl
=
[]
self
.
buttons
=
bl
=
[]
self
.
bcont
=
b
=
Button
(
bframe
,
text
=
"Go"
,
command
=
self
.
cont
)
self
.
bcont
=
b
=
Button
(
bframe
,
text
=
"Go"
,
command
=
self
.
cont
)
bl
.
append
(
b
)
bl
.
append
(
b
)
...
@@ -43,25 +57,34 @@ class Debugger(bdb.Bdb):
...
@@ -43,25 +57,34 @@ class Debugger(bdb.Bdb):
for
b
in
bl
:
for
b
in
bl
:
b
.
configure
(
state
=
"disabled"
)
b
.
configure
(
state
=
"disabled"
)
b
.
pack
(
side
=
"left"
)
b
.
pack
(
side
=
"left"
)
self
.
status
=
Label
(
top
)
self
.
status
=
Label
(
top
,
anchor
=
"w"
)
self
.
status
.
pack
()
self
.
status
.
pack
(
anchor
=
"w"
)
self
.
error
=
Label
(
top
,
anchor
=
"w"
)
self
.
error
.
pack
(
anchor
=
"w"
)
def
interaction
(
self
,
frame
,
info
=
None
):
def
interaction
(
self
,
frame
,
info
=
None
):
self
.
top
.
pack_propagate
(
0
)
self
.
frame
=
frame
self
.
frame
=
frame
code
=
frame
.
f_code
code
=
frame
.
f_code
file
=
code
.
co_filename
file
=
code
.
co_filename
base
=
os
.
path
.
basename
(
file
)
lineno
=
frame
.
f_lineno
lineno
=
frame
.
f_lineno
message
=
"file=
%
s, name=
%
s, line=
%
s"
%
(
file
,
code
.
co_name
,
lineno
)
message
=
"
%
s:
%
s:
%
s()"
%
(
base
,
lineno
,
code
.
co_name
)
self
.
status
.
configure
(
text
=
message
)
if
info
:
if
info
:
type
,
value
,
tb
=
info
type
,
value
,
tb
=
info
m1
=
"
%
s"
%
str
(
type
)
try
:
## if value is not None:
m1
=
type
.
__name__
## try:
except
AttributeError
:
## m1 = "%s: %s" % (m1, str(value))
m1
=
"
%
s"
%
str
(
type
)
## except:
if
value
is
not
None
:
## pass
try
:
message
=
"
%
s
\n
%
s"
%
(
message
,
m1
)
m1
=
"
%
s:
%
s"
%
(
m1
,
str
(
value
))
self
.
status
.
configure
(
text
=
message
)
except
:
pass
else
:
m1
=
""
self
.
error
.
configure
(
text
=
m1
)
if
file
[:
1
]
+
file
[
-
1
:]
!=
"<>"
and
os
.
path
.
exists
(
file
):
if
file
[:
1
]
+
file
[
-
1
:]
!=
"<>"
and
os
.
path
.
exists
(
file
):
edit
=
self
.
flist
.
open
(
file
)
edit
=
self
.
flist
.
open
(
file
)
if
edit
:
if
edit
:
...
@@ -73,6 +96,7 @@ class Debugger(bdb.Bdb):
...
@@ -73,6 +96,7 @@ class Debugger(bdb.Bdb):
for
b
in
self
.
buttons
:
for
b
in
self
.
buttons
:
b
.
configure
(
state
=
"disabled"
)
b
.
configure
(
state
=
"disabled"
)
self
.
status
.
configure
(
text
=
""
)
self
.
status
.
configure
(
text
=
""
)
self
.
error
.
configure
(
text
=
""
)
self
.
frame
=
None
self
.
frame
=
None
def
cont
(
self
):
def
cont
(
self
):
...
...
Tools/idle/PyShell.py
Dosyayı görüntüle @
35e55da7
...
@@ -252,19 +252,27 @@ class PyShell(PyShellEditorWindow):
...
@@ -252,19 +252,27 @@ class PyShell(PyShellEditorWindow):
return
"break"
return
"break"
db
=
self
.
interp
.
getdebugger
()
db
=
self
.
interp
.
getdebugger
()
if
db
:
if
db
:
self
.
close_debugger
()
else
:
self
.
open_debugger
()
def
close_debugger
(
self
):
db
=
self
.
interp
.
getdebugger
()
if
db
:
self
.
interp
.
setdebugger
(
None
)
db
.
close
()
db
.
close
()
self
.
resetoutput
()
self
.
resetoutput
()
self
.
console
.
write
(
"[DEBUG OFF]
\n
"
)
self
.
console
.
write
(
"[DEBUG OFF]
\n
"
)
sys
.
ps1
=
">>> "
sys
.
ps1
=
">>> "
self
.
showprompt
()
self
.
showprompt
()
self
.
interp
.
setdebugger
(
None
)
else
:
def
open_debugger
(
self
)
:
import
Debugger
import
Debugger
self
.
interp
.
setdebugger
(
Debugger
.
Debugger
(
self
))
self
.
interp
.
setdebugger
(
Debugger
.
Debugger
(
self
))
sys
.
ps1
=
"[DEBUG ON]>>> "
sys
.
ps1
=
"[DEBUG ON]>>> "
self
.
showprompt
()
self
.
showprompt
()
self
.
top
.
tkraise
()
self
.
top
.
tkraise
()
self
.
text
.
focus_set
()
self
.
text
.
focus_set
()
def
beginexecuting
(
self
):
def
beginexecuting
(
self
):
# Helper for ModifiedInterpreter
# Helper for ModifiedInterpreter
...
...
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