mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-21 06:30:52 +10:00
Clean up download_file function
This commit is contained in:
@@ -2,6 +2,9 @@
|
|||||||
OCLP-GUI.command
|
OCLP-GUI.command
|
||||||
/payloads/Apple
|
/payloads/Apple
|
||||||
/payloads/*.zip
|
/payloads/*.zip
|
||||||
|
/payloads/BuildManifest.plist
|
||||||
|
/payloads/*.sucatalog
|
||||||
|
/payloads/*.pkg
|
||||||
/payloads/__MACOSX
|
/payloads/__MACOSX
|
||||||
/App
|
/App
|
||||||
/Build-Folder
|
/Build-Folder
|
||||||
|
|||||||
@@ -536,14 +536,6 @@ class amd_ids:
|
|||||||
0x6810, # R7 370 / R9 270X/370X
|
0x6810, # R7 370 / R9 270X/370X
|
||||||
0x6818, # HD 7870
|
0x6818, # HD 7870
|
||||||
0x6819, # HD 7850 / R7 265 / R9 270 1024SP
|
0x6819, # HD 7850 / R7 265 / R9 270 1024SP
|
||||||
# AMDPitcairnGraphicsAccelerator - AMD7000Controller
|
|
||||||
0x6800, # HD 7970M
|
|
||||||
0x6801, # HD 8970M
|
|
||||||
0x6806, # Unknown
|
|
||||||
0x6808, # W7000
|
|
||||||
0x6810, # R7 370 / R9 270X/370X
|
|
||||||
0x6818, # HD 7870
|
|
||||||
0x6819, # HD 7850 / R7 265 / R9 270 1024SP
|
|
||||||
# AMDTahitiGraphicsAccelerator - AMD7000Controller
|
# AMDTahitiGraphicsAccelerator - AMD7000Controller
|
||||||
0x6790, # Unknown
|
0x6790, # Unknown
|
||||||
0x6798, # HD 7970/8970 OEM / R9 280X / D700
|
0x6798, # HD 7970/8970 OEM / R9 280X / D700
|
||||||
|
|||||||
@@ -291,10 +291,7 @@ def get_rom(variable: str, *, decode: bool = False):
|
|||||||
|
|
||||||
|
|
||||||
def download_file(link, location):
|
def download_file(link, location):
|
||||||
print("- Attempting download from following link:")
|
|
||||||
print(link)
|
|
||||||
if Path(location).exists():
|
if Path(location).exists():
|
||||||
print("- Removing old file")
|
|
||||||
Path(location).unlink()
|
Path(location).unlink()
|
||||||
response = requests.get(link, stream=True)
|
response = requests.get(link, stream=True)
|
||||||
with location.open("wb") as file:
|
with location.open("wb") as file:
|
||||||
@@ -303,8 +300,11 @@ def download_file(link, location):
|
|||||||
file.write(chunk)
|
file.write(chunk)
|
||||||
count += len(chunk)
|
count += len(chunk)
|
||||||
cls()
|
cls()
|
||||||
print("- Downloading package")
|
print("####################")
|
||||||
print(f"- {count / 1024 / 1024}MB Downloaded")
|
print("# Downloading file #")
|
||||||
|
print("####################")
|
||||||
|
print(link)
|
||||||
|
print(f"{count / 1024 / 1024}MB Downloaded")
|
||||||
checksum = hashlib.sha256()
|
checksum = hashlib.sha256()
|
||||||
with location.open("rb") as file:
|
with location.open("rb") as file:
|
||||||
chunk = file.read(1024 * 1024 * 16)
|
chunk = file.read(1024 * 1024 * 16)
|
||||||
|
|||||||
Reference in New Issue
Block a user