mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-17 04:40:01 +10:00
Fix Constants type suggestion
This commit is contained in:
@@ -46,9 +46,9 @@ from data import os_data
|
||||
|
||||
|
||||
class PatchSysVolume:
|
||||
def __init__(self, model, versions, hardware_details=None):
|
||||
def __init__(self, model: str, global_constants: constants.Constants, hardware_details: list = None):
|
||||
self.model = model
|
||||
self.constants: constants.Constants() = versions
|
||||
self.constants: constants.Constants = global_constants
|
||||
self.computer = self.constants.computer
|
||||
self.root_mount_path = None
|
||||
self.root_supports_snapshot = utilities.check_if_root_is_apfs_snapshot()
|
||||
@@ -72,7 +72,15 @@ class PatchSysVolume:
|
||||
if Path(self.constants.payload_local_binaries_root_path).exists():
|
||||
shutil.rmtree(self.constants.payload_local_binaries_root_path)
|
||||
|
||||
def _init_pathing(self, custom_root_mount_path=None, custom_data_mount_path=None):
|
||||
def _init_pathing(self, custom_root_mount_path: Path = None, custom_data_mount_path: Path = None):
|
||||
"""
|
||||
Initializes the pathing for root volume patching
|
||||
|
||||
Parameters:
|
||||
custom_root_mount_path (Path): Custom path to mount the root volume
|
||||
custom_data_mount_path (Path): Custom path to mount the data volume
|
||||
|
||||
"""
|
||||
if custom_root_mount_path and custom_data_mount_path:
|
||||
self.mount_location = custom_root_mount_path
|
||||
self.data_mount_location = custom_data_mount_path
|
||||
@@ -83,6 +91,7 @@ class PatchSysVolume:
|
||||
else:
|
||||
self.mount_location = ""
|
||||
self.mount_location_data = ""
|
||||
|
||||
self.mount_extensions = f"{self.mount_location}/System/Library/Extensions"
|
||||
self.mount_application_support = f"{self.mount_location_data}/Library/Application Support"
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ from resources.gui import gui_main
|
||||
|
||||
class AutomaticSysPatch:
|
||||
|
||||
def __init__(self, global_constants: constants.Constants()):
|
||||
self.constants: constants.Constants() = global_constants
|
||||
def __init__(self, global_constants: constants.Constants):
|
||||
self.constants: constants.Constants = global_constants
|
||||
|
||||
|
||||
def start_auto_patch(self):
|
||||
|
||||
@@ -27,9 +27,9 @@ from data import (
|
||||
|
||||
|
||||
class detect_root_patch:
|
||||
def __init__(self, model: str, versions: constants.Constants()):
|
||||
def __init__(self, model: str, global_constants: constants.Constants):
|
||||
self.model = model
|
||||
self.constants: constants.Constants() = versions
|
||||
self.constants: constants.Constants = global_constants
|
||||
self.computer = self.constants.computer
|
||||
|
||||
# GPU Patch Detection
|
||||
|
||||
@@ -14,8 +14,8 @@ from resources import bplist, constants, generate_smbios, utilities
|
||||
|
||||
class sys_patch_helpers:
|
||||
|
||||
def __init__(self, global_constants: constants.Constants()):
|
||||
self.constants: constants.Constants() = global_constants
|
||||
def __init__(self, global_constants: constants.Constants):
|
||||
self.constants: constants.Constants = global_constants
|
||||
|
||||
|
||||
def snb_board_id_patch(self, source_files_path):
|
||||
|
||||
Reference in New Issue
Block a user