Enhance OxiAPI and Node classes with type hints and property updates

- Updated the `OxiAPI` class to check for `None` explicitly when setting authentication credentials.
- Added type hints to the `Node` class and introduced a TODO for future enhancements.
- Refactored properties in the `NodeView` class to include type hints and improved handling of optional data retrieval.
This commit is contained in:
IluaAir
2026-03-18 00:15:09 +03:00
parent 1d0f5ed685
commit a107662e99
4 changed files with 21 additions and 15 deletions

View File

@@ -7,11 +7,11 @@ if TYPE_CHECKING:
from requests import Session
# TODO: Add type hints
class Node:
def __init__(self, session: "Session", base_url: str):
self._session = session
self._base_url = base_url
self._data = None
def __call__(self, name: str) -> NodeView:
url = f"{self._base_url}/node/show/{name}"