Skip to content

Conversation

@ccordoba12
Copy link
Member

Fixes #78


I'll create a corresponding pull request in the IPython repo to remove gui_reference from it.

@takluyver
Copy link
Contributor

This PR is still registering %guiref as a magic. I was initially thinking of a more dramatic change, where we don't involve the kernel in showing it at all, and just make an item in the help menu that brings it up. I know some of the text refers specifically to IPython, though - do you think it's feasible to rewrite these bits so the references to IPython are more examples than prescription? Or is it too tightly wedded to IPython to make any sense for other kernels?

@ccordoba12
Copy link
Member Author

This PR is still registering %guiref as a magic

Yes, but only for ipykernel. As far as I know, ipykernel is the only kernel that shows %guiref as part of its banner. i tried to see if I could remove that line but I didn't understand how to do it.

However, I think it's ok to define %guiref when using ipykernel because

  1. ipykernel is able to handle magics
  2. People already know about the existence of %guiref.

and just make an item in the help menu that brings it up

I also did that as part of this pull request.

do you think it's feasible to rewrite these bits so the references to IPython are more examples than prescription?

I removed most of the references to IPython in gui_reference, and updated some imports too (like IPython.core.display to IPython.display). Please review it to see if things can be further improved :-)

@takluyver
Copy link
Contributor

I think I'd prefer to remove the %guiref magic entirely:

  • It's only applicable to one frontend, so we shouldn't be showing it in the general banner when starting an IPython kernel. The banner should also show up in the terminal frontend (though it doesn't right now: kernel banner missing jupyter/jupyter_console#59), and it's supposed to be independent of the frontend.
  • It only works if the Qt console is installed in the same Python that the kernel is running in, which is by no means guaranteed.
  • It's one more special case we can get rid of for our own kernel.

The banner that mentions %guiref is defined in IPython.core.usage and used in ipykernel.zmqshell. I'm happy to clear up both of those modules if you want to remove the magic registration in this PR.

@ccordoba12
Copy link
Member Author

It only works if the Qt console is installed in the same Python that the kernel is running in

You're totally right. It makes no sense to maintain %guiref because it's not entirely dependent on the kernel.

So please remove its references from ipykernel and IPython.core.usage, then I'll remove it from here.


Note: The thing that confused me is that several things about %guiref are still present in qtconsole, so I assumed you removed it in a rebase or something. This time I'll make sure to remove all supporting code about it :-)

@ccordoba12 ccordoba12 changed the title Fix %guiref and add an entry in our Help menu to show its contents Remove %guiref and add instead an entry in our Help menu to show its contents Feb 15, 2016
takluyver added a commit to takluyver/ipykernel that referenced this pull request Feb 15, 2016
We're getting rid of the %guiref magic - see spyder-ide/qtconsole#98
@takluyver
Copy link
Contributor

Removed in ipython/ipykernel#101 and ipython/ipython#9231

@ccordoba12
Copy link
Member Author

Ok, I think this is ready, unless you have some comments about my changes to gui_reference.

@ccordoba12
Copy link
Member Author

%guiref also appears in this figure, so it should be updated accordingly. Maybe @willingc could help us with that?


This console is designed to emulate the look, feel and workflow of a terminal
environment, while adding a number of enhancements that are simply not possible
in a real terminal, such as inline syntax highlighting, true multiline editing,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to change the phrasing, because the first two of these (syntax highlighting and multiline editing) are coming to IPython for version 5 (see ipython/ipython#9118). And even inline graphics are possible, albeit not supported by most terminal emulators.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The console is designed to emulate the look, feel and workflow of a terminal environment. Beyond this basic design, the console may also implement functionality not currently found in most terminal emulators. Some examples of these console enhancements are inline syntax highlighting, multiline editing, inline graphics, and others.

@takluyver
Copy link
Contributor

I know most of the things I'm pointing out in the text are not things you changed, but that text is long overdue for an update, and this seems like a good opportunity to go through it. Bad luck!

@willingc , could you also do a pass on this to help make it clearer? Thanks.


def _started_channels(self):
"""Reimplemented to make a history request and load %guiref."""
"""Reimplemented to make a history request"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps a semantic quibble on my part but "reimplemented" feels not quite accurate to me. BaseFrontendWidget is abstract; FrontEndWidget implements the method from the abstract BaseFrontEndWidget; JupyterWidget subclasses from FrontEndWidget.

The docstrings for each method in this section are not consistent. "Override method" or "Redefine method" feel more accurate to me. Now that I'm thinking about it, it may just be best to add a comment here:

 #---------------------------------------------------------------------------
 # 'BaseFrontendMixin' abstract interface
 #
 # For JupyterWidget,  override FrontendWidget methods which implement the
 # BaseFrontend Mixin abstract interface
 #---------------------------------------------------------------------------

terminal IPython: single expressions are immediately evaluated, and indented
blocks are evaluated once a single blank line is entered::

In [1]: print "Hello Jupyter!" # Enter was pressed at the end of the line
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

print("Hello Jupyter!")

@willingc
Copy link
Contributor

@ccordoba12 @takluyver I've gone through and added my comments. Depending on the time window for 4.2 release, it might be good to merge after these changes are made. After that I would be happy to iterate any further changes as needed.

@ccordoba12
Copy link
Member Author

Thanks for your review. I addressed all comments, except for one from @takluyver about the use of subprocess.

@willingc
Copy link
Contributor

@ccordoba12 Looks great! I noticed @takluyver had a wording suggestion. Other than that, this is ready to merge.

ccordoba12 added a commit that referenced this pull request Feb 22, 2016
Remove %guiref and add instead an entry in our Help menu to show its contents
@ccordoba12 ccordoba12 merged commit 8d7b1f6 into spyder-ide:master Feb 22, 2016
@ccordoba12 ccordoba12 deleted the fix-guiref branch February 22, 2016 20:48
@ccordoba12
Copy link
Member Author

@minrk or @takluyver, I think everything is ready now for you to release 4.2 :-)

@willingc
Copy link
Contributor

@ccordoba12 🍰 🍪

@minrk
Copy link
Contributor

minrk commented Feb 23, 2016

@ccordoba12 released 4.2! Thanks for your help.

@ccordoba12
Copy link
Member Author

Thanks a lot Min!!

El 23/02/16 a las 03:04, Min RK escribió:

@ccordoba12 https://github.com/ccordoba12 released 4.2! Thanks for
your help.


Reply to this email directly or view it on GitHub
#98 (comment).

@temok-cse
Copy link

temok-cse commented Apr 25, 2016

Dear All,

Wishes for the QtConsole:

  1. Enable searches like in Emacs (control-s) or like in the less command (slash '/').
    This would be useful in situations like when browsing the QtConsole Help.

  2. Enable the display of the QtConsole Help from a command in the QtConsole (in addition or in replacement of using the mouse to click on the Help menu).

  3. A shortcut to move to other tabs.
    Cheers,
    Temok

@ccordoba12
Copy link
Member Author

Regarding your points @temok-mx:

  1. This is implemented in Spyder, i.e. if you press Ctrl+F you get a search dialog to easily look for something in Qtconsole content.

  2. Previously Qtconsole had a command called %guiref to do precisely this, but it was removed by this PR. The reasoning behind this decision is described in Remove %guiref and add instead an entry in our Help menu to show its contents #98 (comment)

  3. That's a good idea, but someone will have to implement it. You could open a new issue about it :-)

@temok-cse
Copy link

Thanks Carlos,

I just posted an issue for point 3): #122
Saludos,
Temok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants