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