This commit is contained in:
Dhinak G
2021-03-01 12:56:57 -05:00
parent 9d151921cc
commit 6b6de4c559

View File

@@ -24,7 +24,7 @@ def human_fmt(num):
def rmtree_handler(func, path, exc_info): def rmtree_handler(func, path, exc_info):
if exc_info[0] == FileNotFoundError: if exc_info[0] == FileNotFoundError:
return return
raise raise # pylint: disable=misplaced-bare-raise
class BuildOpenCore: class BuildOpenCore:
@@ -139,8 +139,6 @@ class BuildOpenCore:
shutil.copy(self.constants.gui_path, self.constants.oc_folder) shutil.copy(self.constants.gui_path, self.constants.oc_folder)
self.config["UEFI"]["Drivers"] = ["OpenCanopy.efi", "OpenRuntime.efi"] self.config["UEFI"]["Drivers"] = ["OpenCanopy.efi", "OpenRuntime.efi"]
plistlib.dump(self.config, Path(self.constants.plist_path).open("wb"), sort_keys=True)
def set_smbios(self): def set_smbios(self):
spoofed_model = self.model spoofed_model = self.model
if self.model in ModelArray.MacBookAir61: if self.model in ModelArray.MacBookAir61:
@@ -203,6 +201,7 @@ class BuildOpenCore:
def cleanup(self): def cleanup(self):
print("- Cleaning up files") print("- Cleaning up files")
plistlib.dump(self.config, Path(self.constants.plist_path).open("wb"), sort_keys=True)
for kext in self.constants.kexts_path.rglob("*.zip"): for kext in self.constants.kexts_path.rglob("*.zip"):
with zipfile.ZipFile(kext) as zip_file: with zipfile.ZipFile(kext) as zip_file:
zip_file.extractall(self.constants.kexts_path) zip_file.extractall(self.constants.kexts_path)