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:
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user