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

Refactor %magic into a lsmagic_docs API function. #2002

Merged
merged 2 commits into from Jun 22, 2012

Conversation

bfroehle
Copy link
Contributor

From @fperez in #1999:

@bfroehle, I think %magic -brief was added for doc generation at some point, which is obviously a bit of a hack, though I'm not totally sure anymore.

The right answer now would obviously be to move that functionality into the magics manager as an api call, and let the magic call be strictly for human-friendly use with direct printing.

I've added a lsmagic_docs method which returns a dictionary of magic function docstrings. It optionally takes parameters brief (list only first line of the docstring) and missing (to use in lieu of an empty docstring).

@bfroehle
Copy link
Contributor Author

Test results for commit fa1cdf9 merged into master
Platform: linux2

  • python2.7: OK
  • python3.2: OK (libraries not available: oct2py pymongo rpy2 wx wx.aui)

Not available for testing: python2.6, python3.1

@fperez
Copy link
Member

fperez commented Jun 22, 2012

Do you want to change %magic -brief now to actually do the printing so it's more human-friendly?

@bfroehle
Copy link
Contributor Author

Aha, yes. Thanks!

@bfroehle
Copy link
Contributor Author

If the button doesn't seem to work, I guess pushing it a bunch of times isn't the solution. Sorry for the spam.

@fperez
Copy link
Member

fperez commented Jun 22, 2012

No worries, it's happened to me too :)

@fperez
Copy link
Member

fperez commented Jun 22, 2012

Thanks, merging now then!

fperez added a commit that referenced this pull request Jun 22, 2012
Refactor %magic into using a new lsmagic_docs method.

Added a `lsmagic_docs` method which returns a dictionary of magic function docstrings.  It optionally takes parameters `brief` (list only first line of the docstring) and `missing` (to use in lieu of an empty docstring).
@fperez fperez merged commit edaad4c into ipython:master Jun 22, 2012
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Refactor %magic into using a new lsmagic_docs method.

Added a `lsmagic_docs` method which returns a dictionary of magic function docstrings.  It optionally takes parameters `brief` (list only first line of the docstring) and `missing` (to use in lieu of an empty docstring).
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.

None yet

2 participants