Show More
@@ -20,6 +20,7 b' from __future__ import with_statement' | |||
|
20 | 20 | import os |
|
21 | 21 | import shutil |
|
22 | 22 | import sys |
|
23 | import warnings | |
|
23 | 24 | |
|
24 | 25 | from twisted.python import log |
|
25 | 26 | |
@@ -27,13 +28,25 b' from IPython.core import release' | |||
|
27 | 28 | from IPython.config.loader import PyFileConfigLoader |
|
28 | 29 | from IPython.core.application import Application |
|
29 | 30 | from IPython.core.component import Component |
|
31 | from IPython.utils.genutils import get_ipython_dir, get_ipython_package_dir | |
|
30 | 32 | from IPython.utils.traitlets import Unicode, Bool |
|
31 | 33 | from IPython.utils import genutils |
|
32 | 34 | |
|
33 | 35 | #----------------------------------------------------------------------------- |
|
34 | # Imports | |
|
36 | # Warnings control | |
|
35 | 37 | #----------------------------------------------------------------------------- |
|
38 | # Twisted generates annoying warnings with Python 2.6, as will do other code | |
|
39 | # that imports 'sets' as of today | |
|
40 | warnings.filterwarnings('ignore', 'the sets module is deprecated', | |
|
41 | DeprecationWarning ) | |
|
36 | 42 | |
|
43 | # This one also comes from Twisted | |
|
44 | warnings.filterwarnings('ignore', 'the sha module is deprecated', | |
|
45 | DeprecationWarning) | |
|
46 | ||
|
47 | #----------------------------------------------------------------------------- | |
|
48 | # Classes and functions | |
|
49 | #----------------------------------------------------------------------------- | |
|
37 | 50 | |
|
38 | 51 | class ClusterDirError(Exception): |
|
39 | 52 | pass |
@@ -352,9 +365,6 b' class ApplicationWithClusterDir(Application):' | |||
|
352 | 365 | self.default_config.Global.cluster_dir = self.cluster_dir |
|
353 | 366 | self.command_line_config.Global.cluster_dir = self.cluster_dir |
|
354 | 367 | |
|
355 | # Set the search path to the cluster directory | |
|
356 | self.config_file_paths = (self.cluster_dir,) | |
|
357 | ||
|
358 | 368 | def find_config_file_name(self): |
|
359 | 369 | """Find the config file name for this application.""" |
|
360 | 370 | # For this type of Application it should be set as a class attribute. |
@@ -362,8 +372,11 b' class ApplicationWithClusterDir(Application):' | |||
|
362 | 372 | self.log.critical("No config filename found") |
|
363 | 373 | |
|
364 | 374 | def find_config_file_paths(self): |
|
365 | # Set the search path to the cluster directory | |
|
366 | self.config_file_paths = (self.cluster_dir,) | |
|
375 | # Include our own config directory last, so that users can still find | |
|
376 | # our shipped copies of builtin config files even if they don't have | |
|
377 | # them in their ipython cluster directory. | |
|
378 | conf_dir = os.path.join(get_ipython_package_dir(), 'config', 'default') | |
|
379 | self.config_file_paths = (self.cluster_dir, conf_dir) | |
|
367 | 380 | |
|
368 | 381 | def pre_construct(self): |
|
369 | 382 | # The log and security dirs were set earlier, but here we put them |
General Comments 0
You need to be logged in to leave comments.
Login now