From 6f7989ab50c0f53c67e930eb38f9791e46aef602 Mon Sep 17 00:00:00 2001 From: derrod Date: Thu, 2 Dec 2021 16:51:48 +0100 Subject: [PATCH] [cli/core/utils/lfs] Also enable update notification on macOS --- legendary/cli.py | 4 ++-- legendary/core.py | 4 ++-- legendary/lfs/lgndry.py | 4 ++-- legendary/utils/env.py | 4 ++++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/legendary/cli.py b/legendary/cli.py index 0213c6e..d1830b1 100644 --- a/legendary/cli.py +++ b/legendary/cli.py @@ -24,7 +24,7 @@ from legendary.models.exceptions import InvalidCredentialsError from legendary.models.game import SaveGameStatus, VerifyResult from legendary.utils.cli import get_boolean_choice, sdl_prompt from legendary.utils.custom_parser import AliasedSubParsersAction -from legendary.utils.env import is_windows_or_pyi +from legendary.utils.env import is_windows_mac_or_pyi from legendary.utils.lfs import validate_files from legendary.utils.selective_dl import get_sdl_appname from legendary.utils.wine_helpers import read_registry, get_shell_folders @@ -2117,7 +2117,7 @@ def main(): print(f'- Release summary:\n{update_info["summary"]}\n- Release URL: {update_info["gh_url"]}') if update_info['critical']: print('! This update is recommended as it fixes major issues.') - if not is_windows_or_pyi(): + if not is_windows_mac_or_pyi(): print('If you installed legendary via a package manager it may ' 'take some time for the update to become available.') diff --git a/legendary/core.py b/legendary/core.py index 10703f7..a27fcc1 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -33,7 +33,7 @@ from legendary.models.json_manifest import JSONManifest from legendary.models.manifest import Manifest, ManifestMeta from legendary.models.chunk import Chunk from legendary.utils.egl_crypt import decrypt_epic_data -from legendary.utils.env import is_windows_or_pyi +from legendary.utils.env import is_windows_mac_or_pyi from legendary.utils.game_workarounds import is_opt_enabled, update_workarounds from legendary.utils.savegame_helper import SaveGameHelper from legendary.utils.selective_dl import games as sdl_games @@ -242,7 +242,7 @@ class LegendaryCore: if self.force_show_update: return True return not self.lgd.config.getboolean('Legendary', 'disable_update_notice', - fallback=not is_windows_or_pyi()) + fallback=not is_windows_mac_or_pyi()) def check_for_updates(self, force=False): def version_tuple(v): diff --git a/legendary/lfs/lgndry.py b/legendary/lfs/lgndry.py index 66d1975..8bb6a0b 100644 --- a/legendary/lfs/lgndry.py +++ b/legendary/lfs/lgndry.py @@ -11,7 +11,7 @@ from time import time from legendary.models.game import * from legendary.utils.aliasing import generate_aliases from legendary.utils.config import LGDConf -from legendary.utils.env import is_windows_or_pyi +from legendary.utils.env import is_windows_mac_or_pyi from legendary.utils.lfs import clean_filename @@ -99,7 +99,7 @@ class LGDLFS: self.config.set('Legendary', 'disable_update_check', 'false') if not self.config.has_option('Legendary', 'disable_update_notice'): self.config.set('Legendary', '; Disables the notice about an available update on exit') - self.config.set('Legendary', 'disable_update_notice', 'false' if is_windows_or_pyi() else 'true') + self.config.set('Legendary', 'disable_update_notice', 'false' if is_windows_mac_or_pyi() else 'true') try: self._installed = json.load(open(os.path.join(self.path, 'installed.json'))) diff --git a/legendary/utils/env.py b/legendary/utils/env.py index 669968c..54af896 100644 --- a/legendary/utils/env.py +++ b/legendary/utils/env.py @@ -8,3 +8,7 @@ def is_pyinstaller(): def is_windows_or_pyi(): return is_pyinstaller() or os.name == 'nt' + + +def is_windows_mac_or_pyi(): + return is_pyinstaller() or os.name == 'nt' or sys.platform == 'darwin'