##// END OF EJS Templates
Remove link to generated C/C++ file (since it would be a 404 error anyway).
Bradley M. Froehle -
Show More
@@ -20,6 +20,7 b' from __future__ import print_function'
20 import imp
20 import imp
21 import io
21 import io
22 import os
22 import os
23 import re
23 import sys
24 import sys
24 import time
25 import time
25
26
@@ -232,7 +233,7 b' class CythonMagics(Magics):'
232 'source could not be read.', file=sys.stderr)
233 'source could not be read.', file=sys.stderr)
233 print(e, file=sys.stderr)
234 print(e, file=sys.stderr)
234 else:
235 else:
235 return display.HTML(annotated_html)
236 return display.HTML(self.clean_annotated_html(annotated_html))
236
237
237 @property
238 @property
238 def so_ext(self):
239 def so_ext(self):
@@ -255,6 +256,17 b' class CythonMagics(Magics):'
255 build_extension.finalize_options()
256 build_extension.finalize_options()
256 return build_extension
257 return build_extension
257
258
259 @staticmethod
260 def clean_annotated_html(html):
261 """Clean up the annotated HTML source.
262
263 Strips the link to the generated C or C++ file, which we do not
264 present to the user.
265 """
266 r = re.compile('<p>Raw output: <a href="(.*)">(.*)</a>')
267 html = '\n'.join(l for l in html.splitlines() if not r.match(l))
268 return html
269
258 _loaded = False
270 _loaded = False
259
271
260 def load_ipython_extension(ip):
272 def load_ipython_extension(ip):
General Comments 0
You need to be logged in to leave comments. Login now