Source code for redditwarp.dark.client_SYNC
from __future__ import annotations
from typing import TYPE_CHECKING, TypeVar
if TYPE_CHECKING:
from ..core.http_client_SYNC import HTTPClient
from .core.http_client_SYNC import build_reddit_http_client
[docs]class Client:
_TSelf = TypeVar('_TSelf', bound='Client')
[docs] @classmethod
def from_http(cls: type[_TSelf], http: HTTPClient) -> _TSelf:
self = cls.__new__(cls)
self._init(http)
return self
def __init__(self) -> None:
http = build_reddit_http_client()
self._init(http)
def _init(self, http: HTTPClient) -> None:
self.http: HTTPClient = http
("")
from .siteprocs.SYNC import Procedures
self.p: Procedures = Procedures(self.http)
DarkClient = Client