diff --git a/IPython/core/hooks.py b/IPython/core/hooks.py index cd9e46c..c34d4f7 100644 --- a/IPython/core/hooks.py +++ b/IPython/core/hooks.py @@ -13,7 +13,7 @@ itself, so hooks have full access to the entire IPython object. If you wish to define a new hook and activate it, you need to put the necessary code into a python file which can be either imported or execfile()'d -from within your ipythonrc configuration. +from within your profile's ipython_config.py configuration. For example, suppose that you have a module called 'myiphooks' in your PYTHONPATH, which contains the following definition: diff --git a/IPython/core/magic.py b/IPython/core/magic.py index 8b2d0cc..c255217 100644 --- a/IPython/core/magic.py +++ b/IPython/core/magic.py @@ -640,11 +640,10 @@ Currently the magic system has the following functions:\n""" search. -i/-c: make the pattern case insensitive/sensitive. If neither of - these options is given, the default is read from your ipythonrc - file. The option name which sets this value is - 'wildcards_case_sensitive'. If this option is not specified in your - ipythonrc file, IPython's internal default is to do a case sensitive - search. + these options are given, the default is read from your configuration + file, with the option ``InteractiveShell.wildcards_case_sensitive``. + If this option is not specified in your configuration file, IPython's + internal default is to do a case sensitive search. -e/-s NAMESPACE: exclude/search a given namespace. The pattern you specifiy can be searched in any of the following namespaces: @@ -1230,8 +1229,8 @@ Currently the magic system has the following functions:\n""" interactive pdb debugger after the traceback printout. %pdb toggles this feature on and off. - The initial state of this feature is set in your ipythonrc - configuration file (the variable is called 'pdb'). + The initial state of this feature is set in your configuration + file (the option is ``InteractiveShell.pdb``). If you want to just activate the debugger AFTER an exception has fired, without having to type '%pdb on' and rerunning your code, you can use @@ -2268,16 +2267,17 @@ Currently the magic system has the following functions:\n""" Usage: %edit [options] [args] - %edit runs IPython's editor hook. The default version of this hook is - set to call the __IPYTHON__.rc.editor command. This is read from your - environment variable $EDITOR. If this isn't found, it will default to - vi under Linux/Unix and to notepad under Windows. See the end of this - docstring for how to change the editor hook. + %edit runs IPython's editor hook. The default version of this hook is + set to call the editor specified by your $EDITOR environment variable. + If this isn't found, it will default to vi under Linux/Unix and to + notepad under Windows. See the end of this docstring for how to change + the editor hook. - You can also set the value of this editor via the command line option - '-editor' or in your ipythonrc file. This is useful if you wish to use - specifically for IPython an editor different from your typical default - (and for Windows users who typically don't set environment variables). + You can also set the value of this editor via the + ``TerminalInteractiveShell.editor`` option in your configuration file. + This is useful if you wish to use a different editor from your typical + default with IPython (and for Windows users who typically don't set + environment variables). This command allows you to conveniently edit multi-line code right in your IPython session. @@ -2316,25 +2316,25 @@ Currently the magic system has the following functions:\n""" If arguments are given, the following possibilites exist: - If the argument is a filename, IPython will load that into the - editor. It will execute its contents with execfile() when you exit, - loading any code in the file into your interactive namespace. + editor. It will execute its contents with execfile() when you exit, + loading any code in the file into your interactive namespace. - The arguments are ranges of input history, e.g. "7 ~1/4-6". - The syntax is the same as in the %history magic. + The syntax is the same as in the %history magic. - If the argument is a string variable, its contents are loaded - into the editor. You can thus edit any string which contains - python code (including the result of previous edits). + into the editor. You can thus edit any string which contains + python code (including the result of previous edits). - If the argument is the name of an object (other than a string), - IPython will try to locate the file where it was defined and open the - editor at the point where it is defined. You can use `%edit function` - to load an editor exactly at the point where 'function' is defined, - edit it and have the file be executed automatically. - - If the object is a macro (see %macro for details), this opens up your - specified editor with a temporary file containing the macro's data. - Upon exit, the macro is reloaded with the contents of the file. + IPython will try to locate the file where it was defined and open the + editor at the point where it is defined. You can use `%edit function` + to load an editor exactly at the point where 'function' is defined, + edit it and have the file be executed automatically. + + - If the object is a macro (see %macro for details), this opens up your + specified editor with a temporary file containing the macro's data. + Upon exit, the macro is reloaded with the contents of the file. Note: opening at an exact line is only supported under Unix, and some editors (like kedit and gedit up to Gnome 2.8) do not understand the diff --git a/IPython/core/usage.py b/IPython/core/usage.py index 5982795..42704fa 100644 --- a/IPython/core/usage.py +++ b/IPython/core/usage.py @@ -81,7 +81,7 @@ MAIN FEATURES * Magic commands: type %magic for information on the magic subsystem. -* System command aliases, via the %alias command or the ipythonrc config file. +* System command aliases, via the %alias command or the configuration file(s). * Dynamic object information: diff --git a/IPython/lib/irunner.py b/IPython/lib/irunner.py index 53c7346..4ca9318 100755 --- a/IPython/lib/irunner.py +++ b/IPython/lib/irunner.py @@ -328,9 +328,10 @@ class PythonRunner(InteractiveRunner): class SAGERunner(InteractiveRunner): """Interactive SAGE runner. - WARNING: this runner only works if you manually configure your SAGE copy - to use 'colors NoColor' in the ipythonrc config file, since currently the - prompt matching regexp does not identify color sequences.""" + WARNING: this runner only works if you manually adjust your SAGE + configuration so that the 'color' option in the configuration file is set to + 'NoColor', because currently the prompt matching regexp does not identify + color sequences.""" def __init__(self,program='sage',args=None,out=sys.stdout,echo=True): """New runner, optionally passing the sage command to use.""" diff --git a/IPython/testing/plugin/ipdoctest.py b/IPython/testing/plugin/ipdoctest.py index c3bdbfb..b36632d 100644 --- a/IPython/testing/plugin/ipdoctest.py +++ b/IPython/testing/plugin/ipdoctest.py @@ -3,10 +3,10 @@ Limitations: - When generating examples for use as doctests, make sure that you have - pretty-printing OFF. This can be done either by starting ipython with the - flag '--nopprint', by setting pprint to 0 in your ipythonrc file, or by - interactively disabling it with %Pprint. This is required so that IPython - output matches that of normal Python, which is used by doctest for internal + pretty-printing OFF. This can be done either by setting the + ``PlainTextFormatter.pprint`` option in your configuration file to False, or + by interactively disabling it with %Pprint. This is required so that IPython + output matches that of normal Python, which is used by doctest for internal execution. - Do not rely on specific prompt numbers for results (such as using diff --git a/IPython/zmq/zmqshell.py b/IPython/zmq/zmqshell.py index e556610..ac7df79 100644 --- a/IPython/zmq/zmqshell.py +++ b/IPython/zmq/zmqshell.py @@ -235,16 +235,9 @@ class ZMQInteractiveShell(InteractiveShell): Usage: %edit [options] [args] - %edit runs IPython's editor hook. The default version of this hook is - set to call the __IPYTHON__.rc.editor command. This is read from your - environment variable $EDITOR. If this isn't found, it will default to - vi under Linux/Unix and to notepad under Windows. See the end of this - docstring for how to change the editor hook. - - You can also set the value of this editor via the command line option - '-editor' or in your ipythonrc file. This is useful if you wish to use - specifically for IPython an editor different from your typical default - (and for Windows users who typically don't set environment variables). + %edit runs an external text editor. You will need to set the command for + this editor via the ``TerminalInteractiveShell.editor`` option in your + configuration file before it will work. This command allows you to conveniently edit multi-line code right in your IPython session. @@ -363,16 +356,7 @@ class ZMQInteractiveShell(InteractiveShell): Editing... done. Executing edited code... hello again Out[7]: "print 'hello again'n" - - - Changing the default editor hook: - - If you wish to write your own editor hook, you can put it in a - configuration file which you load at startup time. The default hook - is defined in the IPython.core.hooks module, and you can use that as a - starting example for further modifications. That file also has - general instructions on how to set a new hook for use once you've - defined it.""" + """ opts,args = self.parse_options(parameter_s,'prn:') diff --git a/docs/source/interactive/reference.txt b/docs/source/interactive/reference.txt index 550b1ab..89abdc5 100644 --- a/docs/source/interactive/reference.txt +++ b/docs/source/interactive/reference.txt @@ -19,10 +19,12 @@ file and ignore your configuration setup. Please note that some of the configuration options are not available at the command line, simply because they are not practical here. Look into -your ipythonrc configuration file for details on those. This file is typically -installed in the IPYTHON_DIR directory. For Linux -users, this will be $HOME/.config/ipython, and for other users it will be -$HOME/.ipython. For Windows users, $HOME resolves to C:\\Documents and +your configuration files for details on those. There are separate configuration +files for each profile, and the files look like "ipython_config.py" or +"ipython_config_.py". Profile directories look like +"profile_profilename" and are typically installed in the IPYTHON_DIR directory. +For Linux users, this will be $HOME/.config/ipython, and for other users it +will be $HOME/.ipython. For Windows users, $HOME resolves to C:\\Documents and Settings\\YourUserName in most instances. @@ -46,9 +48,9 @@ follow in any order. All options can be abbreviated to their shortest non-ambiguous form and are case-sensitive. One or two dashes can be used. Some options have an alternate short form, indicated after a ``|``. -Most options can also be set from your ipythonrc configuration file. See -the provided example for more details on what the options do. Options -given at the command line override the values set in the ipythonrc file. +Most options can also be set from your configuration file. See the provided +example for more details on what the options do. Options given at the command +line override the values set in the configuration file. All options with a [no] prepended can be specified in negated form (--no-option instead of --option) to turn the feature off. @@ -110,7 +112,7 @@ All options with a [no] prepended can be specified in negated form code and various other elements. However, because this information is passed through a pager (like 'less') and many pagers get confused with color codes, this option is off by default. You can test it and turn - it on permanently in your ipythonrc file if it works for you. As a + it on permanently in your configuration file if it works for you. As a reference, the 'less' pager supplied with Mandrake 8.2 works ok, but that in RedHat 7.2 doesn't. @@ -569,7 +571,7 @@ syntax for this can be found in the readline documentation available with your system or on the Internet. IPython doesn't read this file (if it exists) directly, but it does support passing to readline valid options via a simple interface. In brief, you can customize readline by -setting the following options in your ipythonrc configuration file (note +setting the following options in your configuration file (note that these options can not be specified at the command line): * **readline_parse_and_bind**: this option can appear as many times as @@ -594,8 +596,7 @@ that these options can not be specified at the command line): This option is off by default so that new users see all attributes of any objects they are dealing with. -You will find the default values along with a corresponding detailed -explanation in your ipythonrc file. +You will find the default values in your configuration file. Session logging and restoring @@ -696,8 +697,7 @@ Even object attributes can be expanded:: System command aliases ---------------------- -The %alias magic function and the alias option in the ipythonrc -configuration file allow you to define magic functions which are in fact +The %alias magic function allows you to define magic functions which are in fact system shell commands. These aliases can have parameters. ``%alias alias_name cmd`` defines 'alias_name' as an alias for 'cmd' @@ -828,7 +828,7 @@ accidentally overwrite the Out variable you can recover it by typing This system obviously can potentially put heavy memory demands on your system, since it prevents Python's garbage collector from removing any previously computed results. You can control how many results are kept -in memory with the option (at the command line or in your ipythonrc +in memory with the option (at the command line or in your configuration file) cache_size. If you set it to 0, the whole system is completely disabled and the prompts revert to the classic '>>>' of normal Python. diff --git a/docs/source/interactive/tips.txt b/docs/source/interactive/tips.txt index a93a161..eaa531a 100644 --- a/docs/source/interactive/tips.txt +++ b/docs/source/interactive/tips.txt @@ -98,34 +98,3 @@ Continuing with the example above, this should illustrate this idea:: This section was written after a contribution by Alexander Belchenko on the IPython user list. -.. The section below needs to be updated for the new config system. - -.. Effective logging - ----------------- - -.. A very useful suggestion sent in by Robert Kern follows: - -.. I recently happened on a nifty way to keep tidy per-project log files. I - made a profile for my project (which is called "parkfield"):: - - include ipythonrc - - # cancel earlier logfile invocation: - - logfile '' - - execute import time - - execute __cmd = '/Users/kern/research/logfiles/parkfield-%s.log rotate' - - execute __IP.magic_logstart(__cmd % time.strftime('%Y-%m-%d')) - -.. I also added a shell alias for convenience:: - - alias parkfield="ipython --pylab profile=parkfield" - -.. Now I have a nice little directory with everything I ever type in, - organized by project and date. - - -