##// 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 ...
alias.py Loading ...
application.py Loading ...
autocall.py Loading ...
builtin_trap.py Loading ...
compilerop.py Loading ...
completer.py Loading ...
completerlib.py Loading ...
crashhandler.py Loading ...
debugger.py Loading ...
display.py Loading ...
display_trap.py Loading ...
displayhook.py Loading ...
displaypub.py Loading ...
error.py Loading ...
excolors.py Loading ...
extensions.py Loading ...
fakemodule.py Loading ...
formatters.py Loading ...
history.py Loading ...
hooks.py Loading ...
inputsplitter.py Loading ...
interactiveshell.py Loading ...
ipapi.py Loading ...
logger.py Loading ...
macro.py Loading ...
magic.py Loading ...
magic_arguments.py Loading ...
oinspect.py Loading ...
page.py Loading ...
payload.py Loading ...
payloadpage.py Loading ...
plugin.py Loading ...
prefilter.py Loading ...
profileapp.py Loading ...
profiledir.py Loading ...
prompts.py Loading ...
release.py Loading ...
shadowns.py Loading ...
shellapp.py Loading ...
splitinput.py Loading ...
ultratb.py Loading ...
usage.py Loading ...