@@ -75,6 +75,23 @@ def edit(obj=None, title='', minvalue=None, maxvalue=None, readonly=False, depth
75
75
raise Exception ('edit() is not available because the larray_editor package is not installed' )
76
76
77
77
78
+ def debug (depth = 0 ):
79
+ r"""
80
+ Opens a new debug window.
81
+
82
+ Parameters
83
+ ----------
84
+ depth : int, optional
85
+ Stack depth where to look for variables. Defaults to 0 (where this function was called).
86
+ """
87
+ try :
88
+ from larray_editor import debug
89
+
90
+ debug (depth + 1 )
91
+ except ImportError :
92
+ raise Exception ('debug() is not available because the larray_editor package is not installed' )
93
+
94
+
78
95
def compare (* args , ** kwargs ):
79
96
r"""
80
97
Opens a new comparator window, comparing arrays or sessions.
@@ -125,7 +142,7 @@ def compare(*args, **kwargs):
125
142
raise Exception ('compare() is not available because the larray_editor package is not installed' )
126
143
127
144
128
- def run_editor_on_exception (root_path = None , usercode_traceback = True ):
145
+ def run_editor_on_exception (root_path = None , usercode_traceback = True , usercode_frame = True ):
129
146
r"""
130
147
Runs the editor when an unhandled exception (a fatal error) happens.
131
148
@@ -136,6 +153,9 @@ def run_editor_on_exception(root_path=None, usercode_traceback=True):
136
153
usercode_traceback : bool, optional
137
154
Whether or not to show only the part of the traceback (error log) which corresponds to the user code.
138
155
Otherwise, it will show the complete traceback, including code inside libraries. Defaults to True.
156
+ usercode_frame : bool, optional
157
+ Whether or not to start the debug window in the frame corresponding to the user code.
158
+ This argument is ignored (it is always True) if usercode_traceback is True. Defaults to True.
139
159
140
160
Notes
141
161
-----
@@ -144,6 +164,7 @@ def run_editor_on_exception(root_path=None, usercode_traceback=True):
144
164
try :
145
165
from larray_editor import run_editor_on_exception
146
166
147
- run_editor_on_exception (root_path = root_path , usercode_traceback = usercode_traceback )
167
+ run_editor_on_exception (root_path = root_path , usercode_traceback = usercode_traceback ,
168
+ usercode_frame = usercode_frame )
148
169
except ImportError :
149
170
raise Exception ('run_editor_on_exception() is not available because the larray_editor package is not installed' )
0 commit comments