From e076260a1a05c3264123560e3f3c82ceddabcd68 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Thu, 9 Feb 2023 12:36:16 -0700 Subject: [PATCH] Sync docstrings comments --- resources/kdk_handler.py | 10 +++++----- resources/logging_handler.py | 8 +++++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/resources/kdk_handler.py b/resources/kdk_handler.py index 630677219..bfd1be59c 100644 --- a/resources/kdk_handler.py +++ b/resources/kdk_handler.py @@ -124,7 +124,7 @@ class KernelDebugKitObject: """ Fetches the latest KDK for the current macOS version - Args: + Parameters: host_build (str, optional): The build version of the current macOS version. If empty, will use the host_build from the class. Defaults to None. host_version (str, optional): The version of the current macOS version. @@ -295,7 +295,7 @@ class KernelDebugKitObject: Uses Apple's pkg receipt system to verify the original contents of the KDK - Args: + Parameters: kdk_path (Path): Path to KDK Returns: @@ -434,7 +434,7 @@ class KernelDebugKitObject: """ Removes provided KDK - Args: + Parameters: kdk_path (str): Path to KDK """ @@ -465,7 +465,7 @@ class KernelDebugKitObject: """ Removes KDKs that are not in use - Args: + Parameters: exclude_builds (list, optional): Builds to exclude from removal. If None, defaults to host and closest match builds. """ @@ -505,7 +505,7 @@ class KernelDebugKitObject: """ Validates KDK DMG checksum - Args: + Parameters: kdk_dmg_path (str, optional): Path to KDK DMG. Defaults to None. Returns: diff --git a/resources/logging_handler.py b/resources/logging_handler.py index f5a414528..98935024f 100644 --- a/resources/logging_handler.py +++ b/resources/logging_handler.py @@ -26,7 +26,7 @@ class InitializeLoggingSupport: """ - def __init__(self) -> None: + def __init__(self): self.log_filename: str = "OpenCore-Patcher.log" self.log_filepath: Path = None @@ -111,6 +111,10 @@ class InitializeLoggingSupport: StreamHandler's format is used to mimic the default behavior of print() While FileHandler's format is for more in-depth logging + + Parameters: + log_to_file (bool): Whether to log to file or not + """ logging.basicConfig( @@ -125,6 +129,7 @@ class InitializeLoggingSupport: logging.getLogger().handlers[0].setFormatter(logging.Formatter("%(message)s")) logging.getLogger().handlers[1].maxBytes = self.max_file_size + def _attempt_initialize_logging_configuration(self): """ Attempt to initialize logging framework configuration @@ -160,6 +165,7 @@ class InitializeLoggingSupport: sys.excepthook = custom_excepthook threading.excepthook = custom_thread_excepthook + def _restore_original_excepthook(self): """ Restore original traceback handlers