[NumPy-Tickets] [NumPy] #1653: Enable __future__ statements in sphinxext plot_directive
NumPy Trac
numpy-tickets@scipy....
Thu Oct 28 19:46:37 CDT 2010
#1653: Enable __future__ statements in sphinxext plot_directive
--------------------------------------+-------------------------------------
Reporter: mforbes | Owner: pv
Type: enhancement | Status: new
Priority: normal | Milestone: 1.5.1
Component: Documentation | Version: devel
Keywords: plot_directive sphinxext |
--------------------------------------+-------------------------------------
Including statements like "from __future__ import division" in the
plot_pre_code fails because these are module specific.
One could fix this by changing line 464 of plot_directive.py to something
like:
{{{
futures = [l for l in setup.config.plot_pre_code
if "from __future__ import" in l]
exec "\n".join(futures + [code]) in ns
}}}
This could probably be made slightly more robust. There may be another
way of doing this, but I cannot see how right now.
Michael.
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/1653>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list