Show More
@@ -118,7 +118,7 b' class BaseIPythonApplication(Application):' | |||||
118 | The name of the IPython directory. This directory is used for logging |
|
118 | The name of the IPython directory. This directory is used for logging | |
119 | configuration (through profiles), history storage, etc. The default |
|
119 | configuration (through profiles), history storage, etc. The default | |
120 | is usually $HOME/.ipython. This options can also be specified through |
|
120 | is usually $HOME/.ipython. This options can also be specified through | |
121 |
the environment variable IPYTHON |
|
121 | the environment variable IPYTHONDIR. | |
122 | """ |
|
122 | """ | |
123 | ) |
|
123 | ) | |
124 |
|
124 | |||
@@ -148,7 +148,7 b' class BaseIPythonApplication(Application):' | |||||
148 |
|
148 | |||
149 | def __init__(self, **kwargs): |
|
149 | def __init__(self, **kwargs): | |
150 | super(BaseIPythonApplication, self).__init__(**kwargs) |
|
150 | super(BaseIPythonApplication, self).__init__(**kwargs) | |
151 |
# ensure even default IPYTHON |
|
151 | # ensure even default IPYTHONDIR exists | |
152 | if not os.path.exists(self.ipython_dir): |
|
152 | if not os.path.exists(self.ipython_dir): | |
153 | self._ipython_dir_changed('ipython_dir', self.ipython_dir, self.ipython_dir) |
|
153 | self._ipython_dir_changed('ipython_dir', self.ipython_dir, self.ipython_dir) | |
154 |
|
154 | |||
@@ -186,7 +186,7 b' class BaseIPythonApplication(Application):' | |||||
186 | if not os.path.exists(readme): |
|
186 | if not os.path.exists(readme): | |
187 | path = os.path.join(get_ipython_package_dir(), u'config', u'profile') |
|
187 | path = os.path.join(get_ipython_package_dir(), u'config', u'profile') | |
188 | shutil.copy(os.path.join(path, 'README'), readme) |
|
188 | shutil.copy(os.path.join(path, 'README'), readme) | |
189 |
self.log.debug("IPYTHON |
|
189 | self.log.debug("IPYTHONDIR set to: %s" % new) | |
190 |
|
190 | |||
191 | def load_config_file(self, suppress_errors=True): |
|
191 | def load_config_file(self, suppress_errors=True): | |
192 | """Load the config file. |
|
192 | """Load the config file. |
@@ -135,7 +135,7 b' class ProfileList(Application):' | |||||
135 | The name of the IPython directory. This directory is used for logging |
|
135 | The name of the IPython directory. This directory is used for logging | |
136 | configuration (through profiles), history storage, etc. The default |
|
136 | configuration (through profiles), history storage, etc. The default | |
137 | is usually $HOME/.ipython. This options can also be specified through |
|
137 | is usually $HOME/.ipython. This options can also be specified through | |
138 |
the environment variable IPYTHON |
|
138 | the environment variable IPYTHONDIR. | |
139 | """ |
|
139 | """ | |
140 | ) |
|
140 | ) | |
141 |
|
141 |
@@ -39,10 +39,10 b' Usage' | |||||
39 | configuration, look into your `ipython_config.py` configuration file for |
|
39 | configuration, look into your `ipython_config.py` configuration file for | |
40 | details. |
|
40 | details. | |
41 |
|
41 | |||
42 |
This file is typically installed in the `IPYTHON |
|
42 | This file is typically installed in the `IPYTHONDIR` directory, and there | |
43 | is a separate configuration directory for each profile. The default profile |
|
43 | is a separate configuration directory for each profile. The default profile | |
44 |
directory will be located in $IPYTHON |
|
44 | directory will be located in $IPYTHONDIR/profile_default. For Linux users, | |
45 |
IPYTHON |
|
45 | IPYTHONDIR defaults to `$HOME/.config/ipython`, and for other Unix systems | |
46 | to `$HOME/.ipython`. For Windows users, $HOME resolves to C:\\Documents |
|
46 | to `$HOME/.ipython`. For Windows users, $HOME resolves to C:\\Documents | |
47 | and Settings\\YourUserName in most instances. |
|
47 | and Settings\\YourUserName in most instances. | |
48 |
|
48 | |||
@@ -50,10 +50,10 b' Usage' | |||||
50 |
|
50 | |||
51 | $> ipython profile create |
|
51 | $> ipython profile create | |
52 |
|
52 | |||
53 |
and start editing `IPYTHON |
|
53 | and start editing `IPYTHONDIR/profile_default/ipython_config.py` | |
54 |
|
54 | |||
55 | In IPython's documentation, we will refer to this directory as |
|
55 | In IPython's documentation, we will refer to this directory as | |
56 |
`IPYTHON |
|
56 | `IPYTHONDIR`, you can change its default location by creating an | |
57 | environment variable with this name and setting it to the desired path. |
|
57 | environment variable with this name and setting it to the desired path. | |
58 |
|
58 | |||
59 | For more information, see the manual available in HTML and PDF in your |
|
59 | For more information, see the manual available in HTML and PDF in your |
@@ -260,7 +260,10 b' def get_ipython_dir():' | |||||
260 | xdg_dir = get_xdg_dir() |
|
260 | xdg_dir = get_xdg_dir() | |
261 |
|
261 | |||
262 | # import pdb; pdb.set_trace() # dbg |
|
262 | # import pdb; pdb.set_trace() # dbg | |
263 | ipdir = env.get('IPYTHON_DIR', env.get('IPYTHONDIR', None)) |
|
263 | if 'IPYTHON_DIR' in env: | |
|
264 | warnings.warn('The environment variable IPYTHON_DIR is deprecated. ' | |||
|
265 | 'Please use IPYTHONDIR instead.') | |||
|
266 | ipdir = env.get('IPYTHONDIR', env.get('IPYTHON_DIR', None)) | |||
264 | if ipdir is None: |
|
267 | if ipdir is None: | |
265 | # not set explicitly, use XDG_CONFIG_HOME or HOME |
|
268 | # not set explicitly, use XDG_CONFIG_HOME or HOME | |
266 | home_ipdir = pjoin(home_dir, ipdir_def) |
|
269 | home_ipdir = pjoin(home_dir, ipdir_def) | |
@@ -318,7 +321,7 b' def get_ipython_module_path(module_str):' | |||||
318 | def locate_profile(profile='default'): |
|
321 | def locate_profile(profile='default'): | |
319 | """Find the path to the folder associated with a given profile. |
|
322 | """Find the path to the folder associated with a given profile. | |
320 |
|
323 | |||
321 |
I.e. find $IPYTHON |
|
324 | I.e. find $IPYTHONDIR/profile_whatever. | |
322 | """ |
|
325 | """ | |
323 | from IPython.core.profiledir import ProfileDir, ProfileDirError |
|
326 | from IPython.core.profiledir import ProfileDir, ProfileDirError | |
324 | try: |
|
327 | try: |
@@ -206,7 +206,7 b' def test_get_ipython_dir_1():' | |||||
206 | """test_get_ipython_dir_1, Testcase to see if we can call get_ipython_dir without Exceptions.""" |
|
206 | """test_get_ipython_dir_1, Testcase to see if we can call get_ipython_dir without Exceptions.""" | |
207 | env_ipdir = os.path.join("someplace", ".ipython") |
|
207 | env_ipdir = os.path.join("someplace", ".ipython") | |
208 | path._writable_dir = lambda path: True |
|
208 | path._writable_dir = lambda path: True | |
209 |
env['IPYTHON |
|
209 | env['IPYTHONDIR'] = env_ipdir | |
210 | ipdir = path.get_ipython_dir() |
|
210 | ipdir = path.get_ipython_dir() | |
211 | nt.assert_equal(ipdir, env_ipdir) |
|
211 | nt.assert_equal(ipdir, env_ipdir) | |
212 |
|
212 | |||
@@ -278,10 +278,10 b' def test_get_ipython_dir_6():' | |||||
278 |
|
278 | |||
279 | @with_environment |
|
279 | @with_environment | |
280 | def test_get_ipython_dir_7(): |
|
280 | def test_get_ipython_dir_7(): | |
281 |
"""test_get_ipython_dir_7, test home directory expansion on IPYTHON |
|
281 | """test_get_ipython_dir_7, test home directory expansion on IPYTHONDIR""" | |
282 | path._writable_dir = lambda path: True |
|
282 | path._writable_dir = lambda path: True | |
283 | home_dir = os.path.expanduser('~') |
|
283 | home_dir = os.path.expanduser('~') | |
284 |
env['IPYTHON |
|
284 | env['IPYTHONDIR'] = os.path.join('~', 'somewhere') | |
285 | ipdir = path.get_ipython_dir() |
|
285 | ipdir = path.get_ipython_dir() | |
286 | nt.assert_equal(ipdir, os.path.join(home_dir, 'somewhere')) |
|
286 | nt.assert_equal(ipdir, os.path.join(home_dir, 'somewhere')) | |
287 |
|
287 |
@@ -11,7 +11,7 b'' | |||||
11 | ipcluster is a control tool for IPython's parallel computing functions. |
|
11 | ipcluster is a control tool for IPython's parallel computing functions. | |
12 |
|
12 | |||
13 | IPython cluster startup. This starts a controller and engines using various |
|
13 | IPython cluster startup. This starts a controller and engines using various | |
14 |
approaches. Use the IPYTHON |
|
14 | approaches. Use the IPYTHONDIR environment variable to change your IPython | |
15 | directory from the default of ~/.ipython or ~/.config/ipython. The log and security |
|
15 | directory from the default of ~/.ipython or ~/.config/ipython. The log and security | |
16 | subdirectories of your IPython directory will be used by this script for log |
|
16 | subdirectories of your IPython directory will be used by this script for log | |
17 | files and security files. |
|
17 | files and security files. |
@@ -100,7 +100,7 b" Default: u'/Users/minrk/.ipython'" | |||||
100 | The name of the IPython directory. This directory is used for logging |
|
100 | The name of the IPython directory. This directory is used for logging | |
101 | configuration (through profiles), history storage, etc. The default is |
|
101 | configuration (through profiles), history storage, etc. The default is | |
102 | usually $HOME/.ipython. This options can also be specified through the |
|
102 | usually $HOME/.ipython. This options can also be specified through the | |
103 |
environment variable IPYTHON |
|
103 | environment variable IPYTHONDIR. | |
104 | .TP |
|
104 | .TP | |
105 | .B \-\-url=<Unicode> (HubFactory.url) |
|
105 | .B \-\-url=<Unicode> (HubFactory.url) | |
106 | Default: '' |
|
106 | Default: '' |
@@ -51,7 +51,7 b' whether to log to a file' | |||||
51 | The name of the IPython directory. This directory is used for logging |
|
51 | The name of the IPython directory. This directory is used for logging | |
52 | configuration (through profiles), history storage, etc. The default is |
|
52 | configuration (through profiles), history storage, etc. The default is | |
53 | usually $XDG_CONFIG_HOME/ipython. This options can also be specified |
|
53 | usually $XDG_CONFIG_HOME/ipython. This options can also be specified | |
54 |
through the environment variable IPYTHON |
|
54 | through the environment variable IPYTHONDIR. | |
55 | .TP |
|
55 | .TP | |
56 | .B \-\-url=<Unicode> (LogWatcher.url) |
|
56 | .B \-\-url=<Unicode> (LogWatcher.url) | |
57 | . |
|
57 | . |
@@ -182,7 +182,7 b" Default: u'/Users/minrk/.ipython'" | |||||
182 | The name of the IPython directory. This directory is used for logging |
|
182 | The name of the IPython directory. This directory is used for logging | |
183 | configuration (through profiles), history storage, etc. The default is |
|
183 | configuration (through profiles), history storage, etc. The default is | |
184 | usually $HOME/.ipython. This options can also be specified through the |
|
184 | usually $HOME/.ipython. This options can also be specified through the | |
185 |
environment variable IPYTHON |
|
185 | environment variable IPYTHONDIR. | |
186 | .TP |
|
186 | .TP | |
187 | .B \-\-gui=<CaselessStrEnum> (TerminalIPythonApp.gui) |
|
187 | .B \-\-gui=<CaselessStrEnum> (TerminalIPythonApp.gui) | |
188 | Default: None |
|
188 | Default: None |
@@ -95,7 +95,7 b" sequences. You can go to a 'no color' mode by typing '%colors NoColor'." | |||||
95 |
|
95 | |||
96 | You can try using a different terminal emulator program (Emacs users, |
|
96 | You can try using a different terminal emulator program (Emacs users, | |
97 | see below). To permanently set your color preferences, edit the file |
|
97 | see below). To permanently set your color preferences, edit the file | |
98 |
$IPYTHON |
|
98 | $IPYTHONDIR/ipythonrc and set the colors option to the desired value. | |
99 |
|
99 | |||
100 |
|
100 | |||
101 | Object details (types, docstrings, source code, etc.) |
|
101 | Object details (types, docstrings, source code, etc.) |
@@ -284,8 +284,10 b' following algorithm:' | |||||
284 | * If the ``ipython_dir`` command line flag is given, its value is used. |
|
284 | * If the ``ipython_dir`` command line flag is given, its value is used. | |
285 |
|
285 | |||
286 | * If not, the value returned by :func:`IPython.utils.path.get_ipython_dir` |
|
286 | * If not, the value returned by :func:`IPython.utils.path.get_ipython_dir` | |
287 |
is used. This function will first look at the :envvar:`IPYTHON |
|
287 | is used. This function will first look at the :envvar:`IPYTHONDIR` | |
288 | environment variable and then default to a platform-specific default. |
|
288 | environment variable and then default to a platform-specific default. | |
|
289 | Historical support for the :envvar:`IPYTHON_DIR` environment variable will | |||
|
290 | be removed in a future release. | |||
289 |
|
291 | |||
290 | On posix systems (Linux, Unix, etc.), IPython respects the ``$XDG_CONFIG_HOME`` |
|
292 | On posix systems (Linux, Unix, etc.), IPython respects the ``$XDG_CONFIG_HOME`` | |
291 | part of the `XDG Base Directory`_ specification. If ``$XDG_CONFIG_HOME`` is |
|
293 | part of the `XDG Base Directory`_ specification. If ``$XDG_CONFIG_HOME`` is | |
@@ -302,7 +304,7 b' elsewhere.' | |||||
302 | Once the location of the IPython directory has been determined, you need to know |
|
304 | Once the location of the IPython directory has been determined, you need to know | |
303 | which profile you are using. For users with a single configuration, this will |
|
305 | which profile you are using. For users with a single configuration, this will | |
304 | simply be 'default', and will be located in |
|
306 | simply be 'default', and will be located in | |
305 |
:file:`<IPYTHON |
|
307 | :file:`<IPYTHONDIR>/profile_default`. | |
306 |
|
308 | |||
307 | The next thing you need to know is what to call your configuration file. The |
|
309 | The next thing you need to know is what to call your configuration file. The | |
308 | basic idea is that each application has its own default configuration filename. |
|
310 | basic idea is that each application has its own default configuration filename. | |
@@ -344,7 +346,7 b" Let's start by showing how a profile is used:" | |||||
344 | This tells the :command:`ipython` command line program to get its configuration |
|
346 | This tells the :command:`ipython` command line program to get its configuration | |
345 | from the "sympy" profile. The file names for various profiles do not change. The |
|
347 | from the "sympy" profile. The file names for various profiles do not change. The | |
346 | only difference is that profiles are named in a special way. In the case above, |
|
348 | only difference is that profiles are named in a special way. In the case above, | |
347 |
the "sympy" profile means looking for :file:`ipython_config.py` in :file:`<IPYTHON |
|
349 | the "sympy" profile means looking for :file:`ipython_config.py` in :file:`<IPYTHONDIR>/profile_sympy`. | |
348 |
|
350 | |||
349 | The general pattern is this: simply create a new profile with: |
|
351 | The general pattern is this: simply create a new profile with: | |
350 |
|
352 |
@@ -400,9 +400,9 b' generate this key, but the default is just to generate a new UUID. You can gener' | |||||
400 | private key with:: |
|
400 | private key with:: | |
401 |
|
401 | |||
402 | # generate 1024b of random data, and store in a file only you can read: |
|
402 | # generate 1024b of random data, and store in a file only you can read: | |
403 |
# (assumes IPYTHON |
|
403 | # (assumes IPYTHONDIR is defined, otherwise use your IPython directory) | |
404 |
$> python -c "import os; print os.urandom(128).encode('base64')" > $IPYTHON |
|
404 | $> python -c "import os; print os.urandom(128).encode('base64')" > $IPYTHONDIR/sessionkey | |
405 |
$> chmod 600 $IPYTHON |
|
405 | $> chmod 600 $IPYTHONDIR/sessionkey | |
406 |
|
406 | |||
407 | The *contents* of this file will be stored in the JSON connection file, so that file |
|
407 | The *contents* of this file will be stored in the JSON connection file, so that file | |
408 | contains everything you need to connect to and use a kernel. |
|
408 | contains everything you need to connect to and use a kernel. | |
@@ -411,7 +411,7 b' To use this generated key, simply specify the ``Session.keyfile`` configurable' | |||||
411 | in :file:`ipython_config.py` or at the command-line, as in:: |
|
411 | in :file:`ipython_config.py` or at the command-line, as in:: | |
412 |
|
412 | |||
413 | # instruct IPython to sign messages with that key, instead of a new UUID |
|
413 | # instruct IPython to sign messages with that key, instead of a new UUID | |
414 |
$> ipython qtconsole --Session.keyfile=$IPYTHON |
|
414 | $> ipython qtconsole --Session.keyfile=$IPYTHONDIR/sessionkey | |
415 |
|
415 | |||
416 | .. _ssh_tunnels: |
|
416 | .. _ssh_tunnels: | |
417 |
|
417 |
@@ -26,7 +26,7 b' the command line, simply because they are not practical here. Look into' | |||||
26 | your configuration files for details on those. There are separate configuration |
|
26 | your configuration files for details on those. There are separate configuration | |
27 | files for each profile, and the files look like "ipython_config.py" or |
|
27 | files for each profile, and the files look like "ipython_config.py" or | |
28 | "ipython_config_<frontendname>.py". Profile directories look like |
|
28 | "ipython_config_<frontendname>.py". Profile directories look like | |
29 |
"profile_profilename" and are typically installed in the IPYTHON |
|
29 | "profile_profilename" and are typically installed in the IPYTHONDIR directory. | |
30 | For Linux users, this will be $HOME/.config/ipython, and for other users it |
|
30 | For Linux users, this will be $HOME/.config/ipython, and for other users it | |
31 | will be $HOME/.ipython. For Windows users, $HOME resolves to C:\\Documents and |
|
31 | will be $HOME/.ipython. For Windows users, $HOME resolves to C:\\Documents and | |
32 | Settings\\YourUserName in most instances. |
|
32 | Settings\\YourUserName in most instances. | |
@@ -249,7 +249,7 b' Persistent command history across sessions' | |||||
249 |
|
249 | |||
250 | IPython will save your input history when it leaves and reload it next |
|
250 | IPython will save your input history when it leaves and reload it next | |
251 | time you restart it. By default, the history file is named |
|
251 | time you restart it. By default, the history file is named | |
252 |
$IPYTHON |
|
252 | $IPYTHONDIR/profile_<name>/history.sqlite. This allows you to keep | |
253 | separate histories related to various tasks: commands related to |
|
253 | separate histories related to various tasks: commands related to | |
254 | numerical work will not be clobbered by a system shell history, for |
|
254 | numerical work will not be clobbered by a system shell history, for | |
255 | example. |
|
255 | example. |
@@ -26,7 +26,7 b' the "pysh" shortcut in start menu.' | |||||
26 | If you want to use the features of sh profile as your defaults (which |
|
26 | If you want to use the features of sh profile as your defaults (which | |
27 | might be a good idea if you use other profiles a lot of the time but |
|
27 | might be a good idea if you use other profiles a lot of the time but | |
28 | still want the convenience of sh profile), add ``import ipy_profile_sh`` |
|
28 | still want the convenience of sh profile), add ``import ipy_profile_sh`` | |
29 |
to your $IPYTHON |
|
29 | to your $IPYTHONDIR/ipy_user_conf.py. | |
30 |
|
30 | |||
31 | The 'sh' profile is different from the default profile in that: |
|
31 | The 'sh' profile is different from the default profile in that: | |
32 |
|
32 |
@@ -37,7 +37,7 b' module and then create a :class:`.Client` instance:' | |||||
37 | In [2]: rc = Client() |
|
37 | In [2]: rc = Client() | |
38 |
|
38 | |||
39 | This form assumes that the default connection information (stored in |
|
39 | This form assumes that the default connection information (stored in | |
40 |
:file:`ipcontroller-client.json` found in :file:`IPYTHON |
|
40 | :file:`ipcontroller-client.json` found in :file:`IPYTHONDIR/profile_default/security`) is | |
41 | accurate. If the controller was started on a remote machine, you must copy that connection |
|
41 | accurate. If the controller was started on a remote machine, you must copy that connection | |
42 | file to the client machine, or enter its contents as arguments to the Client constructor: |
|
42 | file to the client machine, or enter its contents as arguments to the Client constructor: | |
43 |
|
43 |
@@ -15,4 +15,9 b' Other new features' | |||||
15 | * **%install_ext**: A new magic function to install an IPython extension from |
|
15 | * **%install_ext**: A new magic function to install an IPython extension from | |
16 | a URL. E.g. ``%install_ext https://bitbucket.org/birkenfeld/ipython-physics/raw/d1310a2ab15d/physics.py``. |
|
16 | a URL. E.g. ``%install_ext https://bitbucket.org/birkenfeld/ipython-physics/raw/d1310a2ab15d/physics.py``. | |
17 |
|
17 | |||
|
18 | * The :envvar:`IPYTHON_DIR` environment variable, introduced in the Great | |||
|
19 | Reorganization of 0.11 and existing only in versions 0.11-0.13, has been | |||
|
20 | deprecated. As described in :ghissue:`1167`, the complexity and confusion of | |||
|
21 | migrating to this variable is not worth the aesthetic improvement. Please use | |||
|
22 | the historical :envvar:`IPYTHONDIR` environment variable instead. | |||
18 |
|
23 |
General Comments 0
You need to be logged in to leave comments.
Login now