update refactoring and add new features

This commit is contained in:
2026-07-24 20:55:58 -07:00
parent 7f12bc7f40
commit 03fbbbcf28
69 changed files with 16332 additions and 17600 deletions
+2 -6
View File
@@ -1,6 +1,7 @@
from __future__ import annotations
from typing import Any, Dict, Optional
import atexit
import threading
from .HTTP import HTTPClient
@@ -19,6 +20,7 @@ class API:
self.timeout = float(timeout)
self._http_client: Optional[HTTPClient] = None
self._http_client_lock = threading.Lock()
atexit.register(self.close)
def _get_http_client(self) -> HTTPClient:
"""Return a reusable opened HTTP client for this API instance."""
@@ -49,12 +51,6 @@ class API:
pass
self._http_client = None
def __del__(self) -> None:
try:
self.close()
except Exception:
pass
def _get_json(
self,
path: str,
+1 -1
View File
@@ -69,7 +69,7 @@ def run_cmdlet(
) -> CmdletRunResult:
"""Run a single cmdlet programmatically and return structured results.
This is intended for TUI/webapp consumers that want cmdlet behavior without
This is intended for programmatic consumers that want cmdlet behavior without
going through the interactive CLI loop.
Notes: