##// END OF EJS Templates
Merge pull request #1732 from fperez/cellmagics...
Merge pull request #1732 from fperez/cellmagics Refactoring of the magics system and implementation of cell magics. This PR completely refactors the magic system, finally moving the magic objects to standalone, independent objects instead of being the mixin class we'd had since the beginning of IPython. Now, a separate base class is provided in IPython.core.magic.Magics that users can subclass to create their own magics. Decorators are also provided to create magics from simple functions without the need for object orientation. All builtin magics now exist in a few subclasses that group together related functionality, and the new IPython.core.magics package has been created to organize this into smaller files. This cleanup was the last major piece of deep refactoring needed from the original 2001 codebase. Secondly, this PR introduces a new type of magic function, prefixed with `%%` instead of `%`, which operates at the cell level. A cell magic receives two arguments: the line it is called on (like a line magic) and the body of the cell below it. Cell magics are most natural in the notebook, but they also work in the terminal and qt console, with the usual approach of using a blank line to signal cell termination. This PR closes #1611, or IPEP 1, where the design had been discussed.

File last commit:

r2498:3eae1372
r7011:61eb2ffe merge
Show More
test_imports.py
26 lines | 581 B | text/x-python | PythonLexer
Brian Granger
background_jobs.py => lib/backgroundjob.py and imports updated.
r2011 # encoding: utf-8
def test_import_coloransi():
from IPython.utils import coloransi
Brian Granger
generics.py => utils/generics.py
r2022 def test_import_generics():
from IPython.utils import generics
Brian Granger
ipstruct.py => utils/ipstruct.py and imports updated.
r2030 def test_import_ipstruct():
from IPython.utils import ipstruct
Brian Granger
genutils.py => utils/genutils.py and updated imports and tests.
r2023
Brian Granger
PyColorize.py => utils/PyColorize.py and updated imports.
r2042 def test_import_PyColorize():
from IPython.utils import PyColorize
Brian Granger
rlineimpl.py utils/rlineimpl.py and imports updated.
r2044
def test_import_rlineimpl():
Brian Granger
ultraTB.py => core/ultratb.py and imports updated.
r2048 from IPython.utils import rlineimpl
def test_import_strdispatch():
Brian Granger
upgrade_dir.py => utils/upgradedir.py and updated imports.
r2049 from IPython.utils import strdispatch
def test_import_upgradedir():
from IPython.utils import upgradedir
Brian Granger
wildcard.py => utils/wildcard.py and updated imports.
r2051
def test_import_wildcard():
from IPython.utils import wildcard
Brian Granger
winconsole.py => utils/winconsole.py and imports updated.
r2052