mirror of
https://github.com/platomav/BIOSUtilities.git
synced 2025-05-09 13:52:00 -04:00

New "package" flow, arguments now provided during utility call (README) New "main" flow, using old "run_utility" method of BIOSUtility (README) Removed "run_utility" and "show_version" methods from base BIOSUtility Removed argparse argument parsing logic from base BIOSUtility class Removed notion of "pause" (i.e. user action) from BIOSUtility logic Adjusted the README with usage info for "main" and "package" flows
27 lines
857 B
Python
27 lines
857 B
Python
#!/usr/bin/env python3 -B
|
|
# coding=utf-8
|
|
|
|
"""
|
|
Copyright (C) 2022-2024 Plato Mavropoulos
|
|
"""
|
|
|
|
|
|
class BIOSUtility:
|
|
""" Base utility class for BIOSUtilities """
|
|
|
|
TITLE: str = 'BIOS Utility'
|
|
|
|
def __init__(self, input_object: str | bytes | bytearray = b'', extract_path: str = '', padding: int = 0) -> None:
|
|
self.input_object: str | bytes | bytearray = input_object
|
|
self.extract_path: str = extract_path
|
|
self.padding: int = padding
|
|
|
|
def check_format(self) -> bool:
|
|
""" Check if input object is of specific supported format """
|
|
|
|
raise NotImplementedError(f'Method "check_format" not implemented at {__name__}')
|
|
|
|
def parse_format(self) -> bool:
|
|
""" Process input object as a specific supported format """
|
|
|
|
raise NotImplementedError(f'Method "parse_format" not implemented at {__name__}')
|