##// END OF EJS Templates
Merge pull request #923 from minrk/configmagic...
Merge pull request #923 from minrk/configmagic New %config magic to interactively manipulate all configurables. This allows users to type `%config Foo.bar = 5` to control any IPython configurable. The Magic class keeps a list of configurables which will be updated by the change, so any objects that should be accessible to this magic should be appended to `shell.configurables`. I started with everything I saw as configurable in InteractiveShell. ## Usage Use just `%config` to see what classes are available, and `%config Class` to get the trait info for that class. When setting values via` %config Class.trait = value` It is evaluated with user_ns in globals, so you can do arbitrary things like: ```python In [4]: default = 'png' In [5]: %config InlineBackendConfig.figure_format = raw_input('what figure format should we use? ') or default ``` ## Note This magic reveals just how much we *don't* use traits/config properly. Almost everything is attached to the InteractiveShell object, and has an effect exactly once during an `init_foo()` method, rather than allowing config propagation via `_trait_changed()` methods. For instance, IPCompleter has an `omit__names` attribute, but the configurable is `InteractiveShell.readline_omit__names`, which is clearly wrong. We've done a good job with config in *new* code, but I think existing code needs a pretty hefty pass to get configurables attached to the right objects, and getting logic like `%colors` into `shell._colors_changed`. Closes #903
Fernando Perez -
r5237:b7253627 merge
Show More
Name Size Modified Last Commit Author
/ IPython / core / tests
__init__.py Loading ...
refbug.py Loading ...
simpleerr.py Loading ...
tclass.py Loading ...
test_application.py Loading ...
test_autocall.py Loading ...
test_compilerop.py Loading ...
test_completer.py Loading ...
test_fakemodule.py Loading ...
test_formatters.py Loading ...
test_handlers.py Loading ...
test_history.py Loading ...
test_imports.py Loading ...
test_inputsplitter.py Loading ...
test_interactiveshell.py Loading ...
test_iplib.py Loading ...
test_logger.py Loading ...
test_magic.py Loading ...
test_magic_arguments.py Loading ...
test_oinspect.py Loading ...
test_page.py Loading ...
test_plugin.py Loading ...
test_prefilter.py Loading ...
test_run.py Loading ...
test_splitinput.py Loading ...