KeyDive/keydive/vendor.py

35 lines
1011 B
Python
Raw Normal View History

2024-07-06 18:01:47 +00:00
class Vendor:
"""
2024-07-07 14:26:54 +00:00
Represents a Vendor with SDK, OEM, version, and name attributes.
2024-07-06 18:01:47 +00:00
"""
2025-01-11 15:53:20 +00:00
def __init__(self, sdk: int, oem: int, version: str, pattern: str):
2024-07-06 18:01:47 +00:00
"""
Initializes a Vendor instance.
2025-01-19 13:13:07 +00:00
Parameters:
sdk (int): Minimum SDK version required by the vendor.
oem (int): OEM identifier for the vendor.
2024-07-07 14:26:54 +00:00
version (str): Version of the vendor.
2025-01-19 13:13:07 +00:00
pattern (str): Name pattern of the vendor.
2024-07-06 18:01:47 +00:00
"""
2024-07-07 14:26:54 +00:00
self.sdk = sdk
2024-07-06 18:01:47 +00:00
self.oem = oem
self.version = version
2025-01-11 15:53:20 +00:00
self.pattern = pattern
2024-07-06 18:01:47 +00:00
def __repr__(self) -> str:
"""
Returns a string representation of the Vendor instance.
Returns:
2025-01-19 13:13:07 +00:00
str: String representation of the Vendor instance with its attributes.
2024-07-06 18:01:47 +00:00
"""
2025-01-19 13:13:07 +00:00
return "{name}({items})".format(
2024-07-06 18:01:47 +00:00
name=self.__class__.__name__,
2025-01-19 13:13:07 +00:00
items=", ".join([f"{k}={repr(v)}" for k, v in self.__dict__.items()])
2024-07-06 18:01:47 +00:00
)
2025-01-19 13:13:07 +00:00
__all__ = ("Vendor",)