Hi Jed,
My answers are below.
El 12/02/13 15:09, Jed Ludlow escribió:
On Tue, Feb 12, 2013 at 12:03 PM, Carlos Córdoba <[email protected]
<mailto:[email protected]>> wrote:
Hi,
I think there are two issues here:
1. Select the console to send commands to.
Right now the logic is very simple: if the ipython console is
visible, send commands there. If not, send commands to the python
one. If both are visible (as in Jed's screenshot), commands are
always going to be sent to the ipython console.
I agree with Pierre that the best thing to do is properly
implement option 2. This would require to maintain a variable
(probably in spyder.py) that keeps track of the currently focused
console (python or ipython).
Or, rather, it would keep track of the last console that had focus
since very often the editor will have current focus when a "run"
command is issued.
Yep, that's what I meant: not focused console but selected one.
2. Decide what happens when the user is debugging and changes
focus to another console.
@Jed: If the user only changes focus to the editor but don't move
to another console, then (as things are right now) debug commands
continue to be sent to the selected console (could you confirm
it?). if that's not the case, then we must fix it because
otherwise it'd be counterintuitive.
Today, all decisions about run commands and debugging control commands
are based upon console visibility. So, if two consoles are visible and
you change focus to the editor, commands will always go to the IPython
console regardless of widget focus today. To get them to enter the
other console you have to hide the IPython console.
My bad, it was the easiest thing for me to do at first. Perhaps after
solving the previous point, it should fix this one too.
Incidentally, one longer-term solution would be to make it impossible
for more than one console to be showing by housing all consoles, both
standard Python interpreters and IPython clients, as tabs of the same
plugin. Old Spyder was this way. That would eliminate all ambiguity
about command direction and require no manual focus setting. I know
issue 1053 argues for putting IPython kernels and clients in the same
plugin [1], but the more I think about it the kernels are the things
that really belong in their own plugin by themselves. Standard
Python interpreters and IPython clients seem to be more natural
cousins to be housed in the same tab widget given the type of input
they receive from the user.
Work for 2.3, right? :-) The two consoles are wildly different right now
and joining them won't be easy (if feasible at all).
For the case I mentioned, I think we need to have a variable for
each console to know if it is debugging state or not. This would
let us avoid to send debug commands to non-debugging consoles.
This will likely require a monkey patch to pdb since it's possible to
put a console into debug mode from the command line, and the only way
for Spyder to find out about that would be if pdb itself did the
notifying. That's not really a good option for external kernels since
we can't monkey patch pdb in those. I think we can come to a rational
console selection method without having to go there.
I think it could be far more easier: add a signal to the Debug action
and button that changes the state of a new console attribute called
"debugging".
Cheers,
Carlos
[1] http://code.google.com/p/spyderlib/issues/detail?id=1053
--
You received this message because you are subscribed to the Google
Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/spyderlib?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups
"spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/spyderlib?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.