SF.net SVN: matplotlib:[6915] branches/v0_98_5_maint
Revision: 6915
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6915&view=rev
Author: mdboom
Date: 2009-02-16 14:12:13 + (Mon, 16 Feb 2009)
Log Message:
---
Move the mathmpl Sphinx extension to the installed tree so that other projects
can take advantage of it.
Modified Paths:
--
branches/v0_98_5_maint/doc/conf.py
branches/v0_98_5_maint/setup.py
Added Paths:
---
branches/v0_98_5_maint/lib/matplotlib/sphinxext/
branches/v0_98_5_maint/lib/matplotlib/sphinxext/__init__.py
branches/v0_98_5_maint/lib/matplotlib/sphinxext/mathmpl.py
branches/v0_98_5_maint/lib/matplotlib/sphinxext/only_directives.py
Removed Paths:
-
branches/v0_98_5_maint/doc/sphinxext/mathmpl.py
branches/v0_98_5_maint/doc/sphinxext/only_directives.py
Modified: branches/v0_98_5_maint/doc/conf.py
===
--- branches/v0_98_5_maint/doc/conf.py 2009-02-15 00:12:19 UTC (rev 6914)
+++ branches/v0_98_5_maint/doc/conf.py 2009-02-16 14:12:13 UTC (rev 6915)
@@ -27,9 +27,9 @@
# Add any Sphinx extension module names here, as strings. They can be
extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = ['mathmpl', 'math_symbol_table', 'sphinx.ext.autodoc',
- 'only_directives', 'plot_directive', 'inheritance_diagram',
- 'gen_gallery', 'gen_rst']
+extensions = ['matplotlib.sphinxext.mathmpl', 'math_symbol_table',
+ 'sphinx.ext.autodoc', 'matplotlib.sphinxext.only_directives',
+ 'plot_directive', 'inheritance_diagram', 'gen_gallery',
'gen_rst']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Deleted: branches/v0_98_5_maint/doc/sphinxext/mathmpl.py
===
--- branches/v0_98_5_maint/doc/sphinxext/mathmpl.py 2009-02-15 00:12:19 UTC
(rev 6914)
+++ branches/v0_98_5_maint/doc/sphinxext/mathmpl.py 2009-02-16 14:12:13 UTC
(rev 6915)
@@ -1,119 +0,0 @@
-import os
-import sys
-try:
-from hashlib import md5
-except ImportError:
-from md5 import md5
-
-from docutils import nodes
-from docutils.parsers.rst import directives
-import warnings
-
-from matplotlib import rcParams
-from matplotlib.mathtext import MathTextParser
-rcParams['mathtext.fontset'] = 'cm'
-mathtext_parser = MathTextParser("Bitmap")
-
-# Define LaTeX math node:
-class latex_math(nodes.General, nodes.Element):
-pass
-
-def fontset_choice(arg):
-return directives.choice(arg, ['cm', 'stix', 'stixsans'])
-
-options_spec = {'fontset': fontset_choice}
-
-def math_role(role, rawtext, text, lineno, inliner,
- options={}, content=[]):
-i = rawtext.find('`')
-latex = rawtext[i+1:-1]
-node = latex_math(rawtext)
-node['latex'] = latex
-node['fontset'] = options.get('fontset', 'cm')
-return [node], []
-math_role.options = options_spec
-
-def math_directive(name, arguments, options, content, lineno,
- content_offset, block_text, state, state_machine):
-latex = ''.join(content)
-node = latex_math(block_text)
-node['latex'] = latex
-node['fontset'] = options.get('fontset', 'cm')
-return [node]
-
-# This uses mathtext to render the expression
-def latex2png(latex, filename, fontset='cm'):
-latex = "$%s$" % latex
-orig_fontset = rcParams['mathtext.fontset']
-rcParams['mathtext.fontset'] = fontset
-if os.path.exists(filename):
-depth = mathtext_parser.get_depth(latex, dpi=100)
-else:
-try:
-depth = mathtext_parser.to_png(filename, latex, dpi=100)
-except:
-warnings.warn("Could not render math expression %s" % latex,
- Warning)
-depth = 0
-rcParams['mathtext.fontset'] = orig_fontset
-sys.stdout.write("#")
-sys.stdout.flush()
-return depth
-
-# LaTeX to HTML translation stuff:
-def latex2html(node, source):
-inline = isinstance(node.parent, nodes.TextElement)
-latex = node['latex']
-name = 'math-%s' % md5(latex).hexdigest()[-10:]
-
-destdir = os.path.join(setup.app.builder.outdir, '_images', 'mathmpl')
-if not os.path.exists(destdir):
-os.makedirs(destdir)
-dest = os.path.join(destdir, '%s.png' % name)
-path = os.path.join(setup.app.builder.imgpath, 'mathmpl')
-
-depth = latex2png(latex, dest, node['fontset'])
-
-if inline:
-cls = ''
-else:
-cls = 'class="center" '
-if inline and depth != 0:
-style = 'style="position: relative; bottom: -%dpx"' % (depth + 1)
-else:
-style = ''
-
-return '' % (path, name, cls, style)
-
-def setup(app):
-setup.app = app
-
-app.add_node(latex_math)
-app.add_role('math', math_role)
-
-# Add visit/depart methods to HTML-Translator:
-def visit_latex_math_html(self, node):
-source = self.docume
SF.net SVN: matplotlib:[6916] branches/v0_98_5_maint/CHANGELOG
Revision: 6916 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6916&view=rev Author: mdboom Date: 2009-02-16 14:18:36 + (Mon, 16 Feb 2009) Log Message: --- Update CHANGELOG Modified Paths: -- branches/v0_98_5_maint/CHANGELOG Modified: branches/v0_98_5_maint/CHANGELOG === --- branches/v0_98_5_maint/CHANGELOG2009-02-16 14:12:13 UTC (rev 6915) +++ branches/v0_98_5_maint/CHANGELOG2009-02-16 14:18:36 UTC (rev 6916) @@ -1,3 +1,6 @@ +2009-02-16 Move mathmpl.py to the installed source tree so it is + available to other projects. - MGD + 2009-02-04 Fix bug in mathtext related to \dots and \ldots - MGD 2009-01-29 Document 'resolution' kwarg for polar plots. Support it This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[6917] trunk/matplotlib
Revision: 6917 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6917&view=rev Author: mdboom Date: 2009-02-16 14:24:56 + (Mon, 16 Feb 2009) Log Message: --- Merged revisions 6915-6916 via svnmerge from https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_98_5_maint r6915 | mdboom | 2009-02-16 09:12:13 -0500 (Mon, 16 Feb 2009) | 2 lines Move the mathmpl Sphinx extension to the installed tree so that other projects can take advantage of it. r6916 | mdboom | 2009-02-16 09:18:36 -0500 (Mon, 16 Feb 2009) | 1 line Update CHANGELOG Modified Paths: -- trunk/matplotlib/CHANGELOG trunk/matplotlib/doc/conf.py trunk/matplotlib/lib/matplotlib/sphinxext/__init__.py trunk/matplotlib/lib/matplotlib/sphinxext/mathmpl.py trunk/matplotlib/lib/matplotlib/sphinxext/only_directives.py trunk/matplotlib/setup.py Added Paths: --- trunk/matplotlib/lib/matplotlib/sphinxext/ Removed Paths: - trunk/matplotlib/doc/sphinxext/mathmpl.py trunk/matplotlib/doc/sphinxext/only_directives.py Property Changed: trunk/matplotlib/ trunk/matplotlib/doc/pyplots/README trunk/matplotlib/doc/sphinxext/gen_gallery.py trunk/matplotlib/doc/sphinxext/gen_rst.py Property changes on: trunk/matplotlib ___ Modified: svnmerge-integrated - /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6912 + /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6916 Modified: svn:mergeinfo - /branches/v0_91_maint:5753-5771 /branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912 + /branches/v0_91_maint:5753-5771 /branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916 Modified: trunk/matplotlib/CHANGELOG === --- trunk/matplotlib/CHANGELOG 2009-02-16 14:18:36 UTC (rev 6916) +++ trunk/matplotlib/CHANGELOG 2009-02-16 14:24:56 UTC (rev 6917) @@ -1,3 +1,6 @@ +2009-02-16 Move mathmpl.py to the installed source tree so it is + available to other projects. - MGD + 2009-02-14 Added the legend title support - JJL 2009-02-10 Fixed a bug in backend_pdf so it doesn't break when the setting Modified: trunk/matplotlib/doc/conf.py === --- trunk/matplotlib/doc/conf.py2009-02-16 14:18:36 UTC (rev 6916) +++ trunk/matplotlib/doc/conf.py2009-02-16 14:24:56 UTC (rev 6917) @@ -27,9 +27,9 @@ # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['mathmpl', 'math_symbol_table', 'sphinx.ext.autodoc', - 'only_directives', 'plot_directive', 'inheritance_diagram', - 'gen_gallery', 'gen_rst'] +extensions = ['matplotlib.sphinxext.mathmpl', 'math_symbol_table', + 'sphinx.ext.autodoc', 'matplotlib.sphinxext.only_directives', + 'plot_directive', 'inheritance_diagram', 'gen_gallery', 'gen_rst'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] Property changes on: trunk/matplotlib/doc/pyplots/README ___ Modified: svn:mergeinfo - /branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912 + /branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916 Property changes on: trunk/matplotlib/doc/sphinxext/gen_gallery.py ___ Modified: svn:mergeinfo - /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771 /branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912 + /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771 /branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,688
SF.net SVN: matplotlib:[6918] branches/v0_98_5_maint
Revision: 6918
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6918&view=rev
Author: mdboom
Date: 2009-02-16 15:23:25 + (Mon, 16 Feb 2009)
Log Message:
---
Move plot_directive to installed source tree. Add support for inline code.
Modified Paths:
--
branches/v0_98_5_maint/CHANGELOG
branches/v0_98_5_maint/doc/conf.py
Added Paths:
---
branches/v0_98_5_maint/lib/matplotlib/sphinxext/plot_directive.py
Removed Paths:
-
branches/v0_98_5_maint/doc/sphinxext/plot_directive.py
Modified: branches/v0_98_5_maint/CHANGELOG
===
--- branches/v0_98_5_maint/CHANGELOG2009-02-16 14:24:56 UTC (rev 6917)
+++ branches/v0_98_5_maint/CHANGELOG2009-02-16 15:23:25 UTC (rev 6918)
@@ -1,3 +1,6 @@
+2009-02-16 Move plot_directive.py to the installed source tree. Add
+ support for inline code content - MGD
+
2009-02-16 Move mathmpl.py to the installed source tree so it is
available to other projects. - MGD
Modified: branches/v0_98_5_maint/doc/conf.py
===
--- branches/v0_98_5_maint/doc/conf.py 2009-02-16 14:24:56 UTC (rev 6917)
+++ branches/v0_98_5_maint/doc/conf.py 2009-02-16 15:23:25 UTC (rev 6918)
@@ -28,8 +28,9 @@
# Add any Sphinx extension module names here, as strings. They can be
extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['matplotlib.sphinxext.mathmpl', 'math_symbol_table',
- 'sphinx.ext.autodoc', 'matplotlib.sphinxext.only_directives',
- 'plot_directive', 'inheritance_diagram', 'gen_gallery',
'gen_rst']
+ 'sphinx.ext.autodoc', # 'matplotlib.sphinxext.only_directives',
+ 'matplotlib.sphinxext.plot_directive', 'inheritance_diagram',
+ 'gen_gallery', 'gen_rst']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Deleted: branches/v0_98_5_maint/doc/sphinxext/plot_directive.py
===
--- branches/v0_98_5_maint/doc/sphinxext/plot_directive.py 2009-02-16
14:24:56 UTC (rev 6917)
+++ branches/v0_98_5_maint/doc/sphinxext/plot_directive.py 2009-02-16
15:23:25 UTC (rev 6918)
@@ -1,303 +0,0 @@
-"""A special directive for including a matplotlib plot.
-
-Given a path to a .py file, it includes the source code inline, then:
-
-- On HTML, will include a .png with a link to a high-res .png.
-
-- On LaTeX, will include a .pdf
-
-This directive supports all of the options of the `image` directive,
-except for `target` (since plot will add its own target).
-
-Additionally, if the :include-source: option is provided, the literal
-source will be included inline, as well as a link to the source.
-
-The set of file formats to generate can be specified with the
-plot_formats configuration variable.
-"""
-
-import sys, os, glob, shutil, imp, warnings, cStringIO
-from docutils.parsers.rst import directives
-try:
-# docutils 0.4
-from docutils.parsers.rst.directives.images import align
-except ImportError:
-# docutils 0.5
-from docutils.parsers.rst.directives.images import Image
-align = Image.align
-from docutils import nodes
-
-import matplotlib
-import matplotlib.cbook as cbook
-matplotlib.use('Agg')
-import matplotlib.pyplot as plt
-import matplotlib.image as image
-from matplotlib import _pylab_helpers
-
-if hasattr(os.path, 'relpath'):
-relpath = os.path.relpath
-else:
-def relpath(target, base=os.curdir):
-"""
-Return a relative path to the target from either the current dir or an
optional base dir.
-Base can be a directory specified either as absolute or relative to
current dir.
-"""
-
-if not os.path.exists(target):
-raise OSError, 'Target does not exist: '+target
-
-if not os.path.isdir(base):
-raise OSError, 'Base is not a directory or does not exist: '+base
-
-base_list = (os.path.abspath(base)).split(os.sep)
-target_list = (os.path.abspath(target)).split(os.sep)
-
-# On the windows platform the target may be on a completely different
drive from the base.
-if os.name in ['nt','dos','os2'] and base_list[0] <> target_list[0]:
-raise OSError, 'Target is on a different drive to base. Target:
'+target_list[0].upper()+', base: '+base_list[0].upper()
-
-# Starting from the filepath root, work out how much of the filepath is
-# shared by base and target.
-for i in range(min(len(base_list), len(target_list))):
-if base_list[i] <> target_list[i]: break
-else:
-# If we broke out of the loop, i is pointing to the first
differing path elements.
-# If we didn't break out of the loop, i is pointing to identical
path elements.
-# Increment i so
SF.net SVN: matplotlib:[6919] trunk/matplotlib
Revision: 6919 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6919&view=rev Author: mdboom Date: 2009-02-16 15:31:13 + (Mon, 16 Feb 2009) Log Message: --- Merged revisions 6918 via svnmerge from https://matplotlib.svn.sf.net/svnroot/matplotlib/branches/v0_98_5_maint r6918 | mdboom | 2009-02-16 10:23:25 -0500 (Mon, 16 Feb 2009) | 2 lines Move plot_directive to installed source tree. Add support for inline code. Modified Paths: -- trunk/matplotlib/CHANGELOG trunk/matplotlib/doc/conf.py Added Paths: --- trunk/matplotlib/lib/matplotlib/sphinxext/plot_directive.py Removed Paths: - trunk/matplotlib/doc/sphinxext/plot_directive.py Property Changed: trunk/matplotlib/ trunk/matplotlib/doc/pyplots/README trunk/matplotlib/doc/sphinxext/gen_gallery.py trunk/matplotlib/doc/sphinxext/gen_rst.py Property changes on: trunk/matplotlib ___ Modified: svnmerge-integrated - /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6916 + /branches/v0_91_maint:1-6428 /branches/v0_98_5_maint:1-6918 Modified: svn:mergeinfo - /branches/v0_91_maint:5753-5771 /branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916 + /branches/v0_91_maint:5753-5771 /branches/v0_98_5_maint:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6809,6811,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6906-6909,6911-6912,6915-6916,6918 Modified: trunk/matplotlib/CHANGELOG === --- trunk/matplotlib/CHANGELOG 2009-02-16 15:23:25 UTC (rev 6918) +++ trunk/matplotlib/CHANGELOG 2009-02-16 15:31:13 UTC (rev 6919) @@ -1,3 +1,6 @@ +2009-02-16 Move plot_directive.py to the installed source tree. Add + support for inline code content - MGD + 2009-02-16 Move mathmpl.py to the installed source tree so it is available to other projects. - MGD Modified: trunk/matplotlib/doc/conf.py === --- trunk/matplotlib/doc/conf.py2009-02-16 15:23:25 UTC (rev 6918) +++ trunk/matplotlib/doc/conf.py2009-02-16 15:31:13 UTC (rev 6919) @@ -28,8 +28,9 @@ # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['matplotlib.sphinxext.mathmpl', 'math_symbol_table', - 'sphinx.ext.autodoc', 'matplotlib.sphinxext.only_directives', - 'plot_directive', 'inheritance_diagram', 'gen_gallery', 'gen_rst'] + 'sphinx.ext.autodoc', # 'matplotlib.sphinxext.only_directives', + 'matplotlib.sphinxext.plot_directive', 'inheritance_diagram', + 'gen_gallery', 'gen_rst'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] Property changes on: trunk/matplotlib/doc/pyplots/README ___ Modified: svn:mergeinfo - /branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916 + /branches/v0_98_5_maint/doc/pyplots/README:6581,6585,6587,6589-6609,6614,6616,6625,6652,6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918 Property changes on: trunk/matplotlib/doc/sphinxext/gen_gallery.py ___ Modified: svn:mergeinfo - /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771 /branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916 + /branches/v0_91_maint/doc/_templates/gen_gallery.py:5753-5771 /branches/v0_98_5_maint/doc/sphinxext/gen_gallery.py:6660-6662,6672-6673,6714-6715,6717-6732,6752-6754,6761-6773,6781,6792,6800,6802,6805,6822,6827,6850,6854,6856,6859,6861-6873,6883-6884,6886,6890-6891,6911-6912,6915-6916,6918 Property changes on: trunk/matplotlib/doc/sphinxext/gen_rst.py ___ Modified: svn:mergeinfo - /branches/v0_91_maint/doc/examples/gen_rst.py:5753-5771 /branches/v0_98_5_maint/doc/sphinxext/gen_rst.py:6714-6715,6717-6732,
