From b42169f980197687658b88c305b3b083c647e4c3 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Wed, 3 Nov 2021 19:29:24 -0600 Subject: [PATCH] Strip unused functions --- OpenCore-Patcher.command | 66 +++++++++------------------------------- 1 file changed, 14 insertions(+), 52 deletions(-) diff --git a/OpenCore-Patcher.command b/OpenCore-Patcher.command index 459eb4162..e848c59b5 100755 --- a/OpenCore-Patcher.command +++ b/OpenCore-Patcher.command @@ -17,7 +17,7 @@ class OpenCoreLegacyPatcher: self.constants = constants.Constants() self.generate_base_data() if utilities.check_cli_args() is None: - self.main_menu(False) + self.main_menu() def generate_base_data(self): self.constants.detected_os = os_probe.detect_kernel_major() @@ -37,33 +37,8 @@ class OpenCoreLegacyPatcher: arguments.arguments().parse_arguments(self.constants) else: print("- No arguments present, loading TUI") - - def first_setup(self): - # Order of operations: - # 1. Build OpenCore - # 2. Download macOS - # 3. Select USB drive - # 4. Format USB drive - # 5. Install OpenCore to ESP - # 6. flash macOS - # 7. Prompt user to reboot - self.constants.walkthrough = True - build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore() - cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).download_macOS() - - def post_install(self): - # Order of operations: - # 1. Build OpenCore - # 2. Prompt drive to install OC to - # 3. Install OpenCore to ESP - # 4. Determine whether root patching needed - # 5. Prompt user to reboot - build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore() - install.tui_disk_installation(self.constants).copy_efi() - cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).PatchVolume - - def main_menu(self, walkthrough): + def main_menu(self): response = None while not (response and response == -1): title = [ @@ -92,31 +67,18 @@ class OpenCoreLegacyPatcher: menu = utilities.TUIMenu(title, "Please select an option: ", in_between=in_between, auto_number=True, top_level=True) - if walkthrough is True: - options = ( - [["First Time Setup", self.first_setup]] - if ((self.constants.custom_model or self.computer.real_model) in model_array.SupportedSMBIOS) or self.constants.allow_oc_everywhere is True - else [] - ) + [ - #["Post-Installation setup", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).closing_message], - ["Change Model", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).change_model], - ["Patcher Settings", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).patcher_settings], - ["Credits", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).credits], - ["Legacy Menu", lambda: self.main_menu(False)], - ] - else: - options = ( - [["Build OpenCore", build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore]] - if ((self.constants.custom_model or self.computer.real_model) in model_array.SupportedSMBIOS) or self.constants.allow_oc_everywhere is True - else [] - ) + [ - ["Install OpenCore to USB/internal drive", install.tui_disk_installation(self.constants).copy_efi], - ["Post-Install Volume Patch", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).PatchVolume], - ["Change Model", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).change_model], - ["Patcher Settings", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).patcher_settings], - ["Installer Creation", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).download_macOS], - ["Credits", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).credits], - ] + options = ( + [["Build OpenCore", build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore]] + if ((self.constants.custom_model or self.computer.real_model) in model_array.SupportedSMBIOS) or self.constants.allow_oc_everywhere is True + else [] + ) + [ + ["Install OpenCore to USB/internal drive", install.tui_disk_installation(self.constants).copy_efi], + ["Post-Install Volume Patch", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).PatchVolume], + ["Change Model", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).change_model], + ["Patcher Settings", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).patcher_settings], + ["Installer Creation", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).download_macOS], + ["Credits", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).credits], + ] for option in options: menu.add_menu_option(option[0], function=option[1])