@@ -75,6 +75,23 @@ def edit(obj=None, title='', minvalue=None, maxvalue=None, readonly=False, depth
7575 raise Exception ('edit() is not available because the larray_editor package is not installed' )
7676
7777
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+
7895def compare (* args , ** kwargs ):
7996 r"""
8097 Opens a new comparator window, comparing arrays or sessions.
@@ -125,7 +142,7 @@ def compare(*args, **kwargs):
125142 raise Exception ('compare() is not available because the larray_editor package is not installed' )
126143
127144
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 ):
129146 r"""
130147 Runs the editor when an unhandled exception (a fatal error) happens.
131148
@@ -136,6 +153,9 @@ def run_editor_on_exception(root_path=None, usercode_traceback=True):
136153 usercode_traceback : bool, optional
137154 Whether or not to show only the part of the traceback (error log) which corresponds to the user code.
138155 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.
139159
140160 Notes
141161 -----
@@ -144,6 +164,7 @@ def run_editor_on_exception(root_path=None, usercode_traceback=True):
144164 try :
145165 from larray_editor import run_editor_on_exception
146166
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 )
148169 except ImportError :
149170 raise Exception ('run_editor_on_exception() is not available because the larray_editor package is not installed' )
0 commit comments