mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-20 22:20:53 +10:00
Add basic download progress
This commit is contained in:
@@ -10,7 +10,9 @@ from __future__ import print_function
|
|||||||
import binascii
|
import binascii
|
||||||
import plistlib
|
import plistlib
|
||||||
import shutil
|
import shutil
|
||||||
|
import signal
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
import uuid
|
import uuid
|
||||||
import zipfile
|
import zipfile
|
||||||
import os
|
import os
|
||||||
@@ -251,8 +253,12 @@ class PatchSysVolume:
|
|||||||
self.download_files()
|
self.download_files()
|
||||||
|
|
||||||
def download_files(self):
|
def download_files(self):
|
||||||
|
utilities.cls()
|
||||||
print("- Downloading Apple binaries")
|
print("- Downloading Apple binaries")
|
||||||
subprocess.run(f"curl -L {self.constants.url_apple_binaries} --output {self.constants.payload_apple_root_path_zip}".split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode()
|
popen_oclp = subprocess.Popen(f"curl -S -L {self.constants.url_apple_binaries} --output {self.constants.payload_apple_root_path_zip}".split(), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
|
||||||
|
for stdout_line in iter(popen_oclp.stdout.readline, ""):
|
||||||
|
print(stdout_line, end="")
|
||||||
|
popen_oclp.stdout.close()
|
||||||
if self.constants.payload_apple_root_path_zip.exists():
|
if self.constants.payload_apple_root_path_zip.exists():
|
||||||
print("- Download completed")
|
print("- Download completed")
|
||||||
print("- Unzipping download...")
|
print("- Unzipping download...")
|
||||||
@@ -262,6 +268,7 @@ class PatchSysVolume:
|
|||||||
os.rename(self.constants.payload_apple_root_path_unzip, self.constants.payload_apple_root_path)
|
os.rename(self.constants.payload_apple_root_path_unzip, self.constants.payload_apple_root_path)
|
||||||
print("- Binaries downloaded to:")
|
print("- Binaries downloaded to:")
|
||||||
print(self.constants.payload_path)
|
print(self.constants.payload_path)
|
||||||
|
input("Press [ENTER] to continue")
|
||||||
except zipfile.BadZipFile:
|
except zipfile.BadZipFile:
|
||||||
print("- Couldn't unzip")
|
print("- Couldn't unzip")
|
||||||
os.remove(self.constants.payload_apple_root_path_zip)
|
os.remove(self.constants.payload_apple_root_path_zip)
|
||||||
|
|||||||
Reference in New Issue
Block a user