Deprecate constants module

This commit is contained in:
Mathieu Comandon
2014-08-17 19:40:22 +02:00
parent c0f8b6e56f
commit 8eea8f4bf2
3 changed files with 3 additions and 36 deletions

View File

@@ -44,14 +44,13 @@ except ImportError:
else:
sys.exit()
from lutris.constants import CONFIG_EXTENSION, GAME_CONFIG_PATH
from lutris.util.log import logger
from lutris.installer import InstallerDialog
from lutris.config import check_config # , register_handler
from lutris.game import Game
from lutris import pga
from lutris.gui.lutriswindow import LutrisWindow
from lutris.settings import VERSION
from lutris.settings import VERSION, GAME_CONFIG_DIR
# Support for command line options.
@@ -114,7 +113,7 @@ for arg in args:
break
if game_slug or options.installer_file:
file_path = os.path.join(GAME_CONFIG_PATH, game_slug + CONFIG_EXTENSION)
file_path = os.path.join(GAME_CONFIG_DIR, game_slug + ".yml")
db_game = pga.get_game_by_slug(game_slug) \
or pga.get_game_by_slug(game_slug, field='installer_slug')
if db_game and db_game['installed'] and not options.reinstall:

View File

@@ -1,33 +0,0 @@
# -*- coding:Utf-8 -*-
#
# Copyright (C) 2010 Mathieu Comandon <strider@strycore.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# 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/>.
#
""" Constants module, soon to be deprecated. Replaced by settings module. """
from os.path import join
from xdg import BaseDirectory
PROTOCOL_VERSION = 1
CONFIG_EXTENSION = ".yml"
LUTRIS_CONFIG_PATH = join(BaseDirectory.xdg_config_home, 'lutris')
LUTRIS_DATA_PATH = join(BaseDirectory.xdg_data_home, 'lutris')
LUTRIS_CACHE_PATH = join(BaseDirectory.xdg_cache_home, 'lutris')
RUNNER_CONFIG_PATH = join(LUTRIS_CONFIG_PATH, 'runners')
GAME_CONFIG_PATH = join(LUTRIS_CONFIG_PATH, 'games')
COVER_PATH = join(LUTRIS_CONFIG_PATH, 'covers')
TMP_PATH = join(LUTRIS_CACHE_PATH, 'tmp')

View File

@@ -16,6 +16,7 @@ CONFIG_FILE = os.path.join(CONFIG_DIR, "lutris.conf")
DATA_DIR = os.path.join(BaseDirectory.xdg_data_home, 'lutris')
RUNNER_DIR = os.path.join(DATA_DIR, "runners")
CACHE_DIR = os.path.join(BaseDirectory.xdg_cache_home, 'lutris')
GAME_CONFIG_DIR = os.path.join(CONFIG_DIR, 'games')
TMP_PATH = os.path.join(CACHE_DIR, 'tmp')
BANNER_PATH = os.path.join(DATA_DIR, 'banners')