28 Commits

Author SHA1 Message Date
R1kaB3rN
5a28836a8c
ulwgl_dl_util: fix bug for print statements
Co-authored-by: Stelios Tsampas <loathingkernel@gmail.com>

- Do not print to stdout when finding or downloading Proton as it is not intended to be processed directly as input for other applications.

- Related to https://github.com/Open-Wine-Components/ULWGL-launcher/pull/31#issue-2142440694
2024-02-19 10:20:23 -08:00
R1kaB3rN
8af0f0590e
ulwgl_dl_util: close the connection after req
- The connection should be closed manually after making a request.
2024-02-17 20:21:18 -08:00
R1kaB3rN
45d8ce39c2
ulwgl_dl_util: update types 2024-02-17 19:15:29 -08:00
R1kaB3rN
642357280a
ulwgl_dl_util: update comments 2024-02-17 19:07:55 -08:00
R1kaB3rN
811ea0a8b8
ulwgl_dl_util: add types to _cleanup 2024-02-17 19:07:03 -08:00
R1kaB3rN
5e23219c44
ulwgl_dl_util: fix bug when printing tarball in cache
- In the case the cache is empty '  found in: None' can be printed.
2024-02-17 19:04:07 -08:00
R1kaB3rN
88a47e3ea0
ulwgl_dl_util: fix bug when referencing old Proton from cache
- Fixes a logic error by terminating prematurely when referencing an old Proton version that has been saved in the cache
2024-02-17 17:32:58 -08:00
R1kaB3rN
679cbffc2a
ulwgl_dl_util: format 2024-02-17 14:56:05 -08:00
R1kaB3rN
9f2de76c5a
ulwgl_dl_util: prefer creating a var for the Proton dir
- Referencing the tuple element within the array for the tarball name then parsing it was becoming highly error prone/unreadable.
2024-02-17 12:18:43 -08:00
R1kaB3rN
71eaff0ca5
ulwgl_dl_util: change GE-Proton -> ULWGL-Proton 2024-02-17 12:16:27 -08:00
R1kaB3rN
744cedc6b8
ulwgl_dl_util: be smarter about imports 2024-02-17 10:37:12 -08:00
R1kaB3rN
3e5e1e138b
ulwgl_dl_util: delete references to requests module 2024-02-16 18:40:00 -08:00
R1kaB3rN
3a5b4b10f2
ulwgl_dl_util: prefer joining paths 2024-02-16 18:32:03 -08:00
R1kaB3rN
83a59dcf1d
ulwgl_dl_util: refactor _get_from_cache 2024-02-16 18:31:45 -08:00
R1kaB3rN
ecde7f642f
ulwgl_dl_util: prefer using stdlib than requests module for network 2024-02-16 18:31:26 -08:00
R1kaB3rN
f6aa2f31e9
ulwgl_dl_util: update comment 2024-02-16 12:08:49 -08:00
R1kaB3rN
05d7f4d141
ulwgl_dl_util: move var inside block 2024-02-16 11:41:55 -08:00
R1kaB3rN
f24dbc8591
ulwgl_dl_util: print on extraction complete 2024-02-16 11:38:35 -08:00
R1kaB3rN
4691e26f23
ulwgl_dl_util: move download to func 2024-02-16 11:37:52 -08:00
R1kaB3rN
e3563cb8f3
ulwgl_dl_util: move cache to func
- Code block in which the digest mismatched, user interrupt or failure to download/no internet.
2024-02-16 11:37:00 -08:00
R1kaB3rN
fbb60288eb
ulwgl_dl_util: move cache to func 2024-02-16 11:34:25 -08:00
R1kaB3rN
f64b473157
ulwgl_dl_util: move steamcompat to func 2024-02-16 11:32:08 -08:00
R1kaB3rN
08d18203f8
ulwgl_dl_util: handle connection timeout 2024-02-15 23:45:33 -08:00
R1kaB3rN
ba54f167f4
ulwgl_dl_util: handle interrupts whenever extracting
- When extracting from the cache to the compatibilitytools.d directory, be sure to remove the leftover data after the interrupt to avoid future errors.
2024-02-15 23:42:27 -08:00
R1kaB3rN
2512cdc23a
ulwgl_dl_util: add post cleanup routine
- When we're downloading the latest Proton, it's possible the user can interrupt download or extraction process which can lead to corrupted or incomplete files. As a result, in the next run of the launcher, a FileNotFoundError can be falsely raised for the $PROTONPATH/proton file. In the case of an interrupt, be sure to remove the relevant files before we exit.
2024-02-15 19:39:24 -08:00
R1kaB3rN
621b6c1dd5
ulwgl_dl_util: prefer joining Paths 2024-02-15 11:03:22 -08:00
R1kaB3rN
9a116c6a0a
ulwgl_dl_util: fix bug when referring to cache for latest
- Add missing return statement

- Delete property access of name
2024-02-15 11:02:23 -08:00
R1kaB3rN
d1c24b16e6
Add download functionality to ulwgl_run
- When the user does not specify the PROTONPATH, attempt to download the latest Proton if Proton cannot be found in either the Steam compat tools or local cache. Otherwise, prioritize referring to existing ones -- $HOME/.local/share/Steam/compatibilitytools.d and $HOME/.cache/ULWGL.

- Effectively, new installations will always download the latest Proton, while existing ones will simply be warned of a later version. Downloading is avoided if the latest version already exists in the cache, and the cache will be used as a last resort to set the variable. When we're unable to find an existing Proton or download one, we raise an error.
2024-02-15 08:22:23 -08:00