# shared.py.in # # Copyright 2022-2023 kramo # # 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 . # # SPDX-License-Identifier: GPL-3.0-or-later import os from pathlib import Path from gi.repository import Gdk, Gio, GLib APP_ID = "@APP_ID@" VERSION = "@VERSION@" PREFIX = "@PREFIX@" PROFILE = "@PROFILE@" SPEC_VERSION = 1.5 # The version of the game_id.json spec schema = Gio.Settings.new(APP_ID) state_schema = Gio.Settings.new(APP_ID + ".State") home = Path.home() data_dir = Path(GLib.get_user_data_dir()) config_dir = Path(GLib.get_user_config_dir()) cache_dir = Path(GLib.get_user_cache_dir()) flatpak_dir = home / ".var" / "app" games_dir = data_dir / "cartridges" / "games" covers_dir = data_dir / "cartridges" / "covers" appdata_dir = Path(os.getenv("appdata") or "C:\\Users\\Default\\AppData\\Roaming") local_appdata_dir = Path(os.getenv("csidl_local_appdata") or "C:\\Users\\Default\\AppData\\Local") programfiles32_dir = Path(os.getenv("programfiles(x86)") or "C:\\Program Files (x86)") scale_factor = max( monitor.get_scale_factor() for monitor in Gdk.Display.get_default().get_monitors() ) image_size = (200 * scale_factor, 300 * scale_factor) # pylint: disable=invalid-name win = None importer = None store = None log_files = None