1
1
import os
2
2
from collections .abc import Callable
3
3
from concurrent .futures import Future , ThreadPoolExecutor
4
- from hashlib import file_digest , sha256
4
+ from hashlib import sha256
5
5
6
6
try :
7
7
from importlib .resources .abc import Traversable
8
8
except ModuleNotFoundError :
9
9
from importlib .abc import Traversable
10
10
11
- from http import HTTPMethod , HTTPStatus
11
+ from http import HTTPStatus
12
12
from pathlib import Path
13
13
from secrets import token_urlsafe
14
14
from shutil import move , rmtree
21
21
from urllib3 .poolmanager import PoolManager
22
22
from urllib3 .response import BaseHTTPResponse
23
23
24
- from umu .umu_consts import UMU_CACHE , UMU_LOCAL
24
+ from umu .umu_consts import UMU_CACHE , UMU_LOCAL , HTTPMethod
25
25
from umu .umu_log import log
26
26
from umu .umu_util import (
27
27
extract_tarfile ,
28
+ file_digest ,
28
29
has_umu_setup ,
29
30
run_zenity ,
30
31
write_file_chunks ,
@@ -139,7 +140,7 @@ def _install_umu(
139
140
140
141
# Get the digest for the runtime archive
141
142
resp = http_pool .request (
142
- HTTPMethod .GET , f"{ host } { endpoint } /SHA256SUMS{ token } "
143
+ HTTPMethod .GET . value , f"{ host } { endpoint } /SHA256SUMS{ token } "
143
144
)
144
145
if resp .status != HTTPStatus .OK :
145
146
err : str = (
@@ -155,7 +156,7 @@ def _install_umu(
155
156
# Get BUILD_ID.txt. We'll use the value to identify the file when cached.
156
157
# This will guarantee we'll be picking up the correct file when resuming
157
158
resp = http_pool .request (
158
- HTTPMethod .GET , f"{ host } { endpoint } /BUILD_ID.txt{ token } "
159
+ HTTPMethod .GET . value , f"{ host } { endpoint } /BUILD_ID.txt{ token } "
159
160
)
160
161
if resp .status != HTTPStatus .OK :
161
162
err : str = (
@@ -185,7 +186,7 @@ def _install_umu(
185
186
log .info ("Downloading %s (latest), please wait..." , variant )
186
187
187
188
resp = http_pool .request (
188
- HTTPMethod .GET ,
189
+ HTTPMethod .GET . value ,
189
190
f"{ host } { endpoint } /{ archive } { token } " ,
190
191
preload_content = False ,
191
192
headers = headers ,
@@ -401,7 +402,7 @@ def _update_umu(
401
402
f"{ host } { endpoint } /SteamLinuxRuntime_{ codename } .VERSIONS.txt{ token } "
402
403
)
403
404
log .debug ("Sending request to '%s' for 'VERSIONS.txt'..." , url )
404
- resp = http_pool .request (HTTPMethod .GET , url )
405
+ resp = http_pool .request (HTTPMethod .GET . value , url )
405
406
if resp .status != HTTPStatus .OK :
406
407
log .error (
407
408
"%s returned the status: %s" , resp .getheader ("Host" ), resp .status
@@ -539,7 +540,7 @@ def _restore_umu_platformid(
539
540
540
541
# Make the request to the VERSIONS.txt endpoint. It's fine to hit the
541
542
# cache for this endpoint, as it differs to the latest-beta endpoint
542
- resp = http_pool .request (HTTPMethod .GET , f"{ host } { url } { versions } " )
543
+ resp = http_pool .request (HTTPMethod .GET . value , f"{ host } { url } { versions } " )
543
544
if resp .status != HTTPStatus .OK :
544
545
log .error (
545
546
"%s returned the status: %s" ,
0 commit comments