Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize repo: grouped config files inside spyderlib/config #2575

Merged
merged 3 commits into from
Aug 8, 2015
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions create_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
Empty file added spyderlib/config/__init__.py
Empty file.
File renamed without changes.
6 changes: 3 additions & 3 deletions spyderlib/guiconfig.py → spyderlib/config/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion spyderlib/ipythonconfig.py → spyderlib/config/ipython.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 3 additions & 3 deletions spyderlib/config.py → spyderlib/config/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
4 changes: 2 additions & 2 deletions spyderlib/userconfig.py → spyderlib/config/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions spyderlib/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 6 additions & 6 deletions spyderlib/plugins/configdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spyderlib/plugins/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions spyderlib/plugins/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion spyderlib/plugins/explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spyderlib/plugins/externalconsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion spyderlib/plugins/findinfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions spyderlib/plugins/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions spyderlib/plugins/inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions spyderlib/plugins/ipythonconsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spyderlib/plugins/layoutdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion spyderlib/plugins/onlinehelp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spyderlib/plugins/outlineexplorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spyderlib/plugins/projectexplorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spyderlib/plugins/runconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions spyderlib/plugins/shortcuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space to the right, here too :-)

from spyderlib.plugins.configdialog import GeneralConfigPage
from spyderlib.utils import icon_manager as ima
Expand Down
4 changes: 2 additions & 2 deletions spyderlib/plugins/variableexplorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spyderlib/plugins/workingdirectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spyderlib/restart_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions spyderlib/rope_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
18 changes: 9 additions & 9 deletions spyderlib/spyder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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?

Expand Down
5 changes: 2 additions & 3 deletions spyderlib/start_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion spyderlib/tour.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spyderlib/utils/bsdsocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spyderlib/utils/codeanalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spyderlib/utils/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spyderlib/utils/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import os

# Local imports
from spyderlib.baseconfig import _
from spyderlib.config.base import _
from spyderlib.widgets.dicteditor import DictEditor


Expand Down
Loading