From d59422682e30ab7d784afae63dd5b9766150c8db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Pe=C3=B1a-Castellanos?= Date: Fri, 31 Jul 2015 15:44:10 -0500 Subject: [PATCH 1/3] Reorganize repo: grouped *config.py files inside spyderlib/config/ --- bootstrap.py | 2 +- create_app.py | 4 ++-- spyderlib/config/__init__.py | 0 spyderlib/{baseconfig.py => config/base.py} | 0 spyderlib/{guiconfig.py => config/gui.py} | 6 +++--- .../{ipythonconfig.py => config/ipython.py} | 2 +- spyderlib/{config.py => config/main.py} | 6 +++--- spyderlib/{userconfig.py => config/user.py} | 4 ++-- spyderlib/plugins/__init__.py | 8 ++++---- spyderlib/plugins/configdialog.py | 12 ++++++------ spyderlib/plugins/console.py | 4 ++-- spyderlib/plugins/editor.py | 6 +++--- spyderlib/plugins/explorer.py | 2 +- spyderlib/plugins/externalconsole.py | 4 ++-- spyderlib/plugins/findinfiles.py | 2 +- spyderlib/plugins/history.py | 6 +++--- spyderlib/plugins/inspector.py | 8 ++++---- spyderlib/plugins/ipythonconsole.py | 4 ++-- spyderlib/plugins/layoutdialog.py | 2 +- spyderlib/plugins/onlinehelp.py | 2 +- spyderlib/plugins/outlineexplorer.py | 2 +- spyderlib/plugins/projectexplorer.py | 2 +- spyderlib/plugins/runconfig.py | 4 ++-- spyderlib/plugins/shortcuts.py | 4 ++-- spyderlib/plugins/variableexplorer.py | 4 ++-- spyderlib/plugins/workingdirectory.py | 2 +- spyderlib/restart_app.py | 2 +- spyderlib/rope_patch.py | 4 ++-- spyderlib/spyder.py | 18 +++++++++--------- spyderlib/start_app.py | 5 ++--- spyderlib/tour.py | 2 +- spyderlib/utils/bsdsocket.py | 2 +- spyderlib/utils/codeanalysis.py | 2 +- spyderlib/utils/debug.py | 2 +- spyderlib/utils/environ.py | 2 +- spyderlib/utils/external/__init__.py | 2 +- spyderlib/utils/icon_manager.py | 4 ++-- spyderlib/utils/inspector/__init__.py | 2 +- spyderlib/utils/inspector/conf.py | 2 +- spyderlib/utils/inspector/sphinxify.py | 2 +- spyderlib/utils/introspection/jedi_plugin.py | 2 +- .../utils/introspection/module_completion.py | 2 +- .../utils/introspection/plugin_manager.py | 2 +- spyderlib/utils/introspection/rope_plugin.py | 2 +- spyderlib/utils/iofuncs.py | 4 ++-- spyderlib/utils/programs.py | 2 +- spyderlib/utils/qthelpers.py | 4 ++-- spyderlib/widgets/arraybuilder.py | 3 ++- spyderlib/widgets/arrayeditor.py | 4 ++-- spyderlib/widgets/browser.py | 2 +- spyderlib/widgets/comboboxes.py | 2 +- spyderlib/widgets/dataframeeditor.py | 4 ++-- spyderlib/widgets/dependencies.py | 2 +- spyderlib/widgets/dicteditor.py | 4 ++-- spyderlib/widgets/dicteditorutils.py | 2 +- spyderlib/widgets/editor.py | 6 +++--- spyderlib/widgets/editortools.py | 2 +- spyderlib/widgets/explorer.py | 2 +- spyderlib/widgets/externalshell/baseshell.py | 2 +- .../widgets/externalshell/introspection.py | 2 +- spyderlib/widgets/externalshell/monitor.py | 2 +- .../widgets/externalshell/namespacebrowser.py | 2 +- spyderlib/widgets/externalshell/pythonshell.py | 2 +- .../widgets/externalshell/sitecustomize.py | 4 ++-- .../externalshell/start_ipython_kernel.py | 2 +- spyderlib/widgets/externalshell/systemshell.py | 2 +- spyderlib/widgets/findinfiles.py | 2 +- spyderlib/widgets/findreplace.py | 4 ++-- spyderlib/widgets/formlayout.py | 2 +- spyderlib/widgets/importwizard.py | 2 +- spyderlib/widgets/internalshell.py | 4 ++-- spyderlib/widgets/ipython.py | 8 ++++---- spyderlib/widgets/mixins.py | 2 +- spyderlib/widgets/onecolumntree.py | 2 +- spyderlib/widgets/pathmanager.py | 2 +- spyderlib/widgets/projectexplorer.py | 2 +- spyderlib/widgets/pydocgui.py | 2 +- spyderlib/widgets/shell.py | 8 ++++---- spyderlib/widgets/sourcecode/codeeditor.py | 8 ++++---- .../widgets/sourcecode/syntaxhighlighters.py | 4 ++-- spyderlib/widgets/status.py | 4 ++-- spyderlib/widgets/tabs.py | 4 ++-- spyderlib/widgets/texteditor.py | 4 ++-- spyderlib/workers/updates.py | 2 +- spyderplugins/p_breakpoints.py | 2 +- spyderplugins/p_profiler.py | 2 +- spyderplugins/p_pylint.py | 2 +- spyderplugins/widgets/breakpointsgui.py | 4 ++-- spyderplugins/widgets/profilergui.py | 2 +- spyderplugins/widgets/pylintgui.py | 2 +- 90 files changed, 151 insertions(+), 151 deletions(-) create mode 100644 spyderlib/config/__init__.py rename spyderlib/{baseconfig.py => config/base.py} (100%) rename spyderlib/{guiconfig.py => config/gui.py} (97%) rename spyderlib/{ipythonconfig.py => config/ipython.py} (96%) rename spyderlib/{config.py => config/main.py} (97%) rename spyderlib/{userconfig.py => config/user.py} (96%) diff --git a/bootstrap.py b/bootstrap.py index 09e81c02ad9..448c4734a1b 100755 --- a/bootstrap.py +++ b/bootstrap.py @@ -133,7 +133,7 @@ if options.debug: # safety check - Spyder config should not be imported at this point - if "spyderlib.baseconfig" in sys.modules: + if "spyderlib.config.base" in sys.modules: sys.exit("ERROR: Can't enable debug mode - Spyder is already imported") print("0x. Switching debug mode on") os.environ["SPYDER_DEBUG"] = "True" diff --git a/create_app.py b/create_app.py index dee0bd2aaba..2819f18cb77 100644 --- a/create_app.py +++ b/create_app.py @@ -27,8 +27,8 @@ from IPython.core.completerlib import module_list from spyderlib import __version__ as spy_version -from spyderlib.config import EDIT_EXT -from spyderlib.baseconfig import MAC_APP_NAME +from spyderlib.config.main import EDIT_EXT +from spyderlib.config.base import MAC_APP_NAME from spyderlib.utils.programs import find_program diff --git a/spyderlib/config/__init__.py b/spyderlib/config/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/spyderlib/baseconfig.py b/spyderlib/config/base.py similarity index 100% rename from spyderlib/baseconfig.py rename to spyderlib/config/base.py diff --git a/spyderlib/guiconfig.py b/spyderlib/config/gui.py similarity index 97% rename from spyderlib/guiconfig.py rename to spyderlib/config/gui.py index 7e68d94b0fe..511160348d5 100644 --- a/spyderlib/guiconfig.py +++ b/spyderlib/config/gui.py @@ -6,7 +6,7 @@ """ Spyder GUI-related configuration management -(for non-GUI configuration, see spyderlib/baseconfig.py) +(for non-GUI configuration, see spyderlib/config/base.py) Important note regarding shortcuts: For compatibility with QWERTZ keyboards, one must avoid using the following @@ -19,8 +19,8 @@ from spyderlib.qt.QtGui import QFont, QFontDatabase, QShortcut, QKeySequence from spyderlib.qt.QtCore import Qt -from spyderlib.config import CONF -from spyderlib.userconfig import NoDefault +from spyderlib.config.main import CONF +from spyderlib.config.user import NoDefault from spyderlib.widgets.sourcecode import syntaxhighlighters as sh from spyderlib.py3compat import to_text_string diff --git a/spyderlib/ipythonconfig.py b/spyderlib/config/ipython.py similarity index 96% rename from spyderlib/ipythonconfig.py rename to spyderlib/config/ipython.py index d76090abbee..5fa48280784 100644 --- a/spyderlib/ipythonconfig.py +++ b/spyderlib/config/ipython.py @@ -10,7 +10,7 @@ from spyderlib.utils import programs from spyderlib import dependencies -from spyderlib.baseconfig import _ +from spyderlib.config.base import _ IPYTHON_REQVER = '>=3.0' diff --git a/spyderlib/config.py b/spyderlib/config/main.py similarity index 97% rename from spyderlib/config.py rename to spyderlib/config/main.py index 67f1404af3b..9ebb55043b3 100644 --- a/spyderlib/config.py +++ b/spyderlib/config/main.py @@ -16,9 +16,9 @@ import os.path as osp # Local import -from spyderlib.userconfig import UserConfig -from spyderlib.baseconfig import (CHECK_ALL, EXCLUDED_NAMES, SUBFOLDER, - get_home_dir, _) +from spyderlib.config.user import UserConfig +from spyderlib.config.base import (CHECK_ALL, EXCLUDED_NAMES, SUBFOLDER, + get_home_dir, _) from spyderlib.utils import iofuncs, codeanalysis diff --git a/spyderlib/userconfig.py b/spyderlib/config/user.py similarity index 96% rename from spyderlib/userconfig.py rename to spyderlib/config/user.py index 7d97e997b36..6034fec580a 100644 --- a/spyderlib/userconfig.py +++ b/spyderlib/config/user.py @@ -22,8 +22,8 @@ # Local imports from spyderlib import __version__ -from spyderlib.baseconfig import (DEV, TEST, get_module_source_path, - get_home_dir) +from spyderlib.config.base import (DEV, TEST, get_module_source_path, + get_home_dir) from spyderlib.utils.programs import check_version from spyderlib.py3compat import configparser as cp from spyderlib.py3compat import PY2, is_text_string, to_text_string diff --git a/spyderlib/plugins/__init__.py b/spyderlib/plugins/__init__.py index cbd3248f197..c5f93bfbaff 100644 --- a/spyderlib/plugins/__init__.py +++ b/spyderlib/plugins/__init__.py @@ -28,10 +28,10 @@ # Local imports from spyderlib.utils.qthelpers import toggle_actions, get_icon, create_action -from spyderlib.baseconfig import _ -from spyderlib.config import CONF -from spyderlib.userconfig import NoDefault -from spyderlib.guiconfig import get_font, set_font +from spyderlib.config.base import _ +from spyderlib.config.main import CONF +from spyderlib.config.user import NoDefault +from spyderlib.config.gui import get_font, set_font from spyderlib.plugins.configdialog import SpyderConfigPage from spyderlib.py3compat import configparser, is_text_string diff --git a/spyderlib/plugins/configdialog.py b/spyderlib/plugins/configdialog.py index 8dfc026b839..907255db415 100644 --- a/spyderlib/plugins/configdialog.py +++ b/spyderlib/plugins/configdialog.py @@ -22,12 +22,12 @@ getexistingdirectory, getopenfilename) import spyderlib.utils.icon_manager as ima -from spyderlib.baseconfig import (_, running_in_mac_app, LANGUAGE_CODES, - save_lang_conf, load_lang_conf) -from spyderlib.config import CONF -from spyderlib.guiconfig import (CUSTOM_COLOR_SCHEME_NAME, - set_default_color_scheme) -from spyderlib.userconfig import NoDefault +from spyderlib.config.base import (_, running_in_mac_app, LANGUAGE_CODES, + save_lang_conf, load_lang_conf) +from spyderlib.config.main import CONF +from spyderlib.config.gui import (CUSTOM_COLOR_SCHEME_NAME, + set_default_color_scheme) +from spyderlib.config.user import NoDefault from spyderlib.widgets.colors import ColorLayout from spyderlib.widgets.sourcecode import syntaxhighlighters as sh from spyderlib.py3compat import to_text_string, is_text_string, getcwd diff --git a/spyderlib/plugins/console.py b/spyderlib/plugins/console.py index d5191a26f1c..7b45f564e75 100644 --- a/spyderlib/plugins/console.py +++ b/spyderlib/plugins/console.py @@ -24,8 +24,8 @@ # Local imports -from spyderlib.baseconfig import _, debug_print -from spyderlib.config import CONF +from spyderlib.config.base import _, debug_print +from spyderlib.config.main import CONF from spyderlib.utils.misc import get_error_match, remove_backslashes from spyderlib.utils.qthelpers import (create_action, add_actions, mimedata2url, DialogManager) diff --git a/spyderlib/plugins/editor.py b/spyderlib/plugins/editor.py index 6b81cdcd1aa..1de6d57a934 100644 --- a/spyderlib/plugins/editor.py +++ b/spyderlib/plugins/editor.py @@ -30,9 +30,9 @@ # Local imports from spyderlib.utils import encoding, sourcecode, codeanalysis -from spyderlib.baseconfig import get_conf_path, _ -from spyderlib.config import CONF, EDIT_FILTERS, get_filter, EDIT_FILETYPES -from spyderlib.guiconfig import get_color_scheme +from spyderlib.config.base import get_conf_path, _ +from spyderlib.config.main import CONF, EDIT_FILTERS, get_filter, EDIT_FILETYPES +from spyderlib.config.gui import get_color_scheme from spyderlib.utils import programs from spyderlib.utils.qthelpers import (create_action, add_actions, get_filetype_icon, add_shortcut_to_tooltip) diff --git a/spyderlib/plugins/explorer.py b/spyderlib/plugins/explorer.py index e0778c28890..4a92f1b1ec1 100644 --- a/spyderlib/plugins/explorer.py +++ b/spyderlib/plugins/explorer.py @@ -18,7 +18,7 @@ import os.path as osp # Local imports -from spyderlib.baseconfig import _ +from spyderlib.config.base import _ from spyderlib.utils.qthelpers import create_action from spyderlib.widgets.explorer import ExplorerWidget from spyderlib.plugins import SpyderPluginMixin diff --git a/spyderlib/plugins/externalconsole.py b/spyderlib/plugins/externalconsole.py index 8c81ee94404..0aeca22dd16 100644 --- a/spyderlib/plugins/externalconsole.py +++ b/spyderlib/plugins/externalconsole.py @@ -29,8 +29,8 @@ import subprocess # Local imports -from spyderlib.baseconfig import SCIENTIFIC_STARTUP, running_in_mac_app, _ -from spyderlib.config import CONF +from spyderlib.config.base import SCIENTIFIC_STARTUP, running_in_mac_app, _ +from spyderlib.config.main import CONF from spyderlib.utils import encoding, programs from spyderlib.utils.misc import (get_error_match, get_python_executable, remove_backslashes, is_python_script) diff --git a/spyderlib/plugins/findinfiles.py b/spyderlib/plugins/findinfiles.py index f71974c29f0..621ee86b00f 100644 --- a/spyderlib/plugins/findinfiles.py +++ b/spyderlib/plugins/findinfiles.py @@ -16,7 +16,7 @@ import spyderlib.utils.icon_manager as ima # Local imports -from spyderlib.baseconfig import _ +from spyderlib.config.base import _ from spyderlib.utils.qthelpers import create_action from spyderlib.widgets.findinfiles import FindInFilesWidget from spyderlib.plugins import SpyderPluginMixin diff --git a/spyderlib/plugins/history.py b/spyderlib/plugins/history.py index 5b54a87de9c..9422d4f6aa1 100644 --- a/spyderlib/plugins/history.py +++ b/spyderlib/plugins/history.py @@ -18,9 +18,9 @@ # Local imports from spyderlib.utils import encoding -from spyderlib.baseconfig import _ -from spyderlib.config import CONF -from spyderlib.guiconfig import get_color_scheme +from spyderlib.config.base import _ +from spyderlib.config.main import CONF +from spyderlib.config.gui import get_color_scheme from spyderlib.utils.qthelpers import (create_action, create_toolbutton, add_actions) from spyderlib.widgets.tabs import Tabs from spyderlib.widgets.sourcecode import codeeditor diff --git a/spyderlib/plugins/inspector.py b/spyderlib/plugins/inspector.py index 08b17ee4773..4d985bde593 100644 --- a/spyderlib/plugins/inspector.py +++ b/spyderlib/plugins/inspector.py @@ -22,10 +22,10 @@ # Local imports from spyderlib import dependencies -from spyderlib.baseconfig import get_conf_path, get_module_source_path, _ -from spyderlib.ipythonconfig import IPYTHON_QT_INSTALLED -from spyderlib.config import CONF -from spyderlib.guiconfig import get_color_scheme, get_font, set_font +from spyderlib.config.base import get_conf_path, get_module_source_path, _ +from spyderlib.config.ipython import IPYTHON_QT_INSTALLED +from spyderlib.config.main import CONF +from spyderlib.config.gui import get_color_scheme, get_font, set_font from spyderlib.utils import programs from spyderlib.utils.qthelpers import (create_toolbutton, add_actions, create_action) diff --git a/spyderlib/plugins/ipythonconsole.py b/spyderlib/plugins/ipythonconsole.py index 0b77949c1c5..15fb4065c60 100644 --- a/spyderlib/plugins/ipythonconsole.py +++ b/spyderlib/plugins/ipythonconsole.py @@ -46,8 +46,8 @@ # Local imports from spyderlib import dependencies -from spyderlib.baseconfig import _ -from spyderlib.config import CONF +from spyderlib.config.base import _ +from spyderlib.config.main import CONF from spyderlib.utils.misc import get_error_match, remove_backslashes from spyderlib.utils import programs from spyderlib.utils.qthelpers import create_action diff --git a/spyderlib/plugins/layoutdialog.py b/spyderlib/plugins/layoutdialog.py index d0394f0d21f..41771cf0649 100644 --- a/spyderlib/plugins/layoutdialog.py +++ b/spyderlib/plugins/layoutdialog.py @@ -8,7 +8,7 @@ import sys -from spyderlib.baseconfig import _ +from spyderlib.config.base import _ from spyderlib.qt.QtGui import (QVBoxLayout, QHBoxLayout, QDialogButtonBox, QGroupBox, QComboBox, QPushButton, QDialog, diff --git a/spyderlib/plugins/onlinehelp.py b/spyderlib/plugins/onlinehelp.py index c7732f948e6..5f9bd053463 100644 --- a/spyderlib/plugins/onlinehelp.py +++ b/spyderlib/plugins/onlinehelp.py @@ -11,7 +11,7 @@ import os.path as osp # Local imports -from spyderlib.baseconfig import get_conf_path, _ +from spyderlib.config.base import get_conf_path, _ from spyderlib.widgets.pydocgui import PydocBrowser from spyderlib.plugins import SpyderPluginMixin from spyderlib.py3compat import to_text_string diff --git a/spyderlib/plugins/outlineexplorer.py b/spyderlib/plugins/outlineexplorer.py index 5be8a69d431..472236298e0 100644 --- a/spyderlib/plugins/outlineexplorer.py +++ b/spyderlib/plugins/outlineexplorer.py @@ -14,7 +14,7 @@ from spyderlib.qt.QtCore import Signal # Local imports -from spyderlib.baseconfig import _ +from spyderlib.config.base import _ from spyderlib.widgets.editortools import OutlineExplorerWidget from spyderlib.plugins import SpyderPluginMixin from spyderlib.py3compat import is_text_string diff --git a/spyderlib/plugins/projectexplorer.py b/spyderlib/plugins/projectexplorer.py index e9eba0c4655..83b93daeff8 100644 --- a/spyderlib/plugins/projectexplorer.py +++ b/spyderlib/plugins/projectexplorer.py @@ -11,7 +11,7 @@ import spyderlib.utils.icon_manager as ima # Local imports -from spyderlib.baseconfig import _ +from spyderlib.config.base import _ from spyderlib.utils.qthelpers import create_action from spyderlib.widgets.projectexplorer import ProjectExplorerWidget from spyderlib.plugins import SpyderPluginMixin diff --git a/spyderlib/plugins/runconfig.py b/spyderlib/plugins/runconfig.py index 54cb31e19cc..568bef048b4 100644 --- a/spyderlib/plugins/runconfig.py +++ b/spyderlib/plugins/runconfig.py @@ -19,8 +19,8 @@ import os.path as osp # Local imports -from spyderlib.baseconfig import _ -from spyderlib.config import CONF +from spyderlib.config.base import _ +from spyderlib.config.main import CONF from spyderlib.plugins.configdialog import GeneralConfigPage from spyderlib.py3compat import to_text_string, getcwd diff --git a/spyderlib/plugins/shortcuts.py b/spyderlib/plugins/shortcuts.py index d8e9f26df44..a6fd8ed21a9 100644 --- a/spyderlib/plugins/shortcuts.py +++ b/spyderlib/plugins/shortcuts.py @@ -21,8 +21,8 @@ from spyderlib.qt.compat import to_qvariant, from_qvariant # Local imports -from spyderlib.baseconfig import _, debug_print -from spyderlib.guiconfig import (get_shortcut, set_shortcut, +from spyderlib.config.base import _, debug_print +from spyderlib.config.gui import (get_shortcut, set_shortcut, iter_shortcuts, reset_shortcuts) from spyderlib.plugins.configdialog import GeneralConfigPage from spyderlib.utils import icon_manager as ima diff --git a/spyderlib/plugins/variableexplorer.py b/spyderlib/plugins/variableexplorer.py index de9a38a6ca4..7bd81bea4be 100644 --- a/spyderlib/plugins/variableexplorer.py +++ b/spyderlib/plugins/variableexplorer.py @@ -11,8 +11,8 @@ import spyderlib.utils.icon_manager as ima # Local imports -from spyderlib.baseconfig import _ -from spyderlib.config import CONF +from spyderlib.config.base import _ +from spyderlib.config.main import CONF from spyderlib.utils import programs from spyderlib.plugins import SpyderPluginMixin, PluginConfigPage from spyderlib.widgets.externalshell.monitor import REMOTE_SETTINGS diff --git a/spyderlib/plugins/workingdirectory.py b/spyderlib/plugins/workingdirectory.py index c0dcb34c88a..eec6e82ef82 100644 --- a/spyderlib/plugins/workingdirectory.py +++ b/spyderlib/plugins/workingdirectory.py @@ -23,7 +23,7 @@ # Local imports from spyderlib.utils import encoding -from spyderlib.baseconfig import get_conf_path, _ +from spyderlib.config.base import get_conf_path, _ from spyderlib.utils.qthelpers import create_action # Package local imports diff --git a/spyderlib/restart_app.py b/spyderlib/restart_app.py index 855728d3706..28e866c174c 100644 --- a/spyderlib/restart_app.py +++ b/spyderlib/restart_app.py @@ -20,7 +20,7 @@ import time -from spyderlib.baseconfig import _, get_image_path +from spyderlib.config.base import _, get_image_path from spyderlib.py3compat import to_text_string from spyderlib.qt.QtCore import Qt, QTimer from spyderlib.qt.QtGui import (QColor, QMessageBox, QPixmap, QSplashScreen, diff --git a/spyderlib/rope_patch.py b/spyderlib/rope_patch.py index 0ac3ab64a44..6c441d03d65 100644 --- a/spyderlib/rope_patch.py +++ b/spyderlib/rope_patch.py @@ -37,13 +37,13 @@ def apply(): # [1] Patching project.Project for compatibility with py2exe/cx_Freeze # distributions - from spyderlib.baseconfig import is_py2exe_or_cx_Freeze + from spyderlib.config.base import is_py2exe_or_cx_Freeze if is_py2exe_or_cx_Freeze(): from rope.base import project class PatchedProject(project.Project): def _default_config(self): # py2exe/cx_Freeze distribution - from spyderlib.baseconfig import get_module_source_path + from spyderlib.config.base import get_module_source_path fname = get_module_source_path('spyderlib', 'default_config.py') return open(fname, 'rb').read() diff --git a/spyderlib/spyder.py b/spyderlib/spyder.py index 9b7d16c7e74..b89a560f1ae 100644 --- a/spyderlib/spyder.py +++ b/spyderlib/spyder.py @@ -103,7 +103,7 @@ #============================================================================== # Create splash screen out of MainWindow to reduce perceived startup time. #============================================================================== -from spyderlib.baseconfig import _, get_image_path, DEV +from spyderlib.config.base import _, get_image_path, DEV SPLASH = QSplashScreen(QPixmap(get_image_path('splash.png'), 'png')) SPLASH_FONT = SPLASH.font() SPLASH_FONT.setPixelSize(10) @@ -118,15 +118,15 @@ # Local utility imports #============================================================================== from spyderlib import __version__, __project_url__, __forum_url__, get_versions -from spyderlib.baseconfig import (get_conf_path, get_module_data_path, - get_module_source_path, STDERR, DEBUG, - debug_print, TEST, SUBFOLDER, MAC_APP_NAME, - running_in_mac_app, get_module_path) -from spyderlib.config import CONF, EDIT_EXT, IMPORT_EXT, OPEN_FILES_PORT +from spyderlib.config.base import (get_conf_path, get_module_data_path, + get_module_source_path, STDERR, DEBUG, + debug_print, TEST, SUBFOLDER, MAC_APP_NAME, + running_in_mac_app, get_module_path) +from spyderlib.config.main import CONF, EDIT_EXT, IMPORT_EXT, OPEN_FILES_PORT from spyderlib.cli_options import get_options from spyderlib import dependencies -from spyderlib.ipythonconfig import IPYTHON_QT_INSTALLED -from spyderlib.userconfig import NoDefault +from spyderlib.config.ipython import IPYTHON_QT_INSTALLED +from spyderlib.config.user import NoDefault from spyderlib.utils import encoding, programs from spyderlib.utils.iofuncs import load_session, save_session, reset_session from spyderlib.utils.programs import is_module_installed @@ -153,7 +153,7 @@ create_program_action, DialogManager, keybinding, create_python_script_action, file_uri) -from spyderlib.guiconfig import get_shortcut, remove_deprecated_shortcuts +from spyderlib.config.gui import get_shortcut, remove_deprecated_shortcuts from spyderlib.otherplugins import get_spyderplugins_mods from spyderlib import tour # FIXME: Better place for this? diff --git a/spyderlib/start_app.py b/spyderlib/start_app.py index 95517952c3b..3b5735b7998 100644 --- a/spyderlib/start_app.py +++ b/spyderlib/start_app.py @@ -11,9 +11,8 @@ # Local imports from spyderlib.cli_options import get_options -from spyderlib.baseconfig import get_conf_path, running_in_mac_app -from spyderlib.config import CONF -from spyderlib.baseconfig import DEV, TEST +from spyderlib.config.base import get_conf_path, running_in_mac_app, DEV, TEST +from spyderlib.config.main import CONF from spyderlib.utils.external import lockfile from spyderlib.py3compat import is_unicode diff --git a/spyderlib/tour.py b/spyderlib/tour.py index 157fc0f18f3..b1ea86fb16d 100644 --- a/spyderlib/tour.py +++ b/spyderlib/tour.py @@ -25,7 +25,7 @@ QPropertyAnimation, QEasingCurve) # Local import -from spyderlib.baseconfig import _, get_image_path +from spyderlib.config.base import _, get_image_path from spyderlib.utils.qthelpers import (create_action, add_actions) # FIXME: Known issues diff --git a/spyderlib/utils/bsdsocket.py b/spyderlib/utils/bsdsocket.py index 810276ffa6d..064bcf4bb8e 100644 --- a/spyderlib/utils/bsdsocket.py +++ b/spyderlib/utils/bsdsocket.py @@ -18,7 +18,7 @@ import traceback # Local imports -from spyderlib.baseconfig import DEBUG, STDERR +from spyderlib.config.base import DEBUG, STDERR DEBUG_EDITOR = DEBUG >= 3 from spyderlib.py3compat import pickle PICKLE_HIGHEST_PROTOCOL = 2 diff --git a/spyderlib/utils/codeanalysis.py b/spyderlib/utils/codeanalysis.py index 9bac468a47b..7063d91a5a7 100644 --- a/spyderlib/utils/codeanalysis.py +++ b/spyderlib/utils/codeanalysis.py @@ -16,7 +16,7 @@ import traceback # Local import -from spyderlib.baseconfig import _, DEBUG +from spyderlib.config.base import _, DEBUG from spyderlib.utils import programs, encoding from spyderlib.py3compat import to_text_string, to_binary_string, PY3 from spyderlib import dependencies diff --git a/spyderlib/utils/debug.py b/spyderlib/utils/debug.py index 4ef55382b22..86af2423a5d 100644 --- a/spyderlib/utils/debug.py +++ b/spyderlib/utils/debug.py @@ -9,7 +9,7 @@ """ Debug utilities that are independent of Spyder code. -See spyderlib.baseconfig for other helpers. +See spyderlib.config.base for other helpers. """ from __future__ import print_function diff --git a/spyderlib/utils/environ.py b/spyderlib/utils/environ.py index d7f79bd7796..89eb6cb10ef 100644 --- a/spyderlib/utils/environ.py +++ b/spyderlib/utils/environ.py @@ -14,7 +14,7 @@ import os # Local imports -from spyderlib.baseconfig import _ +from spyderlib.config.base import _ from spyderlib.widgets.dicteditor import DictEditor diff --git a/spyderlib/utils/external/__init__.py b/spyderlib/utils/external/__init__.py index b80995e55a7..0f2afcf59c2 100644 --- a/spyderlib/utils/external/__init__.py +++ b/spyderlib/utils/external/__init__.py @@ -19,7 +19,7 @@ if os.name == 'nt': import os.path as osp import sys - from spyderlib.baseconfig import get_module_source_path + from spyderlib.config.base import get_module_source_path dirname = get_module_source_path(__name__) if osp.isdir(osp.join(dirname, 'rope')): diff --git a/spyderlib/utils/icon_manager.py b/spyderlib/utils/icon_manager.py index 7c793b2122d..6c9b13b10b5 100644 --- a/spyderlib/utils/icon_manager.py +++ b/spyderlib/utils/icon_manager.py @@ -1,7 +1,7 @@ import os from spyderlib.external import qtawesome as qta -from spyderlib.baseconfig import get_image_path -from spyderlib.config import CONF +from spyderlib.config.base import get_image_path +from spyderlib.config.main import CONF from spyderlib.qt.QtGui import QIcon, QWidget, QStyle diff --git a/spyderlib/utils/inspector/__init__.py b/spyderlib/utils/inspector/__init__.py index 1e94792958c..f83a57d3b2c 100644 --- a/spyderlib/utils/inspector/__init__.py +++ b/spyderlib/utils/inspector/__init__.py @@ -12,5 +12,5 @@ """ import sys -from spyderlib.baseconfig import get_module_source_path +from spyderlib.config.base import get_module_source_path sys.path.insert(0, get_module_source_path(__name__)) \ No newline at end of file diff --git a/spyderlib/utils/inspector/conf.py b/spyderlib/utils/inspector/conf.py index 36515faac8a..a1069e24212 100644 --- a/spyderlib/utils/inspector/conf.py +++ b/spyderlib/utils/inspector/conf.py @@ -10,7 +10,7 @@ from sphinx import __version__ as sphinx_version # Local imports -from spyderlib.config import CONF +from spyderlib.config.config import CONF from spyderlib.py3compat import u #============================================================================== diff --git a/spyderlib/utils/inspector/sphinxify.py b/spyderlib/utils/inspector/sphinxify.py index 4d47ed38a7c..19f985a750a 100644 --- a/spyderlib/utils/inspector/sphinxify.py +++ b/spyderlib/utils/inspector/sphinxify.py @@ -32,7 +32,7 @@ from sphinx.application import Sphinx # Local imports -from spyderlib.baseconfig import (_, get_module_data_path, +from spyderlib.config.base import (_, get_module_data_path, get_module_source_path) from spyderlib.utils import encoding diff --git a/spyderlib/utils/introspection/jedi_plugin.py b/spyderlib/utils/introspection/jedi_plugin.py index f8cdb34d492..808e08ef789 100644 --- a/spyderlib/utils/introspection/jedi_plugin.py +++ b/spyderlib/utils/introspection/jedi_plugin.py @@ -14,7 +14,7 @@ import threading from spyderlib import dependencies -from spyderlib.baseconfig import _, debug_print +from spyderlib.config.base import _, debug_print from spyderlib.utils import programs from spyderlib.utils.debug import log_last_error, log_dt from spyderlib.utils.dochelpers import getsignaturefromtext diff --git a/spyderlib/utils/introspection/module_completion.py b/spyderlib/utils/introspection/module_completion.py index 589a84207d6..1d92fc601ac 100644 --- a/spyderlib/utils/introspection/module_completion.py +++ b/spyderlib/utils/introspection/module_completion.py @@ -27,7 +27,7 @@ import sys from zipimport import zipimporter -from spyderlib.baseconfig import get_conf_path, running_in_mac_app +from spyderlib.config.base import get_conf_path, running_in_mac_app from spyderlib.utils.external.pickleshare import PickleShareDB #----------------------------------------------------------------------------- diff --git a/spyderlib/utils/introspection/plugin_manager.py b/spyderlib/utils/introspection/plugin_manager.py index b49802b2e1c..a5b0c2de7b2 100644 --- a/spyderlib/utils/introspection/plugin_manager.py +++ b/spyderlib/utils/introspection/plugin_manager.py @@ -14,7 +14,7 @@ import imp import time -from spyderlib.baseconfig import DEBUG, get_conf_path, debug_print +from spyderlib.config.base import DEBUG, get_conf_path, debug_print from spyderlib.utils.introspection.module_completion import ( get_preferred_submodules) from spyderlib.utils import sourcecode diff --git a/spyderlib/utils/introspection/rope_plugin.py b/spyderlib/utils/introspection/rope_plugin.py index a9dce037b88..563847e695b 100644 --- a/spyderlib/utils/introspection/rope_plugin.py +++ b/spyderlib/utils/introspection/rope_plugin.py @@ -11,7 +11,7 @@ import time from spyderlib import dependencies -from spyderlib.baseconfig import get_conf_path, _, STDERR +from spyderlib.config.base import get_conf_path, _, STDERR from spyderlib.utils import encoding, programs from spyderlib.py3compat import PY2 from spyderlib.utils.dochelpers import getsignaturefromtext diff --git a/spyderlib/utils/iofuncs.py b/spyderlib/utils/iofuncs.py index 7e30d3e32fa..2fe18feb78d 100644 --- a/spyderlib/utils/iofuncs.py +++ b/spyderlib/utils/iofuncs.py @@ -358,7 +358,7 @@ def load_dictionary(filename): return data, error_message -from spyderlib.baseconfig import get_conf_path, STDERR +from spyderlib.config.base import get_conf_path, STDERR SAVED_CONFIG_FILES = ('inspector', 'onlinehelp', 'path', 'pylint.results', 'spyder.ini', 'temp.py', 'temp.spydata', 'template.py', @@ -448,7 +448,7 @@ def load_session(filename): return error_message -from spyderlib.baseconfig import _ +from spyderlib.config.base import _ class IOFunctions(object): def __init__(self): diff --git a/spyderlib/utils/programs.py b/spyderlib/utils/programs.py index 5a383630ce4..f3336d8b69f 100644 --- a/spyderlib/utils/programs.py +++ b/spyderlib/utils/programs.py @@ -171,7 +171,7 @@ def run_python_script_in_terminal(fname, wdir, args, interact, subprocess.Popen(cmd, shell=True, cwd=wdir) except WindowsError: from spyderlib.qt.QtGui import QMessageBox - from spyderlib.baseconfig import _ + from spyderlib.config.base import _ QMessageBox.critical(None, _('Run'), _("It was not possible to run this file in " "an external terminal"), diff --git a/spyderlib/utils/qthelpers.py b/spyderlib/utils/qthelpers.py index 9efa5803f64..0d3de2b42a9 100644 --- a/spyderlib/utils/qthelpers.py +++ b/spyderlib/utils/qthelpers.py @@ -22,8 +22,8 @@ import sys # Local import -from spyderlib.baseconfig import get_image_path, running_in_mac_app -from spyderlib.guiconfig import get_shortcut +from spyderlib.config.base import get_image_path, running_in_mac_app +from spyderlib.config.gui import get_shortcut from spyderlib.utils import programs from spyderlib.py3compat import is_text_string, to_text_string diff --git a/spyderlib/widgets/arraybuilder.py b/spyderlib/widgets/arraybuilder.py index 9602461c2bb..443d2d85bb5 100644 --- a/spyderlib/widgets/arraybuilder.py +++ b/spyderlib/widgets/arraybuilder.py @@ -14,6 +14,7 @@ # -Use the same font as editor/console? from __future__ import division + import re from spyderlib.qt.QtCore import (QEvent, QPoint, Qt) @@ -21,7 +22,7 @@ QTableWidgetItem, QToolButton, QToolTip, QWidget) -from spyderlib.baseconfig import _ +from spyderlib.config.base import _ from spyderlib.utils import icon_manager as ima from spyderlib.widgets.helperwidgets import HelperToolButton diff --git a/spyderlib/widgets/arrayeditor.py b/spyderlib/widgets/arrayeditor.py index ce81bfaf455..6c111828a40 100644 --- a/spyderlib/widgets/arrayeditor.py +++ b/spyderlib/widgets/arrayeditor.py @@ -29,8 +29,8 @@ import numpy as np # Local imports -from spyderlib.baseconfig import _ -from spyderlib.guiconfig import get_font, new_shortcut +from spyderlib.config.base import _ +from spyderlib.config.gui import get_font, new_shortcut from spyderlib.utils.qthelpers import (add_actions, create_action, keybinding, qapplication) from spyderlib.py3compat import io, to_text_string, is_text_string diff --git a/spyderlib/widgets/browser.py b/spyderlib/widgets/browser.py index f3eb90e8edc..35e14f4451e 100644 --- a/spyderlib/widgets/browser.py +++ b/spyderlib/widgets/browser.py @@ -14,7 +14,7 @@ from spyderlib.qt.QtWebKit import QWebView, QWebPage, QWebSettings # Local imports -from spyderlib.baseconfig import DEV, _ +from spyderlib.config.base import DEV, _ from spyderlib.utils.qthelpers import (create_action, add_actions, create_toolbutton, action2button) from spyderlib.utils import icon_manager as ima diff --git a/spyderlib/widgets/comboboxes.py b/spyderlib/widgets/comboboxes.py index 0a6a9cffa17..4288184af6f 100644 --- a/spyderlib/widgets/comboboxes.py +++ b/spyderlib/widgets/comboboxes.py @@ -18,7 +18,7 @@ import os.path as osp # Local imports -from spyderlib.baseconfig import _ +from spyderlib.config.base import _ from spyderlib.py3compat import to_text_string diff --git a/spyderlib/widgets/dataframeeditor.py b/spyderlib/widgets/dataframeeditor.py index 0196fc5417b..d8d769d2348 100644 --- a/spyderlib/widgets/dataframeeditor.py +++ b/spyderlib/widgets/dataframeeditor.py @@ -23,8 +23,8 @@ from spyderlib.utils.qthelpers import (qapplication, create_action, add_actions, keybinding) -from spyderlib.baseconfig import _ -from spyderlib.guiconfig import get_font, new_shortcut +from spyderlib.config.base import _ +from spyderlib.config.gui import get_font, new_shortcut from spyderlib.py3compat import io, is_text_string, to_text_string, PY2 from spyderlib.utils import encoding from spyderlib.widgets.arrayeditor import get_idx_rect diff --git a/spyderlib/widgets/dependencies.py b/spyderlib/widgets/dependencies.py index ff0e36ff6d0..c7bb54ce0f0 100644 --- a/spyderlib/widgets/dependencies.py +++ b/spyderlib/widgets/dependencies.py @@ -15,7 +15,7 @@ import sys # Local imports -from spyderlib.baseconfig import _ +from spyderlib.config.base import _ from spyderlib import __version__ diff --git a/spyderlib/widgets/dicteditor.py b/spyderlib/widgets/dicteditor.py index f92defa1bcf..327e1ab7331 100644 --- a/spyderlib/widgets/dicteditor.py +++ b/spyderlib/widgets/dicteditor.py @@ -32,8 +32,8 @@ import datetime # Local import -from spyderlib.baseconfig import _ -from spyderlib.guiconfig import get_font +from spyderlib.config.base import _ +from spyderlib.config.gui import get_font from spyderlib.utils.misc import fix_reference_name from spyderlib.utils.qthelpers import add_actions, create_action, qapplication from spyderlib.widgets.dicteditorutils import (sort_against, get_size, diff --git a/spyderlib/widgets/dicteditorutils.py b/spyderlib/widgets/dicteditorutils.py index 9aab19d9c16..73ee3514cef 100644 --- a/spyderlib/widgets/dicteditorutils.py +++ b/spyderlib/widgets/dicteditorutils.py @@ -18,7 +18,7 @@ PY2) from spyderlib.utils import programs from spyderlib import dependencies -from spyderlib.baseconfig import _ +from spyderlib.config.base import _ class FakeObject(object): diff --git a/spyderlib/widgets/editor.py b/spyderlib/widgets/editor.py index 26925793c01..1408c3aa5a2 100644 --- a/spyderlib/widgets/editor.py +++ b/spyderlib/widgets/editor.py @@ -31,9 +31,9 @@ # Local imports from spyderlib.utils import encoding, sourcecode, codeanalysis from spyderlib.utils import introspection -from spyderlib.baseconfig import _, DEBUG, STDOUT, STDERR -from spyderlib.config import EDIT_FILTERS, EDIT_EXT, get_filter, EDIT_FILETYPES -from spyderlib.guiconfig import create_shortcut, new_shortcut +from spyderlib.config.base import _, DEBUG, STDOUT, STDERR +from spyderlib.config.main import EDIT_FILTERS, EDIT_EXT, get_filter, EDIT_FILETYPES +from spyderlib.config.gui import create_shortcut, new_shortcut from spyderlib.utils.qthelpers import (create_action, add_actions, mimedata2url, get_filetype_icon, create_toolbutton) diff --git a/spyderlib/widgets/editortools.py b/spyderlib/widgets/editortools.py index f85187ea94a..48ba59bb0ae 100644 --- a/spyderlib/widgets/editortools.py +++ b/spyderlib/widgets/editortools.py @@ -18,7 +18,7 @@ import spyderlib.utils.icon_manager as ima # Local import -from spyderlib.baseconfig import _, STDOUT +from spyderlib.config.base import _, STDOUT from spyderlib.utils.qthelpers import (create_action, create_toolbutton, set_item_user_text) from spyderlib.widgets.onecolumntree import OneColumnTree diff --git a/spyderlib/widgets/explorer.py b/spyderlib/widgets/explorer.py index 3697983a4c3..ac7ba6e555f 100644 --- a/spyderlib/widgets/explorer.py +++ b/spyderlib/widgets/explorer.py @@ -32,7 +32,7 @@ # Local imports from spyderlib.utils.qthelpers import create_action, add_actions, file_uri from spyderlib.utils import misc, encoding, programs, vcs -from spyderlib.baseconfig import _ +from spyderlib.config.base import _ from spyderlib.py3compat import (to_text_string, to_binary_string, getcwd, str_lower) diff --git a/spyderlib/widgets/externalshell/baseshell.py b/spyderlib/widgets/externalshell/baseshell.py index e7dc3e8045b..876a86aa6aa 100644 --- a/spyderlib/widgets/externalshell/baseshell.py +++ b/spyderlib/widgets/externalshell/baseshell.py @@ -25,7 +25,7 @@ # Local imports from spyderlib.utils.qthelpers import (create_toolbutton, create_action, add_actions) -from spyderlib.baseconfig import get_conf_path, _ +from spyderlib.config.base import get_conf_path, _ from spyderlib.py3compat import is_text_string, to_text_string diff --git a/spyderlib/widgets/externalshell/introspection.py b/spyderlib/widgets/externalshell/introspection.py index ee53b6c70bf..0a9aa2ba5bc 100644 --- a/spyderlib/widgets/externalshell/introspection.py +++ b/spyderlib/widgets/externalshell/introspection.py @@ -14,7 +14,7 @@ import os # Local imports -from spyderlib.baseconfig import get_conf_path, DEBUG +from spyderlib.config.base import get_conf_path, DEBUG from spyderlib.utils.misc import select_port from spyderlib.utils.debug import log_last_error from spyderlib.utils.bsdsocket import read_packet, write_packet diff --git a/spyderlib/widgets/externalshell/monitor.py b/spyderlib/widgets/externalshell/monitor.py index ebfa1fad31f..e6f0c6733a7 100644 --- a/spyderlib/widgets/externalshell/monitor.py +++ b/spyderlib/widgets/externalshell/monitor.py @@ -19,7 +19,7 @@ from spyderlib.utils.bsdsocket import (communicate, read_packet, write_packet, PACKET_NOT_RECEIVED, PICKLE_HIGHEST_PROTOCOL) from spyderlib.utils.introspection.module_completion import module_completion -from spyderlib.baseconfig import get_conf_path, get_supported_types, DEBUG +from spyderlib.config.base import get_conf_path, get_supported_types, DEBUG from spyderlib.py3compat import getcwd, is_text_string, pickle, _thread diff --git a/spyderlib/widgets/externalshell/namespacebrowser.py b/spyderlib/widgets/externalshell/namespacebrowser.py index 243ea06b70d..3cc18c63737 100644 --- a/spyderlib/widgets/externalshell/namespacebrowser.py +++ b/spyderlib/widgets/externalshell/namespacebrowser.py @@ -31,7 +31,7 @@ create_action) from spyderlib.utils.iofuncs import iofunctions from spyderlib.widgets.importwizard import ImportWizard -from spyderlib.baseconfig import _, get_supported_types +from spyderlib.config.base import _, get_supported_types from spyderlib.py3compat import is_text_string, to_text_string, getcwd diff --git a/spyderlib/widgets/externalshell/pythonshell.py b/spyderlib/widgets/externalshell/pythonshell.py index 5f0270c780b..075862822ab 100644 --- a/spyderlib/widgets/externalshell/pythonshell.py +++ b/spyderlib/widgets/externalshell/pythonshell.py @@ -23,7 +23,7 @@ from spyderlib.utils.environ import RemoteEnvDialog from spyderlib.utils.programs import get_python_args from spyderlib.utils.misc import get_python_executable -from spyderlib.baseconfig import (_, get_module_source_path, DEBUG, +from spyderlib.config.base import (_, get_module_source_path, DEBUG, MAC_APP_NAME, running_in_mac_app) from spyderlib.widgets.shell import PythonShellWidget from spyderlib.widgets.externalshell.namespacebrowser import NamespaceBrowser diff --git a/spyderlib/widgets/externalshell/sitecustomize.py b/spyderlib/widgets/externalshell/sitecustomize.py index 1da8a2451ab..09a70d1783c 100644 --- a/spyderlib/widgets/externalshell/sitecustomize.py +++ b/spyderlib/widgets/externalshell/sitecustomize.py @@ -163,7 +163,7 @@ def write(self, text): IS_EXT_INTERPRETER = os.environ.get('EXTERNAL_INTERPRETER', '').lower() == "true" if sys.platform == 'darwin': - from spyderlib.baseconfig import MAC_APP_NAME + from spyderlib.config.base import MAC_APP_NAME if MAC_APP_NAME in __file__: if IS_EXT_INTERPRETER.lower() == "true": # Add a minimal library (with spyderlib) at the end of sys.path to @@ -454,7 +454,7 @@ def set_spyder_breakpoints(self): bdb.Breakpoint.bplist = {} bdb.Breakpoint.bpbynumber = [None] #------ - from spyderlib.config import CONF + from spyderlib.config.config import CONF CONF.load_from_ini() if CONF.get('run', 'breakpoints/enabled', True): breakpoints = CONF.get('run', 'breakpoints', {}) diff --git a/spyderlib/widgets/externalshell/start_ipython_kernel.py b/spyderlib/widgets/externalshell/start_ipython_kernel.py index 9b7c7348f71..235a96b66d5 100644 --- a/spyderlib/widgets/externalshell/start_ipython_kernel.py +++ b/spyderlib/widgets/externalshell/start_ipython_kernel.py @@ -25,7 +25,7 @@ def kernel_config(): """Create a config object with IPython kernel options""" from IPython.config.loader import Config, load_pyconfig_files from IPython.core.application import get_ipython_dir - from spyderlib.config import CONF + from spyderlib.config.config import CONF from spyderlib.utils.programs import is_module_installed # ---- IPython config ---- diff --git a/spyderlib/widgets/externalshell/systemshell.py b/spyderlib/widgets/externalshell/systemshell.py index b037959678d..3eaf23011c4 100644 --- a/spyderlib/widgets/externalshell/systemshell.py +++ b/spyderlib/widgets/externalshell/systemshell.py @@ -16,7 +16,7 @@ # Local imports from spyderlib.utils.programs import shell_split -from spyderlib.baseconfig import _ +from spyderlib.config.base import _ from spyderlib.widgets.externalshell.baseshell import (ExternalShellBase, add_pathlist_to_PYTHONPATH) from spyderlib.widgets.shell import TerminalWidget diff --git a/spyderlib/widgets/findinfiles.py b/spyderlib/widgets/findinfiles.py index 354e2a80840..8b71a9a92ca 100644 --- a/spyderlib/widgets/findinfiles.py +++ b/spyderlib/widgets/findinfiles.py @@ -32,7 +32,7 @@ from spyderlib.utils.vcs import is_hg_installed, get_vcs_root from spyderlib.utils.misc import abspardir, get_common_path from spyderlib.utils.qthelpers import create_toolbutton, get_filetype_icon -from spyderlib.baseconfig import _ +from spyderlib.config.base import _ from spyderlib.widgets.comboboxes import PathComboBox, PatternComboBox from spyderlib.widgets.onecolumntree import OneColumnTree from spyderlib.py3compat import to_text_string, getcwd diff --git a/spyderlib/widgets/findreplace.py b/spyderlib/widgets/findreplace.py index 500b45ab93c..8c2314d90d1 100644 --- a/spyderlib/widgets/findreplace.py +++ b/spyderlib/widgets/findreplace.py @@ -19,8 +19,8 @@ import re # Local imports -from spyderlib.baseconfig import _ -from spyderlib.guiconfig import create_shortcut, new_shortcut +from spyderlib.config.base import _ +from spyderlib.config.gui import create_shortcut, new_shortcut from spyderlib.utils.qthelpers import get_icon, create_toolbutton from spyderlib.widgets.comboboxes import PatternComboBox from spyderlib.py3compat import to_text_string diff --git a/spyderlib/widgets/formlayout.py b/spyderlib/widgets/formlayout.py index e567d9ed052..5bc0a3341e7 100644 --- a/spyderlib/widgets/formlayout.py +++ b/spyderlib/widgets/formlayout.py @@ -68,7 +68,7 @@ import datetime # Local imports -from spyderlib.baseconfig import _, DEBUG, STDERR +from spyderlib.config.base import _, DEBUG, STDERR from spyderlib.py3compat import is_text_string, to_text_string, is_string, u DEBUG_FORMLAYOUT = DEBUG >= 2 diff --git a/spyderlib/widgets/importwizard.py b/spyderlib/widgets/importwizard.py index aa6dea8ed39..4170f779bed 100644 --- a/spyderlib/widgets/importwizard.py +++ b/spyderlib/widgets/importwizard.py @@ -29,7 +29,7 @@ pd = None # Local import -from spyderlib.baseconfig import _ +from spyderlib.config.base import _ from spyderlib.utils import programs from spyderlib.utils.qthelpers import add_actions, create_action from spyderlib.py3compat import (TEXT_TYPES, INT_TYPES, to_text_string, u, diff --git a/spyderlib/widgets/internalshell.py b/spyderlib/widgets/internalshell.py index 1160b20034a..26985b5b616 100644 --- a/spyderlib/widgets/internalshell.py +++ b/spyderlib/widgets/internalshell.py @@ -35,8 +35,8 @@ #TODO: remove the CONF object and make it work anyway # In fact, this 'CONF' object has nothing to do in package spyderlib.widgets # which should not contain anything directly related to Spyder's main app -from spyderlib.baseconfig import get_conf_path, _, DEBUG -from spyderlib.config import CONF +from spyderlib.config.base import get_conf_path, _, DEBUG +from spyderlib.config.main import CONF from spyderlib.widgets.shell import PythonShellWidget from spyderlib.py3compat import to_text_string, getcwd, to_binary_string, u import spyderlib.utils.icon_manager as ima diff --git a/spyderlib/widgets/ipython.py b/spyderlib/widgets/ipython.py index d9fdd69f2a2..3494e1db2e7 100644 --- a/spyderlib/widgets/ipython.py +++ b/spyderlib/widgets/ipython.py @@ -33,10 +33,10 @@ from IPython.config.loader import Config, load_pyconfig_files # Local imports -from spyderlib.baseconfig import (get_conf_path, get_image_path, - get_module_source_path, _) -from spyderlib.config import CONF -from spyderlib.guiconfig import (create_shortcut, get_font, get_shortcut, +from spyderlib.config.base import (get_conf_path, get_image_path, + get_module_source_path, _) +from spyderlib.config.main import CONF +from spyderlib.config.gui import (create_shortcut, get_font, get_shortcut, new_shortcut) from spyderlib.utils.dochelpers import getargspecfromtext, getsignaturefromtext from spyderlib.utils.qthelpers import (create_toolbutton, add_actions, diff --git a/spyderlib/widgets/mixins.py b/spyderlib/widgets/mixins.py index 26f14adbd60..4fafc1b5f0c 100644 --- a/spyderlib/widgets/mixins.py +++ b/spyderlib/widgets/mixins.py @@ -22,7 +22,7 @@ from spyderlib.qt.QtCore import Qt, QPoint, QRegExp # Local imports -from spyderlib.baseconfig import _ +from spyderlib.config.base import _ from spyderlib.utils import encoding, sourcecode from spyderlib.utils.misc import get_error_match from spyderlib.utils.dochelpers import (getobj, getargspecfromtext, diff --git a/spyderlib/widgets/onecolumntree.py b/spyderlib/widgets/onecolumntree.py index 6dc569072dd..d2e00e810b3 100644 --- a/spyderlib/widgets/onecolumntree.py +++ b/spyderlib/widgets/onecolumntree.py @@ -19,7 +19,7 @@ import spyderlib.utils.icon_manager as ima # Local imports -from spyderlib.baseconfig import _ +from spyderlib.config.base import _ from spyderlib.utils.qthelpers import create_action, add_actions, get_item_user_text diff --git a/spyderlib/widgets/pathmanager.py b/spyderlib/widgets/pathmanager.py index 64a84967058..5f66b65e338 100644 --- a/spyderlib/widgets/pathmanager.py +++ b/spyderlib/widgets/pathmanager.py @@ -21,7 +21,7 @@ # Local imports from spyderlib.utils.qthelpers import create_toolbutton -from spyderlib.baseconfig import _ +from spyderlib.config.base import _ from spyderlib.py3compat import getcwd diff --git a/spyderlib/widgets/projectexplorer.py b/spyderlib/widgets/projectexplorer.py index 79062c28ed5..d96104ae124 100644 --- a/spyderlib/widgets/projectexplorer.py +++ b/spyderlib/widgets/projectexplorer.py @@ -28,7 +28,7 @@ # Local imports from spyderlib.utils import misc from spyderlib.utils.qthelpers import get_icon, create_action -from spyderlib.baseconfig import _, STDERR, get_image_path +from spyderlib.config.base import _, STDERR, get_image_path from spyderlib.widgets.explorer import FilteredDirView, listdir, fixpath from spyderlib.widgets.formlayout import fedit from spyderlib.widgets.pathmanager import PathManager diff --git a/spyderlib/widgets/pydocgui.py b/spyderlib/widgets/pydocgui.py index 8b4a7d58510..51a77ebda87 100644 --- a/spyderlib/widgets/pydocgui.py +++ b/spyderlib/widgets/pydocgui.py @@ -13,7 +13,7 @@ import os.path as osp # Local imports -from spyderlib.baseconfig import _ +from spyderlib.config.base import _ from spyderlib.widgets.browser import WebBrowser from spyderlib.utils.misc import select_port from spyderlib.py3compat import to_text_string, PY3 diff --git a/spyderlib/widgets/shell.py b/spyderlib/widgets/shell.py index d74c5bf680f..8a4cb69086a 100644 --- a/spyderlib/widgets/shell.py +++ b/spyderlib/widgets/shell.py @@ -27,10 +27,10 @@ import spyderlib.utils.icon_manager as ima # Local import -from spyderlib.baseconfig import get_conf_path, _, STDERR, DEBUG -from spyderlib.config import CONF -from spyderlib.guiconfig import (get_font, create_shortcut, get_shortcut, - new_shortcut) +from spyderlib.config.base import get_conf_path, _, STDERR, DEBUG +from spyderlib.config.main import CONF +from spyderlib.config.gui import (get_font, create_shortcut, get_shortcut, + new_shortcut) from spyderlib.utils import encoding from spyderlib.utils.qthelpers import (keybinding, create_action, add_actions, restore_keyevent) diff --git a/spyderlib/widgets/sourcecode/codeeditor.py b/spyderlib/widgets/sourcecode/codeeditor.py index e31560c6659..d936bd45305 100644 --- a/spyderlib/widgets/sourcecode/codeeditor.py +++ b/spyderlib/widgets/sourcecode/codeeditor.py @@ -42,10 +42,10 @@ # Local import # TODO: Try to separate this module from spyderlib to create a self # consistent editor module (Qt source code and shell widgets library) -from spyderlib.baseconfig import get_conf_path, _, DEBUG -from spyderlib.config import CONF -from spyderlib.guiconfig import (get_font, create_shortcut, new_shortcut, - get_shortcut) +from spyderlib.config.base import get_conf_path, _, DEBUG +from spyderlib.config.main import CONF +from spyderlib.config.gui import (get_font, create_shortcut, new_shortcut, + get_shortcut) from spyderlib.utils.qthelpers import (add_actions, create_action, keybinding, mimedata2url) from spyderlib.utils.dochelpers import getobj diff --git a/spyderlib/widgets/sourcecode/syntaxhighlighters.py b/spyderlib/widgets/sourcecode/syntaxhighlighters.py index 2912548e9fc..1393a707014 100644 --- a/spyderlib/widgets/sourcecode/syntaxhighlighters.py +++ b/spyderlib/widgets/sourcecode/syntaxhighlighters.py @@ -22,8 +22,8 @@ # Local imports from spyderlib import dependencies -from spyderlib.baseconfig import _ -from spyderlib.config import CONF +from spyderlib.config.base import _ +from spyderlib.config.main import CONF from spyderlib.py3compat import builtins, is_text_string, to_text_string from spyderlib.utils.sourcecode import CELL_LANGUAGES diff --git a/spyderlib/widgets/status.py b/spyderlib/widgets/status.py index 70abf4bee3f..b454bab162f 100644 --- a/spyderlib/widgets/status.py +++ b/spyderlib/widgets/status.py @@ -12,8 +12,8 @@ from spyderlib.qt.QtCore import QTimer # Local import -from spyderlib.baseconfig import _ -from spyderlib.guiconfig import get_font +from spyderlib.config.base import _ +from spyderlib.config.gui import get_font from spyderlib.py3compat import to_text_string from spyderlib import dependencies diff --git a/spyderlib/widgets/tabs.py b/spyderlib/widgets/tabs.py index 9903fa28527..1fd770ded6e 100644 --- a/spyderlib/widgets/tabs.py +++ b/spyderlib/widgets/tabs.py @@ -20,8 +20,8 @@ import sys # Local imports -from spyderlib.baseconfig import _ -from spyderlib.guiconfig import new_shortcut +from spyderlib.config.base import _ +from spyderlib.config.gui import new_shortcut from spyderlib.utils.misc import get_common_path from spyderlib.utils.qthelpers import (add_actions, create_toolbutton, create_action) diff --git a/spyderlib/widgets/texteditor.py b/spyderlib/widgets/texteditor.py index 808101019b2..b3d516201fd 100644 --- a/spyderlib/widgets/texteditor.py +++ b/spyderlib/widgets/texteditor.py @@ -15,8 +15,8 @@ import spyderlib.utils.icon_manager as ima # Local import -from spyderlib.baseconfig import _ -from spyderlib.guiconfig import get_font +from spyderlib.config.base import _ +from spyderlib.config.gui import get_font from spyderlib.py3compat import (to_text_string, to_binary_string, is_binary_string) diff --git a/spyderlib/workers/updates.py b/spyderlib/workers/updates.py index af12eb4d636..255b7276514 100644 --- a/spyderlib/workers/updates.py +++ b/spyderlib/workers/updates.py @@ -9,7 +9,7 @@ from spyderlib import __version__ -from spyderlib.baseconfig import _ +from spyderlib.config.base import _ from spyderlib.py3compat import PY3 from spyderlib.qt.QtCore import Signal, QObject from spyderlib.utils.programs import check_version, is_stable_version diff --git a/spyderplugins/p_breakpoints.py b/spyderplugins/p_breakpoints.py index 970d5e318b0..6d8d7d0faef 100644 --- a/spyderplugins/p_breakpoints.py +++ b/spyderplugins/p_breakpoints.py @@ -13,7 +13,7 @@ # pylint: disable=R0201 # Local imports -from spyderlib.baseconfig import get_translation +from spyderlib.config.base import get_translation _ = get_translation("p_breakpoints", dirname="spyderplugins") from spyderlib.utils.qthelpers import create_action from spyderlib.plugins import SpyderPluginMixin diff --git a/spyderplugins/p_profiler.py b/spyderplugins/p_profiler.py index a0d3db34c81..3ce5a3c0e1d 100644 --- a/spyderplugins/p_profiler.py +++ b/spyderplugins/p_profiler.py @@ -13,7 +13,7 @@ import spyderlib.utils.icon_manager as ima # Local imports -from spyderlib.baseconfig import get_translation +from spyderlib.config.base import get_translation _ = get_translation("p_profiler", dirname="spyderplugins") from spyderlib.utils.qthelpers import create_action from spyderlib.plugins import SpyderPluginMixin, PluginConfigPage, runconfig diff --git a/spyderplugins/p_pylint.py b/spyderplugins/p_pylint.py index a359714d066..ee27163219f 100644 --- a/spyderplugins/p_pylint.py +++ b/spyderplugins/p_pylint.py @@ -16,7 +16,7 @@ import spyderlib.utils.icon_manager as ima # Local imports -from spyderlib.baseconfig import get_translation +from spyderlib.config.base import get_translation _ = get_translation("p_pylint", dirname="spyderplugins") from spyderlib.utils.qthelpers import create_action from spyderlib.plugins import SpyderPluginMixin, PluginConfigPage diff --git a/spyderplugins/widgets/breakpointsgui.py b/spyderplugins/widgets/breakpointsgui.py index cec2c5abcd5..840565c21be 100644 --- a/spyderplugins/widgets/breakpointsgui.py +++ b/spyderplugins/widgets/breakpointsgui.py @@ -22,8 +22,8 @@ import os.path as osp # Local imports -from spyderlib.baseconfig import get_translation -from spyderlib.config import CONF +from spyderlib.config.base import get_translation +from spyderlib.config.main import CONF from spyderlib.utils.qthelpers import create_action, add_actions diff --git a/spyderplugins/widgets/profilergui.py b/spyderplugins/widgets/profilergui.py index 38caf230838..8cd78439aae 100644 --- a/spyderplugins/widgets/profilergui.py +++ b/spyderplugins/widgets/profilergui.py @@ -37,7 +37,7 @@ from spyderlib.utils.qthelpers import (create_toolbutton, get_item_user_text, set_item_user_text) from spyderlib.utils.programs import shell_split -from spyderlib.baseconfig import get_conf_path, get_translation +from spyderlib.config.base import get_conf_path, get_translation from spyderlib.widgets.texteditor import TextEditor from spyderlib.widgets.comboboxes import PythonModulesComboBox from spyderlib.widgets.externalshell import baseshell diff --git a/spyderplugins/widgets/pylintgui.py b/spyderplugins/widgets/pylintgui.py index fb8b3fcdbc1..2d46a410eb1 100644 --- a/spyderplugins/widgets/pylintgui.py +++ b/spyderplugins/widgets/pylintgui.py @@ -32,7 +32,7 @@ from spyderlib.utils import programs from spyderlib.utils.encoding import to_unicode_from_fs from spyderlib.utils.qthelpers import create_toolbutton -from spyderlib.baseconfig import get_conf_path, get_translation +from spyderlib.config.base import get_conf_path, get_translation from spyderlib.widgets.onecolumntree import OneColumnTree from spyderlib.widgets.texteditor import TextEditor from spyderlib.widgets.comboboxes import (PythonModulesComboBox, From e61221c2215d7c8e7fdb892dea3d2d9b2cde27d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Pe=C3=B1a-Castellanos?= Date: Wed, 5 Aug 2015 17:35:51 -0500 Subject: [PATCH 2/3] Rebase and fix import --- spyderlib/widgets/helperwidgets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spyderlib/widgets/helperwidgets.py b/spyderlib/widgets/helperwidgets.py index 4cc783a12c9..608785a95c1 100644 --- a/spyderlib/widgets/helperwidgets.py +++ b/spyderlib/widgets/helperwidgets.py @@ -16,7 +16,7 @@ QVBoxLayout, QSpacerItem, QMessageBox, QCheckBox) -from spyderlib.baseconfig import _ +from spyderlib.config.base import _ from spyderlib.utils.qthelpers import get_std_icon From d1c37fc99eb31c657bae4a65630e8049f4c725b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Pe=C3=B1a-Castellanos?= Date: Fri, 7 Aug 2015 23:57:33 -0500 Subject: [PATCH 3/3] Fix imports --- spyderlib/config/base.py | 2 +- spyderlib/plugins/shortcuts.py | 2 +- spyderlib/start_app.py | 2 +- spyderlib/utils/inspector/conf.py | 2 +- spyderlib/widgets/externalshell/sitecustomize.py | 6 +++--- spyderlib/widgets/externalshell/start_ipython_kernel.py | 2 +- spyderlib/widgets/ipython.py | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/spyderlib/config/base.py b/spyderlib/config/base.py index 7e57cec484f..5c7afc5964a 100644 --- a/spyderlib/config/base.py +++ b/spyderlib/config/base.py @@ -242,7 +242,7 @@ def get_available_translations(): # is added, to ensure LANGUAGE_CODES is updated. for lang in langs: if lang not in LANGUAGE_CODES: - error = _('Update LANGUAGE_CODES (inside baseconfig.py) if a new ' + error = _('Update LANGUAGE_CODES (inside config/base.py) if a new ' 'translation has been added to Spyder') raise Exception(error) return langs diff --git a/spyderlib/plugins/shortcuts.py b/spyderlib/plugins/shortcuts.py index a6fd8ed21a9..f7c2ede9ffa 100644 --- a/spyderlib/plugins/shortcuts.py +++ b/spyderlib/plugins/shortcuts.py @@ -23,7 +23,7 @@ # Local imports from spyderlib.config.base import _, debug_print from spyderlib.config.gui import (get_shortcut, set_shortcut, - iter_shortcuts, reset_shortcuts) + iter_shortcuts, reset_shortcuts) from spyderlib.plugins.configdialog import GeneralConfigPage from spyderlib.utils import icon_manager as ima from spyderlib.utils.qthelpers import get_std_icon diff --git a/spyderlib/start_app.py b/spyderlib/start_app.py index 3b5735b7998..43bfc5fe230 100644 --- a/spyderlib/start_app.py +++ b/spyderlib/start_app.py @@ -54,7 +54,7 @@ def main(): options to the application. """ # Renaming old configuration files (the '.' prefix has been removed) - # (except for .spyder.ini --> spyder.ini, which is done in userconfig.py) + # (except for .spyder.ini --> spyder.ini, which is done in config/user.py) if DEV is None: cpath = get_conf_path() for fname in os.listdir(cpath): diff --git a/spyderlib/utils/inspector/conf.py b/spyderlib/utils/inspector/conf.py index a1069e24212..02d0961e40a 100644 --- a/spyderlib/utils/inspector/conf.py +++ b/spyderlib/utils/inspector/conf.py @@ -10,7 +10,7 @@ from sphinx import __version__ as sphinx_version # Local imports -from spyderlib.config.config import CONF +from spyderlib.config.main import CONF from spyderlib.py3compat import u #============================================================================== diff --git a/spyderlib/widgets/externalshell/sitecustomize.py b/spyderlib/widgets/externalshell/sitecustomize.py index 09a70d1783c..f0662645380 100644 --- a/spyderlib/widgets/externalshell/sitecustomize.py +++ b/spyderlib/widgets/externalshell/sitecustomize.py @@ -454,7 +454,7 @@ def set_spyder_breakpoints(self): bdb.Breakpoint.bplist = {} bdb.Breakpoint.bpbynumber = [None] #------ - from spyderlib.config.config import CONF + from spyderlib.config.main import CONF CONF.load_from_ini() if CONF.get('run', 'breakpoints/enabled', True): breakpoints = CONF.get('run', 'breakpoints', {}) @@ -848,8 +848,8 @@ def evalsc(command): Popen('ls', shell=True, stdin=PIPE) _print('\n') elif command == 'scientific': - from spyderlib import baseconfig - execfile(baseconfig.SCIENTIFIC_STARTUP, namespace) + from spyderlib.config import base + execfile(base.SCIENTIFIC_STARTUP, namespace) else: raise NotImplementedError("Unsupported command: '%s'" % command) diff --git a/spyderlib/widgets/externalshell/start_ipython_kernel.py b/spyderlib/widgets/externalshell/start_ipython_kernel.py index 235a96b66d5..90bb88f3995 100644 --- a/spyderlib/widgets/externalshell/start_ipython_kernel.py +++ b/spyderlib/widgets/externalshell/start_ipython_kernel.py @@ -25,7 +25,7 @@ def kernel_config(): """Create a config object with IPython kernel options""" from IPython.config.loader import Config, load_pyconfig_files from IPython.core.application import get_ipython_dir - from spyderlib.config.config import CONF + from spyderlib.config.main import CONF from spyderlib.utils.programs import is_module_installed # ---- IPython config ---- diff --git a/spyderlib/widgets/ipython.py b/spyderlib/widgets/ipython.py index 3494e1db2e7..62a6e21de0d 100644 --- a/spyderlib/widgets/ipython.py +++ b/spyderlib/widgets/ipython.py @@ -37,7 +37,7 @@ get_module_source_path, _) from spyderlib.config.main import CONF from spyderlib.config.gui import (create_shortcut, get_font, get_shortcut, - new_shortcut) + new_shortcut) from spyderlib.utils.dochelpers import getargspecfromtext, getsignaturefromtext from spyderlib.utils.qthelpers import (create_toolbutton, add_actions, create_action, restore_keyevent)