diff --git a/IPython/core/interactiveshell.py b/IPython/core/interactiveshell.py index 1068a5a..0298def 100644 --- a/IPython/core/interactiveshell.py +++ b/IPython/core/interactiveshell.py @@ -1997,7 +1997,7 @@ class InteractiveShell(SingletonConfigurable): from IPython.core import magics as m self.magics_manager = magic.MagicsManager(shell=self, confg=self.config, - user_magics=mf.UserMagics(self)) + user_magics=m.UserMagics(self)) self.configurables.append(self.magics_manager) # Expose as public API from the magics manager diff --git a/IPython/core/magic.py b/IPython/core/magic.py index 6c37597..230175a 100644 --- a/IPython/core/magic.py +++ b/IPython/core/magic.py @@ -165,7 +165,7 @@ class MagicsManager(Configurable): 'Automagic is OFF, % prefix IS needed for magic functions.', 'Automagic is ON, % prefix IS NOT needed for magic functions.'] - user_magics = Instance('IPython.core.magic_functions.UserMagics') + user_magics = Instance('IPython.core.magics.UserMagics') def __init__(self, shell=None, config=None, user_magics=None, **traits): diff --git a/IPython/core/magic_functions.py b/IPython/core/magic_functions.py index 1b06d7b..06acb23 100644 --- a/IPython/core/magic_functions.py +++ b/IPython/core/magic_functions.py @@ -61,20 +61,6 @@ from IPython.utils.text import format_screen from IPython.utils.timing import clock, clock2 from IPython.utils.warn import warn, error -#----------------------------------------------------------------------------- -# Magic implementation classes -#----------------------------------------------------------------------------- - -@register_magics -class UserMagics(Magics): - """Placeholder for user-defined magics to be added at runtime. - - All magics are eventually merged into a single namespace at runtime, but we - use this class to isolate the magics defined dynamically by the user into - their own class. - """ - - @register_magics class BasicMagics(Magics): """Magics that provide central IPython functionality. diff --git a/IPython/core/magics/__init__.py b/IPython/core/magics/__init__.py index 91df414..bf110ad 100644 --- a/IPython/core/magics/__init__.py +++ b/IPython/core/magics/__init__.py @@ -11,4 +11,19 @@ #----------------------------------------------------------------------------- # Imports #----------------------------------------------------------------------------- +from IPython.core.magic import Magics, register_magics from history import (HistoryMagics) + + +#----------------------------------------------------------------------------- +# Magic implementation classes +#----------------------------------------------------------------------------- + +@register_magics +class UserMagics(Magics): + """Placeholder for user-defined magics to be added at runtime. + + All magics are eventually merged into a single namespace at runtime, but we + use this class to isolate the magics defined dynamically by the user into + their own class. + """