Skip to content

Commit 78eb8ec

Browse files
committed
add variables button
1 parent 592eac4 commit 78eb8ec

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

lib/python-debugger-view.coffee

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,16 @@ class PythonDebuggerView extends View
4646
@span "next"
4747
@button outlet: "stepInBtn", click: "stepInBtnPressed", class: "btn", =>
4848
@span "step"
49-
@button outlet: "continueBtn", click: "continueBtnPressed", class: "btn", =>
50-
@span "continue"
49+
@button outlet: "varBtn", click: "varBtnPressed", class: "btn", =>
50+
@span "variables"
51+
@button class: "btn", =>
52+
@span " "
5153
@button outlet: "returnBtn", click: "returnBtnPressed", class: "btn", =>
5254
@span "return"
55+
@button outlet: "continueBtn", click: "continueBtnPressed", class: "btn", =>
56+
@span "continue"
57+
@button class: "btn", =>
58+
@span " "
5359
@button outlet: "clearBtn", click: "clearOutput", class: "btn", =>
5460
@span "clear"
5561
@div class: "panel-body", outlet: "outputContainer", =>
@@ -93,6 +99,12 @@ class PythonDebuggerView extends View
9399
return
94100
@runBackendDebugger()
95101

102+
varBtnPressed: ->
103+
@backendDebugger?.stdin.write("for (__k, __v) in [(__k, __v) for __k, __v in globals().items() if not __k.startswith('__')]: print __k, '=', __v\n")
104+
@backendDebugger?.stdin.write("print '-------------'\n")
105+
@backendDebugger?.stdin.write("for (__k, __v) in [(__k, __v) for __k, __v in locals().items() if __k != 'self' and not __k.startswith('__')]: print __k, '=', __v\n")
106+
@backendDebugger?.stdin.write("for (__k, __v) in [(__k, __v) for __k, __v in (self.__dict__ if 'self' in locals().keys() else {}).items()]: print 'self.{0}'.format(__k), '=', __v\n")
107+
96108
# Extract the file name and line number output by the debugger.
97109
processDebuggerOutput: (data) ->
98110
data_str = data.toString().trim()

0 commit comments

Comments
 (0)