Skip to content

Commit

Permalink
some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Dummerle committed Dec 9, 2021
1 parent 5c0e793 commit ab7d209
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions legendary/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,13 @@
import subprocess
import time
import webbrowser

from collections import defaultdict, namedtuple
from distutils.util import strtobool
from logging.handlers import QueueListener
from multiprocessing import freeze_support, Queue as MPQueue
from platform import platform
from sys import exit, stdout, platform as sys_platform

from legendary.utils.selective_dl import get_sdl_appname

from legendary import __version__, __codename__
from legendary.core import LegendaryCore
from legendary.models.exceptions import InvalidCredentialsError
Expand All @@ -30,6 +27,7 @@
from legendary.utils.custom_parser import AliasedSubParsersAction
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

# todo custom formatter for cli logger (clean info, highlighted error/warning)
Expand Down Expand Up @@ -332,7 +330,7 @@ def list_installed(self, args):
print(f' -> Update available! Installed: {game.version}, Latest: {versions[game.app_name]}')
for dlc in installed_dlcs[game.app_name]:
print(f' + {dlc.title} (App name: {dlc.app_name} | Version: {dlc.version}) | '
f'{dlc.install_size / (1024*1024*1024):.02f} GiB)')
f'{dlc.install_size / (1024 * 1024 * 1024):.02f} GiB)')
if dlc.app_name in versions and versions[dlc.app_name] != dlc.version:
print(f' -> Update available! Installed: {dlc.version}, Latest: {versions[dlc.app_name]}')

Expand Down Expand Up @@ -789,7 +787,7 @@ def install_game(self, args):
override_manifest=args.override_manifest,
override_old_manifest=args.override_old_manifest,
override_base_url=args.override_base_url,
platform=args.platform,
platform=args.platform,
file_prefix_filter=args.file_prefix,
file_exclude_filter=args.file_exclude_prefix,
file_install_tag=args.install_tag,
Expand Down Expand Up @@ -1384,7 +1382,7 @@ def info(self, args):
game_infos.append(InfoItem('Title', 'title', game.app_title, game.app_title))
game_infos.append(InfoItem('Latest version', 'version', game.app_version(args.platform),
game.app_version(args.platform)))
all_versions = {k: v.build_version for k,v in game.asset_infos.items()}
all_versions = {k: v.build_version for k, v in game.asset_infos.items()}
game_infos.append(InfoItem('All versions', 'platform_versions', all_versions, all_versions))
# Cloud save support for Mac and Windows
game_infos.append(InfoItem('Cloud saves supported', 'cloud_saves_supported',
Expand Down Expand Up @@ -1580,7 +1578,7 @@ def info(self, args):
tag_download_size.append(dict(tag=tag, size=tag_chunk_size, count=len(tag_chunk_guids)))
tag_chunk_size_human = '{:.02f} GiB'.format(tag_chunk_size / 1024 / 1024 / 1024)
tag_download_size_human.append(f'{human_tag.ljust(longest_tag)} - {tag_chunk_size_human} '
f'(Chunks: {len(tag_chunk_guids)})')
f'(Chunks: {len(tag_chunk_guids)})')

manifest_info.append(InfoItem('Disk size by install tag', 'tag_disk_size',
tag_disk_size_human or 'N/A', tag_disk_size))
Expand Down Expand Up @@ -1893,12 +1891,12 @@ def main():
metavar='<App Name/Manifest URI>')

alias_parser.add_argument('action', help='Action: Add, rename, remove, or list alias(es)',
metavar='<add|rename|remove|list>')
metavar='<add|rename|remove|list>')
alias_parser.add_argument('app_or_alias', help='App name when using "add" or "list" action, '
'existing alias when using "rename" or "remove" action',
metavar='App name/Old alias', nargs='?')
metavar='App name/Old alias', nargs='?')
alias_parser.add_argument('alias', help='New alias when using "add" action',
metavar='New alias', nargs='?')
metavar='New alias', nargs='?')

auth_parser.add_argument('--import', dest='import_egs_auth', action='store_true',
help='Import Epic Games Launcher authentication data (logs out of EGL)')
Expand Down

0 comments on commit ab7d209

Please sign in to comment.