Fixes: 1) Ensure logging conditions are guarded by proper vendor and attribute checks; 2) Correct `__str__` method fallback logic for `VendorManager`; Extra: 1) Update dependencies including `docutils` to 0.21.2, `psutil` to 7.1.2, and `pip` to >=25.3; 2) Clean up `pyproject.toml` and `uv.lock` with refined version specifications and added new entries; 3) Refactor import statements and remove redundant code; 4) Upgrade Python version to 3.13 in config.
20 lines
452 B
Python
20 lines
452 B
Python
from enum import Enum
|
|
from importlib import import_module
|
|
from typing import Any
|
|
|
|
|
|
def create_object(module_name: str, class_name: str, *args: list[Any], **kwargs: dict[Any, Any]) -> Any:
|
|
module = import_module(module_name)
|
|
|
|
cls = getattr(module, class_name)
|
|
|
|
return cls(*args, **kwargs)
|
|
|
|
|
|
class LogLevel(Enum):
|
|
DEBUG = "debug"
|
|
INFO = "info"
|
|
WARNING = "warning"
|
|
ERROR = "error"
|
|
CRITICAL = "critical"
|
|
TRACE = "trace"
|