##// END OF EJS Templates
adjust MagicManager.register to handle Configurable magics...
MinRK -
Show More
@@ -30,7 +30,7 b' from IPython.external.decorator import decorator'
30 30 from IPython.utils.ipstruct import Struct
31 31 from IPython.utils.process import arg_split
32 32 from IPython.utils.text import dedent
33 from IPython.utils.traitlets import Bool, Dict, Instance
33 from IPython.utils.traitlets import Bool, Dict, Instance, MetaHasTraits
34 34 from IPython.utils.warn import error, warn
35 35
36 36 #-----------------------------------------------------------------------------
@@ -355,10 +355,10 b' class MagicsManager(Configurable):'
355 355 for m in magic_objects:
356 356 if not m.registered:
357 357 raise ValueError("Class of magics %r was constructed without "
358 "the @register_macics class decorator")
359 if type(m) is type:
358 "the @register_magics class decorator")
359 if type(m) in (type, MetaHasTraits):
360 360 # If we're given an uninstantiated class
361 m = m(self.shell)
361 m = m(shell=self.shell)
362 362
363 363 # Now that we have an instance, we can register it and update the
364 364 # table of callables
General Comments 0
You need to be logged in to leave comments. Login now