Show More
@@ -514,14 +514,9 class AutoreloadMagics(Magics): | |||||
514 | pass |
|
514 | pass | |
515 |
|
515 | |||
516 |
|
516 | |||
517 | _loaded = False |
|
|||
518 |
|
||||
519 |
|
||||
520 | def load_ipython_extension(ip): |
|
517 | def load_ipython_extension(ip): | |
521 | """Load the extension in IPython.""" |
|
518 | """Load the extension in IPython.""" | |
522 | global _loaded |
|
519 | if 'autoreload' not in ip.extension_manager.loaded: | |
523 | if not _loaded: |
|
|||
524 | auto_reload = AutoreloadMagics(ip) |
|
520 | auto_reload = AutoreloadMagics(ip) | |
525 | ip.register_magics(auto_reload) |
|
521 | ip.register_magics(auto_reload) | |
526 | ip.set_hook('pre_run_code_hook', auto_reload.pre_run_code_hook) |
|
522 | ip.set_hook('pre_run_code_hook', auto_reload.pre_run_code_hook) | |
527 | _loaded = True |
|
@@ -273,11 +273,8 class CythonMagics(Magics): | |||||
273 | html = '\n'.join(l for l in html.splitlines() if not r.match(l)) |
|
273 | html = '\n'.join(l for l in html.splitlines() if not r.match(l)) | |
274 | return html |
|
274 | return html | |
275 |
|
275 | |||
276 | _loaded = False |
|
|||
277 |
|
276 | |||
278 | def load_ipython_extension(ip): |
|
277 | def load_ipython_extension(ip): | |
279 | """Load the extension in IPython.""" |
|
278 | """Load the extension in IPython.""" | |
280 | global _loaded |
|
279 | if 'cythonmagic' not in ip.extension_manager.loaded: | |
281 | if not _loaded: |
|
|||
282 | ip.register_magics(CythonMagics) |
|
280 | ip.register_magics(CythonMagics) | |
283 | _loaded = True |
|
@@ -362,10 +362,7 __doc__ = __doc__.format( | |||||
362 | ) |
|
362 | ) | |
363 |
|
363 | |||
364 |
|
364 | |||
365 | _loaded = False |
|
|||
366 | def load_ipython_extension(ip): |
|
365 | def load_ipython_extension(ip): | |
367 | """Load the extension in IPython.""" |
|
366 | """Load the extension in IPython.""" | |
368 | global _loaded |
|
367 | if 'octavemagic' not in ip.extension_manager.loaded: | |
369 | if not _loaded: |
|
|||
370 | ip.register_magics(OctaveMagics) |
|
368 | ip.register_magics(OctaveMagics) | |
371 | _loaded = True |
|
@@ -588,10 +588,7 __doc__ = __doc__.format( | |||||
588 | ) |
|
588 | ) | |
589 |
|
589 | |||
590 |
|
590 | |||
591 | _loaded = False |
|
|||
592 | def load_ipython_extension(ip): |
|
591 | def load_ipython_extension(ip): | |
593 | """Load the extension in IPython.""" |
|
592 | """Load the extension in IPython.""" | |
594 | global _loaded |
|
593 | if 'rmagic' not in ip.extension_manager.loaded: | |
595 | if not _loaded: |
|
|||
596 | ip.register_magics(RMagics) |
|
594 | ip.register_magics(RMagics) | |
597 | _loaded = True |
|
@@ -209,12 +209,7 class StoreMagics(Magics): | |||||
209 | print "Stored '%s' (%s)" % (args[0], obj.__class__.__name__) |
|
209 | print "Stored '%s' (%s)" % (args[0], obj.__class__.__name__) | |
210 |
|
210 | |||
211 |
|
211 | |||
212 | _loaded = False |
|
|||
213 |
|
||||
214 |
|
||||
215 | def load_ipython_extension(ip): |
|
212 | def load_ipython_extension(ip): | |
216 | """Load the extension in IPython.""" |
|
213 | """Load the extension in IPython.""" | |
217 | global _loaded |
|
214 | if 'storemagic' not in ip.extension_manager.loaded: | |
218 | if not _loaded: |
|
|||
219 | ip.register_magics(StoreMagics) |
|
215 | ip.register_magics(StoreMagics) | |
220 | _loaded = True |
|
General Comments 0
You need to be logged in to leave comments.
Login now