mirror of
https://github.com/denizsafak/abogen.git
synced 2026-07-18 21:50:28 +02:00
chore: normalize line endings to LF, add .gitattributes
- Add .gitattributes with text=auto eol=lf for all text files - Renormalize all files in index to LF line endings - Fixes massive whitespace-only diffs between main and feature branch
This commit is contained in:
@@ -1,46 +1,46 @@
|
||||
"""Host context for the TTS Plugin Architecture.
|
||||
|
||||
This module defines the HostContext dataclass that provides minimal
|
||||
host services to plugins. It is the only interface through which
|
||||
plugins can access host functionality.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from typing import Protocol, runtime_checkable
|
||||
|
||||
|
||||
@runtime_checkable
|
||||
class HttpClient(Protocol):
|
||||
"""Protocol for HTTP client provided by host.
|
||||
|
||||
Plugins can use this for network requests (e.g., API-based engines).
|
||||
"""
|
||||
|
||||
def get(self, url: str, **kwargs: object) -> object:
|
||||
"""Perform an HTTP GET request."""
|
||||
...
|
||||
|
||||
def post(self, url: str, **kwargs: object) -> object:
|
||||
"""Perform an HTTP POST request."""
|
||||
...
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class HostContext:
|
||||
"""Minimal host context provided to plugins.
|
||||
|
||||
Contains only essential host services. No business logic.
|
||||
|
||||
Attributes:
|
||||
config_dir: Directory for API keys, preferences, and configuration.
|
||||
logger: Logger for plugin logging.
|
||||
http_client: HTTP client for network requests.
|
||||
"""
|
||||
|
||||
config_dir: Path
|
||||
logger: logging.Logger
|
||||
http_client: HttpClient
|
||||
"""Host context for the TTS Plugin Architecture.
|
||||
|
||||
This module defines the HostContext dataclass that provides minimal
|
||||
host services to plugins. It is the only interface through which
|
||||
plugins can access host functionality.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
from typing import Protocol, runtime_checkable
|
||||
|
||||
|
||||
@runtime_checkable
|
||||
class HttpClient(Protocol):
|
||||
"""Protocol for HTTP client provided by host.
|
||||
|
||||
Plugins can use this for network requests (e.g., API-based engines).
|
||||
"""
|
||||
|
||||
def get(self, url: str, **kwargs: object) -> object:
|
||||
"""Perform an HTTP GET request."""
|
||||
...
|
||||
|
||||
def post(self, url: str, **kwargs: object) -> object:
|
||||
"""Perform an HTTP POST request."""
|
||||
...
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class HostContext:
|
||||
"""Minimal host context provided to plugins.
|
||||
|
||||
Contains only essential host services. No business logic.
|
||||
|
||||
Attributes:
|
||||
config_dir: Directory for API keys, preferences, and configuration.
|
||||
logger: Logger for plugin logging.
|
||||
http_client: HTTP client for network requests.
|
||||
"""
|
||||
|
||||
config_dir: Path
|
||||
logger: logging.Logger
|
||||
http_client: HttpClient
|
||||
|
||||
Reference in New Issue
Block a user