From 791bc77c7c82026cdaa3d837c51da551e220af5e Mon Sep 17 00:00:00 2001 From: derrod Date: Sun, 5 Sep 2021 00:26:40 +0200 Subject: [PATCH] [core/lfs] Enable update notification for PyInstaller on Linux --- legendary/core.py | 3 ++- legendary/lfs/lgndry.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/legendary/core.py b/legendary/core.py index 46e6e1d..c0263f7 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -31,6 +31,7 @@ from legendary.models.game import * from legendary.models.json_manifest import JSONManifest from legendary.models.manifest import Manifest, ManifestMeta from legendary.models.chunk import Chunk +from legendary.utils.env import is_windows_or_pyi from legendary.utils.game_workarounds import is_opt_enabled, update_workarounds from legendary.utils.savegame_helper import SaveGameHelper from legendary.utils.manifests import combine_manifests @@ -210,7 +211,7 @@ class LegendaryCore: if self.force_show_update: return True return not self.lgd.config.getboolean('Legendary', 'disable_update_notice', - fallback=os.name != 'nt') + fallback=not is_windows_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 1c59347..8e9cf99 100644 --- a/legendary/lfs/lgndry.py +++ b/legendary/lfs/lgndry.py @@ -9,6 +9,7 @@ from time import time from legendary.models.game import * from legendary.utils.config import LGDConf +from legendary.utils.env import is_windows_or_pyi from legendary.utils.lfs import clean_filename @@ -85,7 +86,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 os.name == 'nt' else 'true') + self.config.set('Legendary', 'disable_update_notice', 'false' if is_windows_or_pyi() else 'true') try: self._installed = json.load(open(os.path.join(self.path, 'installed.json')))