MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / __init__

Method __init__

src/services/web2_mail.py:31–52  ·  view source on GitHub ↗
(self, config: Dict[str, Any] = None, name: str = None)

Source from the content-addressed store, hash-verified

29 }
30
31 def __init__(self, config: Dict[str, Any] = None, name: str = None):
32 super().__init__(EmailServiceType.WEB2, name)
33
34 default_config = {
35 "base_url": self.DEFAULT_BASE_URL,
36 "timeout": 30,
37 "max_retries": 3,
38 }
39 self.config = {**default_config, **(config or {})}
40 self.config["base_url"] = str(self.config.get("base_url") or self.DEFAULT_BASE_URL).rstrip("/")
41
42 http_config = RequestConfig(
43 timeout=int(self.config.get("timeout") or 30),
44 max_retries=int(self.config.get("max_retries") or 3),
45 )
46 self.http_client = HTTPClient(
47 proxy_url=self.DEFAULT_PROXY_URL,
48 config=http_config,
49 )
50 self._mailboxes_by_email: Dict[str, Dict[str, Any]] = {}
51 self._mailboxes_by_token: Dict[str, Dict[str, Any]] = {}
52 self._seen_message_ids: Dict[str, set[str]] = {}
53
54 def _build_headers(self, extra_headers: Optional[Dict[str, str]] = None) -> Dict[str, str]:
55 headers = dict(self.DEFAULT_HEADERS)

Callers

nothing calls this directly

Calls 3

RequestConfigClass · 0.85
HTTPClientClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected