Skip to content
Snippets Groups Projects
Commit 1a19129b authored by Peterson, Peter's avatar Peterson, Peter
Browse files

Move singleton and config into module

parent bddad0bb
No related branches found
No related tags found
No related merge requests found
......@@ -14,3 +14,39 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
""" Main configuration module.
A singleton instance called CONF is defined. Modules wishing to access the settings
should import the CONF object as
from workbench.config.main import CONF
and use it to access the settings
"""
from __future__ import (absolute_import, unicode_literals)
from workbench.config.user import UserConfig
# -----------------------------------------------------------------------------
# Constants
# -----------------------------------------------------------------------------
ORGANIZATION = 'mantidproject'
ORG_DOMAIN = 'mantidproject.org'
APPNAME = 'workbench'
# Iterable containing defaults for each configurable section of the code
# General application settings are in the main section
DEFAULTS = {
'main': {
'high_dpi_scaling': True,
'window/size': (1260, 740),
'window/position': (10, 10),
'window/is_maximized': True,
'window/is_fullscreen': False,
}
}
# -----------------------------------------------------------------------------
# 'Singleton' instance
# -----------------------------------------------------------------------------
CONF = UserConfig(ORGANIZATION, APPNAME, defaults=DEFAULTS)
# This file is part of the mantid workbench.
#
# Copyright (C) 2017 mantidproject
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
""" Main configuration module.
A singleton instance called CONF is defined. Modules wishing to access the settings
should import the CONF object as
from workbench.config.main import CONF
and use it to access the settings
"""
from __future__ import (absolute_import, unicode_literals)
from workbench.config.user import UserConfig
# -----------------------------------------------------------------------------
# Constants
# -----------------------------------------------------------------------------
ORGANIZATION = 'mantidproject'
APPNAME = 'workbench'
# Iterable containing defaults for each configurable section of the code
# General application settings are in the main section
DEFAULTS = {
'main': {
'high_dpi_scaling': True,
'window/size': (1260, 740),
'window/position': (10, 10),
'window/is_maximized': True,
'window/is_fullscreen': False,
}
}
# -----------------------------------------------------------------------------
# 'Singleton' instance
# -----------------------------------------------------------------------------
CONF = UserConfig(ORGANIZATION, APPNAME, defaults=DEFAULTS)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment