mirror of
https://github.com/derrod/legendary.git
synced 2024-12-22 01:45:28 +00:00
[cli/core/utils/lfs] Also enable update notification on macOS
This commit is contained in:
parent
9e21a81c96
commit
6f7989ab50
|
@ -24,7 +24,7 @@ from legendary.models.exceptions import InvalidCredentialsError
|
||||||
from legendary.models.game import SaveGameStatus, VerifyResult
|
from legendary.models.game import SaveGameStatus, VerifyResult
|
||||||
from legendary.utils.cli import get_boolean_choice, sdl_prompt
|
from legendary.utils.cli import get_boolean_choice, sdl_prompt
|
||||||
from legendary.utils.custom_parser import AliasedSubParsersAction
|
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.lfs import validate_files
|
||||||
from legendary.utils.selective_dl import get_sdl_appname
|
from legendary.utils.selective_dl import get_sdl_appname
|
||||||
from legendary.utils.wine_helpers import read_registry, get_shell_folders
|
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"]}')
|
print(f'- Release summary:\n{update_info["summary"]}\n- Release URL: {update_info["gh_url"]}')
|
||||||
if update_info['critical']:
|
if update_info['critical']:
|
||||||
print('! This update is recommended as it fixes major issues.')
|
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 '
|
print('If you installed legendary via a package manager it may '
|
||||||
'take some time for the update to become available.')
|
'take some time for the update to become available.')
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ from legendary.models.json_manifest import JSONManifest
|
||||||
from legendary.models.manifest import Manifest, ManifestMeta
|
from legendary.models.manifest import Manifest, ManifestMeta
|
||||||
from legendary.models.chunk import Chunk
|
from legendary.models.chunk import Chunk
|
||||||
from legendary.utils.egl_crypt import decrypt_epic_data
|
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.game_workarounds import is_opt_enabled, update_workarounds
|
||||||
from legendary.utils.savegame_helper import SaveGameHelper
|
from legendary.utils.savegame_helper import SaveGameHelper
|
||||||
from legendary.utils.selective_dl import games as sdl_games
|
from legendary.utils.selective_dl import games as sdl_games
|
||||||
|
@ -242,7 +242,7 @@ class LegendaryCore:
|
||||||
if self.force_show_update:
|
if self.force_show_update:
|
||||||
return True
|
return True
|
||||||
return not self.lgd.config.getboolean('Legendary', 'disable_update_notice',
|
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 check_for_updates(self, force=False):
|
||||||
def version_tuple(v):
|
def version_tuple(v):
|
||||||
|
|
|
@ -11,7 +11,7 @@ from time import time
|
||||||
from legendary.models.game import *
|
from legendary.models.game import *
|
||||||
from legendary.utils.aliasing import generate_aliases
|
from legendary.utils.aliasing import generate_aliases
|
||||||
from legendary.utils.config import LGDConf
|
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
|
from legendary.utils.lfs import clean_filename
|
||||||
|
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ class LGDLFS:
|
||||||
self.config.set('Legendary', 'disable_update_check', 'false')
|
self.config.set('Legendary', 'disable_update_check', 'false')
|
||||||
if not self.config.has_option('Legendary', 'disable_update_notice'):
|
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', '; 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:
|
try:
|
||||||
self._installed = json.load(open(os.path.join(self.path, 'installed.json')))
|
self._installed = json.load(open(os.path.join(self.path, 'installed.json')))
|
||||||
|
|
|
@ -8,3 +8,7 @@ def is_pyinstaller():
|
||||||
|
|
||||||
def is_windows_or_pyi():
|
def is_windows_or_pyi():
|
||||||
return is_pyinstaller() or os.name == 'nt'
|
return is_pyinstaller() or os.name == 'nt'
|
||||||
|
|
||||||
|
|
||||||
|
def is_windows_mac_or_pyi():
|
||||||
|
return is_pyinstaller() or os.name == 'nt' or sys.platform == 'darwin'
|
||||||
|
|
Loading…
Reference in a new issue