Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Magic menu in qtconsole, split in groups #1782

Merged
merged 1 commit into from Jun 6, 2012

Conversation

Carreau
Copy link
Member

@Carreau Carreau commented May 29, 2012

partially fixes #1774

alternative to #1776, that also reorganize magic in several menu.
Menu name is decided by inserting space in the CamelCasse name of the class of the magic.

screencap

Moreover, if there is a way to know if the magic have to take argument or not (%logstate vs %timeit),
I could tweak the menu to either execute, or to paste the magic at the beginning of the curent line.

@takluyver
Copy link
Member

The ... on 'All magics' looks odd, because it has a submenu. Normally, ... implies that clicking on it will bring up some sort of dialog.

@Carreau
Copy link
Member Author

Carreau commented May 29, 2012

... removed .

magic_list = []
for m_type, m_list in self.magics.iteritems() :
for m_name, mgc in m_list.iteritems():
magic_list.append({'name':m_name, 'type':m_type, 'class':mgc.im_class.__name__})
Copy link
Member

Choose a reason for hiding this comment

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

mgc may be just a function here, in which case this will raise AttributeError on im_class. To see this, simply run this block in the qtconsole on master, where %guiref is such a magic.

Rearrange magics in menu, organize as submenu based on class of magic
@Carreau
Copy link
Member Author

Carreau commented Jun 2, 2012

Thanks, fixed, rebased and squashed to have cleaner commits.

@Carreau
Copy link
Member Author

Carreau commented Jun 4, 2012

Does anybody ave something agains me merging it ?
Otherwise i'll do so in 24h.

@Carreau
Copy link
Member Author

Carreau commented Jun 6, 2012

merging then...

Carreau added a commit that referenced this pull request Jun 6, 2012
fix Magic menu in qtconsole, split in groups
@Carreau Carreau merged commit 8b00a30 into ipython:master Jun 6, 2012
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
fix Magic menu in qtconsole, split in groups
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.

Some magics seems broken
3 participants