##// END OF EJS Templates
update docs to reflect XDG support, new ~/.config/ipython default
MinRK -
Show More
@@ -105,7 +105,7 b' class Application(object):'
105 default_log_level = logging.WARN
105 default_log_level = logging.WARN
106 #: Set by --profile option
106 #: Set by --profile option
107 profile_name = None
107 profile_name = None
108 #: User's ipython directory, typically ~/.ipython/
108 #: User's ipython directory, typically ~/.ipython or ~/.config/ipython/
109 ipython_dir = None
109 ipython_dir = None
110 #: Internal defaults, implemented in code.
110 #: Internal defaults, implemented in code.
111 default_config = None
111 default_config = None
@@ -395,7 +395,7 b" to 'mydir', if it exists."
395
395
396 You can define your own magic functions to extend the system. See the supplied
396 You can define your own magic functions to extend the system. See the supplied
397 ipythonrc and example-magic.py files for details (in your ipython
397 ipythonrc and example-magic.py files for details (in your ipython
398 configuration directory, typically $HOME/.ipython/).
398 configuration directory, typically $HOME/.config/ipython on Linux or $HOME/.ipython elsewhere).
399
399
400 You can also define your own aliased names for magic functions. In your
400 You can also define your own aliased names for magic functions. In your
401 ipythonrc file, placing a line like:
401 ipythonrc file, placing a line like:
@@ -30,9 +30,10 b' IPython: an enhanced interactive Python shell.'
30 command line, simply because they are not practical here. Look into your
30 command line, simply because they are not practical here. Look into your
31 ipython_config.py configuration file for details on those.
31 ipython_config.py configuration file for details on those.
32
32
33 This file typically installed in the $HOME/.ipython directory. For Windows
33 This file is typically installed in the IPYTHON_DIR directory. For Linux
34 users, $HOME resolves to C:\\Documents and Settings\\YourUserName in most
34 users, this will be $HOME/.config/ipython, and for other users it will be
35 instances.
35 $HOME/.ipython. For Windows users, $HOME resolves to C:\\Documents and
36 Settings\\YourUserName in most instances.
36
37
37 In IPython's documentation, we will refer to this directory as IPYTHON_DIR,
38 In IPython's documentation, we will refer to this directory as IPYTHON_DIR,
38 you can change its default location by setting any path you want in this
39 you can change its default location by setting any path you want in this
@@ -186,7 +186,7 b' class ControllerService(object, service.Service):'
186 This method takes the assigned id, ip/port and pid of the engine
186 This method takes the assigned id, ip/port and pid of the engine
187 and saves it to a file of the form:
187 and saves it to a file of the form:
188
188
189 ~/.ipython/log/ipcontroller-###-engine-info.log
189 IPYTHON_DIR/log/ipcontroller-###-engine-info.log
190
190
191 where ### is the pid of the controller.
191 where ### is the pid of the controller.
192
192
@@ -49,7 +49,7 b' The IPython controller provides a gateway between the IPython engines and'
49 clients. The controller needs to be started before the engines and can be
49 clients. The controller needs to be started before the engines and can be
50 configured using command line options or using a cluster directory. Cluster
50 configured using command line options or using a cluster directory. Cluster
51 directories contain config, log and security files and are usually located in
51 directories contain config, log and security files and are usually located in
52 your .ipython directory and named as "cluster_<profile>". See the --profile
52 your ipython directory and named as "cluster_<profile>". See the --profile
53 and --cluster-dir options for details.
53 and --cluster-dir options for details.
54 """
54 """
55
55
@@ -60,7 +60,7 b' IPython engines run in parallel and perform computations on behalf of a client'
60 and controller. A controller needs to be started before the engines. The
60 and controller. A controller needs to be started before the engines. The
61 engine can be configured using command line options or using a cluster
61 engine can be configured using command line options or using a cluster
62 directory. Cluster directories contain config, log and security files and are
62 directory. Cluster directories contain config, log and security files and are
63 usually located in your .ipython directory and named as "cluster_<profile>".
63 usually located in your ipython directory and named as "cluster_<profile>".
64 See the --profile and --cluster-dir options for details.
64 See the --profile and --cluster-dir options for details.
65 """
65 """
66
66
@@ -12,7 +12,8 b' Outdated configuration information that might still be useful'
12 This section will help you set various things in your environment for
12 This section will help you set various things in your environment for
13 your IPython sessions to be as efficient as possible. All of IPython's
13 your IPython sessions to be as efficient as possible. All of IPython's
14 configuration information, along with several example files, is stored
14 configuration information, along with several example files, is stored
15 in a directory named by default $HOME/.ipython. You can change this by
15 in a directory named by default $HOME/.config/ipython if $HOME/.config
16 exists (Linux), or $HOME/.ipython as a secondary default. You can change this by
16 defining the environment variable IPYTHONDIR, or at runtime with the
17 defining the environment variable IPYTHONDIR, or at runtime with the
17 command line option -ipythondir.
18 command line option -ipythondir.
18
19
@@ -94,7 +95,7 b" sequences. You can go to a 'no color' mode by typing '%colors NoColor'."
94
95
95 You can try using a different terminal emulator program (Emacs users,
96 You can try using a different terminal emulator program (Emacs users,
96 see below). To permanently set your color preferences, edit the file
97 see below). To permanently set your color preferences, edit the file
97 $HOME/.ipython/ipythonrc and set the colors option to the desired value.
98 $IPYTHON_DIR/ipythonrc and set the colors option to the desired value.
98
99
99
100
100 Object details (types, docstrings, source code, etc.)
101 Object details (types, docstrings, source code, etc.)
@@ -235,6 +235,9 b' This class hierarchy and configuration file accomplishes the following:'
235 configuration file. Because :class:`Foo` is the parent of :class:`Bar`
235 configuration file. Because :class:`Foo` is the parent of :class:`Bar`
236 it doesn't know anything about the :attr:`othervalue` attribute.
236 it doesn't know anything about the :attr:`othervalue` attribute.
237
237
238
239 .. _ipython_dir:
240
238 Configuration file location
241 Configuration file location
239 ===========================
242 ===========================
240
243
@@ -246,11 +249,19 b' this directory is determined by the following algorithm:'
246
249
247 * If not, the value returned by :func:`IPython.utils.path.get_ipython_dir`
250 * If not, the value returned by :func:`IPython.utils.path.get_ipython_dir`
248 is used. This function will first look at the :envvar:`IPYTHON_DIR`
251 is used. This function will first look at the :envvar:`IPYTHON_DIR`
249 environment variable and then default to the directory
252 environment variable and then default to a platform-specific default.
250 :file:`$HOME/.ipython`.
253
254 On posix systems (Linux, Unix, etc.), IPython respects the ``$XDG_CONFIG_HOME``
255 part of the `XDG Base Directory`_ specification. If ``$XDG_CONFIG_HOME`` is
256 defined and exists ( ``XDG_CONFIG_HOME`` has a default interpretation of
257 :file:`$HOME/.config`), then IPython's config directory will be located in
258 :file:`$XDG_CONFIG_HOME/ipython`. If users still have an IPython directory
259 in :file:`$HOME/.ipython`, then that will be used. in preference to the
260 system default.
251
261
252 For most users, the default value will simply be something like
262 For most users, the default value will simply be something like
253 :file:`$HOME/.ipython`.
263 :file:`$HOME/.config/ipython` on Linux, or :file:`$HOME/.ipython`
264 elsewhere.
254
265
255 Once the location of the IPython directory has been determined, you need to
266 Once the location of the IPython directory has been determined, you need to
256 know what filename to use for the configuration file. The basic idea is that
267 know what filename to use for the configuration file. The basic idea is that
@@ -327,3 +338,5 b' Here are the main requirements we wanted our configuration system to have:'
327 dynamic language and you don't always know everything that needs to be
338 dynamic language and you don't always know everything that needs to be
328 configured when a program starts.
339 configured when a program starts.
329
340
341
342 .. _`XDG Base Directory`: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
@@ -51,7 +51,7 b' An interactive Python session::'
51
51
52 >>> from IPython.utils.path import get_ipython_dir
52 >>> from IPython.utils.path import get_ipython_dir
53 >>> get_ipython_dir()
53 >>> get_ipython_dir()
54 '/home/fperez/.ipython'
54 '/home/fperez/.config/ipython'
55
55
56 An IPython session:
56 An IPython session:
57
57
@@ -27,11 +27,12 b' file and ignore your configuration setup.'
27
27
28 Please note that some of the configuration options are not available at
28 Please note that some of the configuration options are not available at
29 the command line, simply because they are not practical here. Look into
29 the command line, simply because they are not practical here. Look into
30 your ipythonrc configuration file for details on those. This file
30 your ipythonrc configuration file for details on those. This file is typically
31 typically installed in the $HOME/.ipython directory. For Windows users,
31 installed in the IPYTHON_DIR directory. For Linux
32 $HOME resolves to C:\\Documents and Settings\\YourUserName in most
32 users, this will be $HOME/.config/ipython, and for other users it will be
33 instances. In the rest of this text, we will refer to this directory as
33 $HOME/.ipython. For Windows users, $HOME resolves to C:\\Documents and
34 IPYTHON_DIR.
34 Settings\\YourUserName in most instances.
35
35
36
36
37
37
38
@@ -218,9 +219,9 b' All options with a [no] prepended can be specified in negated form'
218 include this one and load extra things for particular
219 include this one and load extra things for particular
219 tasks. For example:
220 tasks. For example:
220
221
221 1. $HOME/.ipython/ipythonrc : load basic things you always want.
222 1. $IPYTHON_DIR/ipythonrc : load basic things you always want.
222 2. $HOME/.ipython/ipythonrc-math : load (1) and basic math-related modules.
223 2. $IPYTHON_DIR/ipythonrc-math : load (1) and basic math-related modules.
223 3. $HOME/.ipython/ipythonrc-numeric : load (1) and Numeric and plotting modules.
224 3. $IPYTHON_DIR/ipythonrc-numeric : load (1) and Numeric and plotting modules.
224
225
225 Since it is possible to create an endless loop by having
226 Since it is possible to create an endless loop by having
226 circular file inclusions, IPython will stop if it reaches 15
227 circular file inclusions, IPython will stop if it reaches 15
@@ -25,7 +25,7 b' the "pysh" shortcut in start menu.'
25 If you want to use the features of sh profile as your defaults (which
25 If you want to use the features of sh profile as your defaults (which
26 might be a good idea if you use other profiles a lot of the time but
26 might be a good idea if you use other profiles a lot of the time but
27 still want the convenience of sh profile), add ``import ipy_profile_sh``
27 still want the convenience of sh profile), add ``import ipy_profile_sh``
28 to your ~/.ipython/ipy_user_conf.py.
28 to your $IPYTHON_DIR/ipy_user_conf.py.
29
29
30 The 'sh' profile is different from the default profile in that:
30 The 'sh' profile is different from the default profile in that:
31
31
@@ -138,13 +138,13 b' these keys are known as Foolscap URLs, or FURLs, because of the underlying'
138 network protocol we are using. As a user, you don't need to know anything
138 network protocol we are using. As a user, you don't need to know anything
139 about the details of these FURLs, other than that when the controller starts,
139 about the details of these FURLs, other than that when the controller starts,
140 it saves a set of FURLs to files named :file:`something.furl`. The default
140 it saves a set of FURLs to files named :file:`something.furl`. The default
141 location of these files is the :file:`~./ipython/security` directory.
141 location of these files is the :file:`$IPYTHON_DIR/cluster_<profile>/security` directory.
142
142
143 To connect and authenticate to the controller an engine or client simply needs
143 To connect and authenticate to the controller an engine or client simply needs
144 to present an appropriate FURL (that was originally created by the controller)
144 to present an appropriate FURL (that was originally created by the controller)
145 to the controller. Thus, the FURL files need to be copied to a location where
145 to the controller. Thus, the FURL files need to be copied to a location where
146 the clients and engines can find them. Typically, this is the
146 the clients and engines can find them. Typically, this is the
147 :file:`~./ipython/security` directory on the host where the client/engine is
147 :file:`$IPYTHON_DIR/cluster_<profile>/security` directory on the host where the client/engine is
148 running (which could be a different host than the controller). Once the FURL
148 running (which could be a different host than the controller). Once the FURL
149 files are copied over, everything should work fine.
149 files are copied over, everything should work fine.
150
150
@@ -212,7 +212,7 b' everything is working correctly, try the following commands:'
212 Remember, a client also needs to present a FURL file to the controller. How
212 Remember, a client also needs to present a FURL file to the controller. How
213 does this happen? When a multiengine client is created with no arguments, the
213 does this happen? When a multiengine client is created with no arguments, the
214 client tries to find the corresponding FURL file in the local
214 client tries to find the corresponding FURL file in the local
215 :file:`~./ipython/security` directory. If it finds it, you are set. If you
215 :file:`$IPYTHON_DIR/cluster_<profile>/security` directory. If it finds it, you are set. If you
216 have put the FURL file in a different location or it has a different name,
216 have put the FURL file in a different location or it has a different name,
217 create the client like this::
217 create the client like this::
218
218
@@ -37,7 +37,7 b' and then create a :class:`MultiEngineClient` instance:'
37 In [2]: mec = client.MultiEngineClient()
37 In [2]: mec = client.MultiEngineClient()
38
38
39 This form assumes that the :file:`ipcontroller-mec.furl` is in the
39 This form assumes that the :file:`ipcontroller-mec.furl` is in the
40 :file:`~./ipython/security` directory on the client's host. If not, the
40 :file:`$IPYTHON_DIR/cluster_<profile>/security` directory on the client's host. If not, the
41 location of the FURL file must be given as an argument to the
41 location of the FURL file must be given as an argument to the
42 constructor:
42 constructor:
43
43
@@ -40,14 +40,14 b' hosts ``host1``-``hostn``. The following steps are then required:'
40
40
41 At this point, the controller and engines will be connected. By default, the
41 At this point, the controller and engines will be connected. By default, the
42 FURL files created by the controller are put into the
42 FURL files created by the controller are put into the
43 :file:`~/.ipython/security` directory. If the engines share a filesystem with
43 :file:`$IPYTHON_DIR/cluster_<profile>/security` directory. If the engines share a filesystem with
44 the controller, step 2 can be skipped as the engines will automatically look
44 the controller, step 2 can be skipped as the engines will automatically look
45 at that location.
45 at that location.
46
46
47 The final step required required to actually use the running controller from a
47 The final step required required to actually use the running controller from a
48 client is to move the FURL files :file:`ipcontroller-mec.furl` and
48 client is to move the FURL files :file:`ipcontroller-mec.furl` and
49 :file:`ipcontroller-tc.furl` from ``host0`` to the host where the clients will
49 :file:`ipcontroller-tc.furl` from ``host0`` to the host where the clients will
50 be run. If these file are put into the :file:`~/.ipython/security` directory
50 be run. If these file are put into the :file:`$IPYTHON_DIR/cluster_<profile>/security` directory
51 of the client's host, they will be found automatically. Otherwise, the full
51 of the client's host, they will be found automatically. Otherwise, the full
52 path to them has to be passed to the client's constructor.
52 path to them has to be passed to the client's constructor.
53
53
@@ -74,7 +74,7 b' controller and engines in the following situations:'
74 .. note::
74 .. note::
75
75
76 Currently :command:`ipcluster` requires that the
76 Currently :command:`ipcluster` requires that the
77 :file:`~/.ipython/security` directory live on a shared filesystem that is
77 :file:`$IPYTHON_DIR/cluster_<profile>/security` directory live on a shared filesystem that is
78 seen by both the controller and engines. If you don't have a shared file
78 seen by both the controller and engines. If you don't have a shared file
79 system you will need to use :command:`ipcontroller` and
79 system you will need to use :command:`ipcontroller` and
80 :command:`ipengine` directly. This constraint can be relaxed if you are
80 :command:`ipengine` directly. This constraint can be relaxed if you are
@@ -289,7 +289,7 b' the command::'
289 $ ipengine
289 $ ipengine
290
290
291 The engines should start and automatically connect to the controller using the
291 The engines should start and automatically connect to the controller using the
292 FURL files in :file:`~./ipython/security`. You are now ready to use the
292 FURL files in :file:`$IPYTHON_DIR/cluster_<profile>/security`. You are now ready to use the
293 controller and engines from IPython.
293 controller and engines from IPython.
294
294
295 .. warning::
295 .. warning::
@@ -312,7 +312,7 b' When the controller and engines are running on different hosts, things are'
312 slightly more complicated, but the underlying ideas are the same:
312 slightly more complicated, but the underlying ideas are the same:
313
313
314 1. Start the controller on a host using :command:`ipcontroller`.
314 1. Start the controller on a host using :command:`ipcontroller`.
315 2. Copy :file:`ipcontroller-engine.furl` from :file:`~./ipython/security` on
315 2. Copy :file:`ipcontroller-engine.furl` from :file:`$IPYTHON_DIR/cluster_<profile>/security` on
316 the controller's host to the host where the engines will run.
316 the controller's host to the host where the engines will run.
317 3. Use :command:`ipengine` on the engine's hosts to start the engines.
317 3. Use :command:`ipengine` on the engine's hosts to start the engines.
318
318
@@ -320,7 +320,7 b' The only thing you have to be careful of is to tell :command:`ipengine` where'
320 the :file:`ipcontroller-engine.furl` file is located. There are two ways you
320 the :file:`ipcontroller-engine.furl` file is located. There are two ways you
321 can do this:
321 can do this:
322
322
323 * Put :file:`ipcontroller-engine.furl` in the :file:`~./ipython/security`
323 * Put :file:`ipcontroller-engine.furl` in the :file:`$IPYTHON_DIR/cluster_<profile>/security`
324 directory on the engine's host, where it will be found automatically.
324 directory on the engine's host, where it will be found automatically.
325 * Call :command:`ipengine` with the ``--furl-file=full_path_to_the_file``
325 * Call :command:`ipengine` with the ``--furl-file=full_path_to_the_file``
326 flag.
326 flag.
@@ -332,7 +332,7 b' The ``--furl-file`` flag works like this::'
332 .. note::
332 .. note::
333
333
334 If the controller's and engine's hosts all have a shared file system
334 If the controller's and engine's hosts all have a shared file system
335 (:file:`~./ipython/security` is the same on all of them), then things
335 (:file:`$IPYTHON_DIR/cluster_<profile>/security` is the same on all of them), then things
336 will just work!
336 will just work!
337
337
338 Make FURL files persistent
338 Make FURL files persistent
@@ -346,7 +346,7 b' to be able to create the key (or FURL file) once, and then simply use it at'
346 any point in the future.
346 any point in the future.
347
347
348 This is possible, but before you do this, you **must** remove any old FURL
348 This is possible, but before you do this, you **must** remove any old FURL
349 files in the :file:`~/.ipython/security` directory.
349 files in the :file:`$IPYTHON_DIR/cluster_<profile>/security` directory.
350
350
351 .. warning::
351 .. warning::
352
352
@@ -379,7 +379,7 b' Log files'
379
379
380 All of the components of IPython have log files associated with them.
380 All of the components of IPython have log files associated with them.
381 These log files can be extremely useful in debugging problems with
381 These log files can be extremely useful in debugging problems with
382 IPython and can be found in the directory :file:`~/.ipython/log`. Sending
382 IPython and can be found in the directory :file:`$IPYTHON_DIR/cluster_<profile>/log`. Sending
383 the log files to us will often help us to debug any problems.
383 the log files to us will often help us to debug any problems.
384
384
385
385
@@ -117,7 +117,7 b' controller creates a number of FURLs for different purposes:'
117 to execute.
117 to execute.
118
118
119 Upon starting, the controller creates these different FURLS and writes them
119 Upon starting, the controller creates these different FURLS and writes them
120 files in the user-read-only directory :file:`$HOME/.ipython/security`. Thus,
120 files in the user-read-only directory :file:`$IPYTHON_DIR/cluster_default/security`. Thus,
121 only the user who starts the controller has access to the FURLs.
121 only the user who starts the controller has access to the FURLs.
122
122
123 For an IPython client or engine to authenticate with a controller, it must
123 For an IPython client or engine to authenticate with a controller, it must
@@ -41,7 +41,7 b' and then create a :class:`TaskClient` instance:'
41 In [2]: tc = client.TaskClient()
41 In [2]: tc = client.TaskClient()
42
42
43 This form assumes that the :file:`ipcontroller-tc.furl` is in the
43 This form assumes that the :file:`ipcontroller-tc.furl` is in the
44 :file:`~./ipython/security` directory on the client's host. If not, the
44 :file:`$IPYTHON_DIR/cluster_<profile>/security` directory on the client's host. If not, the
45 location of the FURL file must be given as an argument to the
45 location of the FURL file must be given as an argument to the
46 constructor:
46 constructor:
47
47
General Comments 0
You need to be logged in to leave comments. Login now