Toolbar for debugger in spyder

188 views
Skip to first unread message

Flam'

unread,
May 29, 2012, 4:09:50 PM5/29/12
to spyder
Hi,

I've been waiting for a while for an improved debugger integration as
discussed in the second point of this issue:
http://code.google.com/p/spyderlib/issues/detail?id=554

As it appeared a rather simple piece of code, i began to work on it in
a clone i made from spyderlib:
http://code.google.com/r/remiflamary-debugtoolbar/

First I added a toolbar with meaningful icons (stolen from matlab for
the moment).
In the corresponding actions, i perform a simple task:
- I raise the external console
- I execute the command corresponding to the debugger action
(next,step,continue,return,exit)

It appears to be quite usable but there is a problem: toolbar actions
are always enabled (still executes in a python(non-gdb) console with
quite a sad output).
A good idea would be to enable them when a debugger consol is executed
and disable them afterward. But i can't find a way to do that...

Hope you can use my changes and include them in a next release, a
debugger toolbar his one of the reasons I (and other people i know)
still hesitate to switch fully to matlab.

Flam'


todd rme

unread,
May 30, 2012, 4:26:20 AM5/30/12
to spyd...@googlegroups.com
Can you create slot in the toolbar that sets its Enabled property and
connect that to the "destroyed" signal of the debugger console?

-Todd

Carlos Córdoba

unread,
May 31, 2012, 10:31:41 AM5/31/12
to spyd...@googlegroups.com
Hi Flam',

These are great news! I'll be quite busy until next Monday but then I'll
be free to review and push your work. On the meantime, could you look
for the necessary free icons to replace the matlab ones? Maybe KDE or
KDevelop have the ones you need.

Cheers,
Carlos

El 29/05/12 15:09, Flam' escribió:

Jed Ludlow

unread,
May 31, 2012, 3:53:42 PM5/31/12
to spyd...@googlegroups.com

Flam', this is indeed excellent work. I had a little time last night to begin experimenting with enabling and disabling the toolbar based upon the debug state of the current Python console, but there are some challenges with that. Right now, the consoles really only know about whether they are a dedicated debugging console when they are first created. But any console can become a "debugging" console if the current file is configured as "Execute in current Python or IPython interpreter" under the Run configurations dialog. That includes IPython sessions. So today we'll have to live with leaving it enabled for all Python consoles and disabling it whenever another plugin has focus.

I pulled in your original implementation, did a little clean-up, added some logic to determine when to enable the toolbar, replaced the icons with some from the Crystal project (arguably not the best icons for the job, but workable for testing), and pushed it to my clone at this bookmark if anyone wants to test some more:

http://code.google.com/r/jedludlow-spyderlib-default/source/browse/?name=jedludlow-issue-554

By the way, it doesn't quite work right for IPython consoles today, but it works just great in the standard Python console. We can work the IPython part when the IPython console code stabilizes.

Steve

unread,
May 31, 2012, 4:46:17 PM5/31/12
to spyd...@googlegroups.com
Okay, so bug number one:
Jef,
Logic to disable the toolbar doesn't work if the external console is not part of the main spyder window.  I usually keep my external console on a second monitor.  When I attempt to click the buttons they become disabled.
It would be nice if debug continue was always enabled.  If I press it and the debugger isn't running I expect it to start the debugger and start running.  It's assumed I've already set my breakpoints or I wouldn't be pressing the button.

Also, can we get some hot keys for these actions?

Steve

unread,
May 31, 2012, 4:58:52 PM5/31/12
to spyd...@googlegroups.com
I also noticed that attempting to use run > run selection or current block doesn't work with pdb.  It would be nice to get that working.

Jed Ludlow

unread,
May 31, 2012, 7:59:11 PM5/31/12
to spyd...@googlegroups.com
Ok, for now I have removed the logic to determine whether a console has focus. The toolbar is now active all the time. It will take a bit more work to make the "Continue" button launch the current script for debugging if it's not already there.
 
Also, can we get some hot keys for these actions?
 
The global hot key space is getting pretty crowded. I'm open to recommendations on a set of global debugging hot keys that make sense. Recall that pdb already responds to "n" for next, "c" for continue, "s" for step in, etc., when it has focus.

Jed Ludlow

unread,
May 31, 2012, 8:00:39 PM5/31/12
to spyd...@googlegroups.com
On Thu, May 31, 2012 at 2:58 PM, Steve <steve.f....@gmail.com> wrote:
I also noticed that attempting to use run > run selection or current block doesn't work with pdb.  It would be nice to get that working.

Could I request that you create a new issue for this that contains an example case?

Flam'

unread,
May 31, 2012, 10:36:34 AM5/31/12
to spyder
Hi Carlos

OK I look for free icons and put them in the clone.

Thank you for your interest

Flam'
Reply all
Reply to author
Forward
0 new messages