##// END OF EJS Templates
Merge pull request #10940 from cmccandless/patch-1...
Thomas Kluyver -
r24095:65739c0e merge
parent child Browse files
Show More
@@ -24,7 +24,7 b' script:'
24 - |
24 - |
25 if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then
25 if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then
26 pip install -r docs/requirements.txt
26 pip install -r docs/requirements.txt
27 make -C docs/ html
27 make -C docs/ html SPHINXOPTS="-W"
28 fi
28 fi
29 after_success:
29 after_success:
30 - cp /tmp/ipy_coverage.xml ./
30 - cp /tmp/ipy_coverage.xml ./
@@ -32,6 +32,7 b' import inspect'
32 import linecache
32 import linecache
33 import sys
33 import sys
34 import warnings
34 import warnings
35 import re
35
36
36 from IPython import get_ipython
37 from IPython import get_ipython
37 from IPython.utils import PyColorize
38 from IPython.utils import PyColorize
@@ -175,6 +176,13 b' class Tracer(object):'
175 self.debugger.set_trace(sys._getframe().f_back)
176 self.debugger.set_trace(sys._getframe().f_back)
176
177
177
178
179 RGX_EXTRA_INDENT = re.compile('(?<=\n)\s+')
180
181
182 def strip_indentation(multiline_string):
183 return RGX_EXTRA_INDENT.sub('', multiline_string)
184
185
178 def decorate_fn_with_doc(new_fn, old_fn, additional_text=""):
186 def decorate_fn_with_doc(new_fn, old_fn, additional_text=""):
179 """Make new_fn have old_fn's doc string. This is particularly useful
187 """Make new_fn have old_fn's doc string. This is particularly useful
180 for the ``do_...`` commands that hook into the help system.
188 for the ``do_...`` commands that hook into the help system.
@@ -183,7 +191,7 b' def decorate_fn_with_doc(new_fn, old_fn, additional_text=""):'
183 def wrapper(*args, **kw):
191 def wrapper(*args, **kw):
184 return new_fn(*args, **kw)
192 return new_fn(*args, **kw)
185 if old_fn.__doc__:
193 if old_fn.__doc__:
186 wrapper.__doc__ = old_fn.__doc__ + additional_text
194 wrapper.__doc__ = strip_indentation(old_fn.__doc__) + additional_text
187 return wrapper
195 return wrapper
188
196
189
197
General Comments 0
You need to be logged in to leave comments. Login now