Skip to content

Commit

Permalink
Refactor code to improve readability and remove redundant lines
Browse files Browse the repository at this point in the history
  • Loading branch information
gautam-404 committed Mar 20, 2024
1 parent f416def commit eeea97e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions mesaport/Installer/choice.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,11 @@ def choose_ver(ostype, ver=''):

if ostype == "Linux":
sdk = mesaurls.linux_sdk_urls.get(ver).split('-')[-1][:-7]
mesa = mesaurls.mesa_urls.get(ver).split('-')[-1][:-4]
elif ostype == "macOS-Intel":
sdk = mesaurls.mac_intel_sdk_urls.get(ver).split('-')[-1][:-4]
mesa = mesaurls.mesa_urls.get(ver).split('-')[-1][:-4]
elif ostype == "macOS-ARM":
sdk = mesaurls.mac_arm_sdk_urls.get(ver).split('-')[-1][:-4]
mesa = mesaurls.mesa_urls.get(ver).split('-')[-1][:-4]
mesa = mesaurls.mesa_urls.get(ver).split('/')[-1].split('r')[-1][:-4]
print("The following will be installed:")
print(f"MESA SDK version: [green b]{sdk}[/green b]")
print(f"MESA version: [green b]{mesa}[/green b]\n")
Expand Down
2 changes: 1 addition & 1 deletion mesaport/Installer/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def check_n_download(self, filepath, url, text="Downloading..."):
headers = {
"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0",
}
response = requests.get(url, headers=headers, stream=True, timeout=10)
response = requests.get(url, headers=headers, stream=True)
response.raise_for_status()
total = float(response.headers.get('content-length', 0))
if os.path.exists(filepath) and total == os.path.getsize(filepath):
Expand Down

0 comments on commit eeea97e

Please sign in to comment.