[IPython-dev] ipython_directive broken?

MinRK benjaminrk at gmail.com
Thu Jul 28 15:48:18 EDT 2011


This was discussed a bit on ipython-user last week
(http://mail.scipy.org/pipermail/ipython-user/2011-July/007918.html)

I have a version of the directive working, at least to some degree, in a branch:

https://github.com/minrk/ipython/blob/ipython_directive/docs/sphinxext/ipython_directive.py


The main part about io.Term is that the IOStream objects are now
module-level, as there was no reason to create a singleton object that
just contained the three streams.

Essentially:

`io.Term.cout/cerr` became `io.stdout/stderr`

And there were a few other changes regarding running code and getting output.

-MinRK


On Thu, Jul 28, 2011 at 12:36, Matthew Brett <matthew.brett at gmail.com> wrote:
> Hi guys,
>
> Sorry, I spent a little while trying to fix this, but started getting
> out of my depth.
>
> [mb312 at angela ~/dev_trees/ipython (master)]$ cd docs/sphinxext/
> [mb312 at angela ~/dev_trees/ipython/docs/sphinxext (master)]$ ipython
> Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53)
> Type "copyright", "credits" or "license" for more information.
>
> IPython 0.11.dev -- An enhanced Interactive Python.
> ?         -> Introduction and overview of IPython's features.
> %quickref -> Quick reference.
> help      -> Python's own help system.
> object?   -> Details about 'object', use 'object??' for extra details.
>
> In [1]: import ipython_directive
> ---------------------------------------------------------------------------
> ImportError                               Traceback (most recent call last)
> /home/mb312/dev_trees/ipython/docs/sphinxext/<ipython-input-1-ae3bcd0bc034>
> in <module>()
> ----> 1 import ipython_directive
>
> /home/mb312/dev_trees/ipython/docs/sphinxext/ipython_directive.py in <module>()
>     79 # Our own
>
>     80 from IPython import Config, InteractiveShell
> ---> 81 from IPython.utils.io import Term
>     82
>     83 #-----------------------------------------------------------------------------
>
>
> ImportError: cannot import name Term
>
> In [2]:
>
> I tried replacing ``Term`` with ``IOTerm``, but that didn't get me
> far, and I realized that didn't make sense for the code using Term
> later in the module.
>
> Any pointers?
>
> Thanks a lot,
>
> Matthew
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>



More information about the IPython-dev mailing list