##// 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 3698 from IPython.config.loader import Config
3699 # get list of class names for configurables that have someting to configure:
3700 classnames = [ c.__class__.__name__ for c in self.configurables if c.__class__.class_traits(config=True) ]
3699 # some IPython objects are Configurable, but do not yet have
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 3705 line = s.strip()
3702 3706 if not line:
3703 3707 # print available configurable names
@@ -3708,7 +3712,7 b' Defaulting color scheme to \'NoColor\'"""'
3708 3712 elif line in classnames:
3709 3713 # `%config TerminalInteractiveShell` will print trait info for
3710 3714 # TerminalInteractiveShell
3711 c = self.configurables[classnames.index(line)]
3715 c = configurables[classnames.index(line)]
3712 3716 cls = c.__class__
3713 3717 help = cls.class_get_help(c)
3714 3718 # strip leading '--' from cl-args:
@@ -3725,7 +3729,7 b' Defaulting color scheme to \'NoColor\'"""'
3725 3729 cfg = Config()
3726 3730 exec "cfg."+line in locals(), self.user_ns
3727 3731
3728 for configurable in self.configurables:
3732 for configurable in configurables:
3729 3733 try:
3730 3734 configurable.update_config(cfg)
3731 3735 except Exception as e:
General Comments 0
You need to be logged in to leave comments. Login now