Permalink
Browse files

Merged revisions 7338 via svnmerge from

https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_99_maint

........
  r7338 | jouni | 2009-08-03 22:41:32 +0300 (Mon, 03 Aug 2009) | 2 lines
  
  Fixed boilerplate.py so it doesn't break the ReST docs.
........

svn path=/trunk/matplotlib/; revision=7339
  • Loading branch information...
1 parent 1052aa4 commit d1f45f18b0bbcda6a0c79e1efe121d622e455162 @jkseppan jkseppan committed Aug 3, 2009
Showing with 107 additions and 4,350 deletions.
  1. +2 −0 CHANGELOG
  2. +4 −18 boilerplate.py
  3. +101 −4,332 lib/matplotlib/pyplot.py
View
@@ -1,3 +1,5 @@
+2009-08-03 Fixed boilerplate.py so it doesn't break the ReST docs. - JKS
+
======================================================================
2009-07-31 Tagging 0.99.0.rc1 at 7314 - MGD
View
@@ -21,7 +21,6 @@
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def %(func)s(%(argspec)s):
- %(docstring)s
%(ax)s = gca()
# allow callers to override the hold state by passing hold=True|False
%(washold)s = %(ax)s.ishold()
@@ -35,16 +34,19 @@ def %(func)s(%(argspec)s):
%(ax)s.hold(%(washold)s)
%(mappable)s
return %(ret)s
+if Axes.%(func)s.__doc__ is not None:
+ %(func)s.__doc__ = dedent(Axes.%(func)s.__doc__) + __docstring_addendum
"""
_fmtmisc = """\
# This function was autogenerated by boilerplate.py. Do not edit as
# changes will be lost
def %(func)s(%(argspec)s):
- %(docstring)s
%(ret)s = gca().%(func)s(%(call)s)
draw_if_interactive()
return %(ret)s
+if Axes.%(func)s.__doc__ is not None:
+ %(func)s.__doc__ = dedent(Axes.%(func)s.__doc__)
"""
# these methods are all simple wrappers of Axes methods by the same
@@ -138,19 +140,6 @@ def remove_final_whitespace(string):
"""
return '\n'.join(x.rstrip() for x in string.split('\n'))
-def make_docstring(cmd, mention_hold):
- func = getattr(Axes, cmd)
- docstring = inspect.getdoc(func)
- if docstring is None:
- return ""
- escaped = re.sub(r'\\', r'\\\\', docstring)
- if mention_hold:
- escaped += '''
-
-Additional kwargs: hold = [True|False] overrides default hold state
-'''
- return '"""'+escaped+'"""'
-
for fmt,cmdlist in (_fmtplot,_plotcommands),(_fmtmisc,_misccommands):
for func in cmdlist:
# For some commands, an additional line is needed to set the
@@ -160,9 +149,6 @@ def make_docstring(cmd, mention_hold):
else:
mappable = ''
- # Format docstring
- docstring = make_docstring(func, fmt is _fmtplot)
-
# Get argspec of wrapped function
args, varargs, varkw, defaults = inspect.getargspec(getattr(Axes, func))
args.pop(0) # remove 'self' argument
Oops, something went wrong.

0 comments on commit d1f45f1

Please sign in to comment.