##// 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:

r4574:a8c54759
r7011:61eb2ffe merge
Show More
test_imports.py
58 lines | 1.3 KiB | text/x-python | PythonLexer
Brian Granger
completer.py => core/completer.py and imports updated.
r2012 # encoding: utf-8
def test_import_completer():
from IPython.core import completer
Brian Granger
CrashHandler.py => core/crashhandler.py and updated all imports.
r2014 def test_import_crashhandler():
from IPython.core import crashhandler
Brian Granger
Debugger.py => core/debugger.py and updated all imports.
r2015
def test_import_debugger():
Brian Granger
FakeModule.py => core/fakemodule.py and updated tests and imports.
r2020 from IPython.core import debugger
def test_import_fakemodule():
from IPython.core import fakemodule
Brian Granger
excolors.py => core/excolors.py and updated import statements.
r2021 def test_import_excolors():
from IPython.core import excolors
Brian Granger
hooks.py => core/hooks.py and updated imports.
r2026 def test_import_history():
from IPython.core import history
def test_import_hooks():
from IPython.core import hooks
Brian Granger
ipapi.py => core/ipapi.py and imports updated.
r2027 def test_import_ipapi():
from IPython.core import ipapi
Brian Granger
Moving and renaming in preparation of subclassing InteractiveShell....
r2760 def test_import_interactiveshell():
from IPython.core import interactiveshell
Brian Granger
iplib.py => core/iplib.py and updated tests and imports.
r2028
Brian Granger
Logger.py => core/logger.py and updated imports.
r2032 def test_import_logger():
from IPython.core import logger
Brian Granger
macro.py => core/macro.py and upated imports.
r2033 def test_import_macro():
from IPython.core import macro
Brian Granger
hooks.py => core/hooks.py and updated imports.
r2026
Brian Granger
Magic.py => core/magic.py and imports updated.
r2036 def test_import_magic():
from IPython.core import magic
Brian Granger
hooks.py => core/hooks.py and updated imports.
r2026
Brian Granger
OInspect.py => core/oinspect.py and imports updated.
r2037 def test_import_oinspect():
from IPython.core import oinspect
Brian Granger
Prompts.py => core/prompts.py and imports updated.
r2040 def test_import_prefilter():
from IPython.core import prefilter
def test_import_prompts():
from IPython.core import prompts
Brian Granger
Release.py => core/release.py and imports updated.
r2043
def test_import_release():
Brian Granger
shadowns.py => core/shadowns.py and updated imports.
r2045 from IPython.core import release
def test_import_shadowns():
from IPython.core import shadowns
Brian Granger
Shell.py => core/shell.py and imports updated.
r2046
Brian Granger
ultraTB.py => core/ultratb.py and imports updated.
r2048 def test_import_ultratb():
from IPython.core import ultratb
Brian Granger
usage.py => core/usage.py and imports updated.
r2050
def test_import_usage():
from IPython.core import usage