21
21
# This function was autogenerated by boilerplate.py. Do not edit as
22
22
# changes will be lost
23
23
def %(func)s(%(argspec)s):
24
- %(docstring)s
25
24
%(ax)s = gca()
26
25
# allow callers to override the hold state by passing hold=True|False
27
26
%(washold)s = %(ax)s.ishold()
@@ -35,16 +34,19 @@ def %(func)s(%(argspec)s):
35
34
%(ax)s.hold(%(washold)s)
36
35
%(mappable)s
37
36
return %(ret)s
37
+ if Axes.%(func)s.__doc__ is not None:
38
+ %(func)s.__doc__ = dedent(Axes.%(func)s.__doc__) + __docstring_addendum
38
39
"""
39
40
40
41
_fmtmisc = """\
41
42
# This function was autogenerated by boilerplate.py. Do not edit as
42
43
# changes will be lost
43
44
def %(func)s(%(argspec)s):
44
- %(docstring)s
45
45
%(ret)s = gca().%(func)s(%(call)s)
46
46
draw_if_interactive()
47
47
return %(ret)s
48
+ if Axes.%(func)s.__doc__ is not None:
49
+ %(func)s.__doc__ = dedent(Axes.%(func)s.__doc__)
48
50
"""
49
51
50
52
# these methods are all simple wrappers of Axes methods by the same
@@ -138,19 +140,6 @@ def remove_final_whitespace(string):
138
140
"""
139
141
return '\n ' .join (x .rstrip () for x in string .split ('\n ' ))
140
142
141
- def make_docstring (cmd , mention_hold ):
142
- func = getattr (Axes , cmd )
143
- docstring = inspect .getdoc (func )
144
- if docstring is None :
145
- return ""
146
- escaped = re .sub (r'\\' , r'\\\\' , docstring )
147
- if mention_hold :
148
- escaped += '''
149
-
150
- Additional kwargs: hold = [True|False] overrides default hold state
151
- '''
152
- return '"""' + escaped + '"""'
153
-
154
143
for fmt ,cmdlist in (_fmtplot ,_plotcommands ),(_fmtmisc ,_misccommands ):
155
144
for func in cmdlist :
156
145
# For some commands, an additional line is needed to set the
@@ -160,9 +149,6 @@ def make_docstring(cmd, mention_hold):
160
149
else :
161
150
mappable = ''
162
151
163
- # Format docstring
164
- docstring = make_docstring (func , fmt is _fmtplot )
165
-
166
152
# Get argspec of wrapped function
167
153
args , varargs , varkw , defaults = inspect .getargspec (getattr (Axes , func ))
168
154
args .pop (0 ) # remove 'self' argument
0 commit comments