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
8571ed86
Kaydet (Commit)
8571ed86
authored
Eki 10, 1998
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add a label at the top showing (very basic) help for the stack viewer.
Add a label at the bottom showing the exception info.
üst
3d0669d8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
StackViewer.py
Tools/idle/StackViewer.py
+21
-0
No files found.
Tools/idle/StackViewer.py
Dosyayı görüntüle @
8571ed86
...
@@ -21,6 +21,11 @@ class StackViewer:
...
@@ -21,6 +21,11 @@ class StackViewer:
self
.
root
=
root
self
.
root
=
root
self
.
top
=
top
self
.
top
=
top
top
.
wm_title
(
"Stack viewer"
)
top
.
wm_title
(
"Stack viewer"
)
# Create help label
self
.
helplabel
=
Label
(
top
,
text
=
"Click once to view variables; twice for source"
,
borderwidth
=
2
,
relief
=
"groove"
)
self
.
helplabel
.
pack
(
fill
=
"x"
)
# Create top frame, with scrollbar and listbox
# Create top frame, with scrollbar and listbox
self
.
topframe
=
Frame
(
top
)
self
.
topframe
=
Frame
(
top
)
self
.
topframe
.
pack
(
fill
=
"both"
,
expand
=
1
)
self
.
topframe
.
pack
(
fill
=
"both"
,
expand
=
1
)
...
@@ -38,10 +43,14 @@ class StackViewer:
...
@@ -38,10 +43,14 @@ class StackViewer:
self
.
listbox
.
bind
(
"<ButtonPress-3>"
,
self
.
popup_event
)
self
.
listbox
.
bind
(
"<ButtonPress-3>"
,
self
.
popup_event
)
self
.
listbox
.
bind
(
"<Key-Up>"
,
self
.
up_event
)
self
.
listbox
.
bind
(
"<Key-Up>"
,
self
.
up_event
)
self
.
listbox
.
bind
(
"<Key-Down>"
,
self
.
down_event
)
self
.
listbox
.
bind
(
"<Key-Down>"
,
self
.
down_event
)
# Create status label
self
.
statuslabel
=
Label
(
top
,
text
=
"status"
)
self
.
statuslabel
.
pack
(
fill
=
"x"
)
# Load the stack
# Load the stack
linecache
.
checkcache
()
linecache
.
checkcache
()
stack
=
getstack
()
stack
=
getstack
()
self
.
load_stack
(
stack
)
self
.
load_stack
(
stack
)
self
.
statuslabel
.
config
(
text
=
getexception
())
def
load_stack
(
self
,
stack
):
def
load_stack
(
self
,
stack
):
self
.
stack
=
stack
self
.
stack
=
stack
...
@@ -232,6 +241,18 @@ def getstack(t=None, f=None):
...
@@ -232,6 +241,18 @@ def getstack(t=None, f=None):
return
stack
return
stack
def
getexception
(
type
=
None
,
value
=
None
):
if
type
is
None
:
type
=
sys
.
last_type
value
=
sys
.
last_value
if
hasattr
(
type
,
"__name__"
):
type
=
type
.
__name__
s
=
str
(
type
)
if
value
is
not
None
:
s
=
s
+
": "
+
str
(
value
)
return
s
class
NamespaceViewer
:
class
NamespaceViewer
:
def
__init__
(
self
,
frame
,
title
,
dict
):
def
__init__
(
self
,
frame
,
title
,
dict
):
...
...
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