##// END OF EJS Templates
fix small indexing bug in %config...
MinRK -
Show More
@@ -3696,8 +3696,12 b' Defaulting color scheme to \'NoColor\'"""'
3696
3696
3697 """
3697 """
3698 from IPython.config.loader import Config
3698 from IPython.config.loader import Config
3699 # get list of class names for configurables that have someting to configure:
3699 # some IPython objects are Configurable, but do not yet have
3700 classnames = [ c.__class__.__name__ for c in self.configurables if c.__class__.class_traits(config=True) ]
3700 # any configurable traits. Exclude them from the effects of
3701 # this magic, as their presence is just noise:
3702 configurables = [ c for c in self.configurables if c.__class__.class_traits(config=True) ]
3703 classnames = [ c.__class__.__name__ for c in configurables ]
3704
3701 line = s.strip()
3705 line = s.strip()
3702 if not line:
3706 if not line:
3703 # print available configurable names
3707 # print available configurable names
@@ -3708,7 +3712,7 b' Defaulting color scheme to \'NoColor\'"""'
3708 elif line in classnames:
3712 elif line in classnames:
3709 # `%config TerminalInteractiveShell` will print trait info for
3713 # `%config TerminalInteractiveShell` will print trait info for
3710 # TerminalInteractiveShell
3714 # TerminalInteractiveShell
3711 c = self.configurables[classnames.index(line)]
3715 c = configurables[classnames.index(line)]
3712 cls = c.__class__
3716 cls = c.__class__
3713 help = cls.class_get_help(c)
3717 help = cls.class_get_help(c)
3714 # strip leading '--' from cl-args:
3718 # strip leading '--' from cl-args:
@@ -3725,7 +3729,7 b' Defaulting color scheme to \'NoColor\'"""'
3725 cfg = Config()
3729 cfg = Config()
3726 exec "cfg."+line in locals(), self.user_ns
3730 exec "cfg."+line in locals(), self.user_ns
3727
3731
3728 for configurable in self.configurables:
3732 for configurable in configurables:
3729 try:
3733 try:
3730 configurable.update_config(cfg)
3734 configurable.update_config(cfg)
3731 except Exception as e:
3735 except Exception as e:
General Comments 0
You need to be logged in to leave comments. Login now