Skip to content

Commit

Permalink
chore: configでaccount_idを保持しないように
Browse files Browse the repository at this point in the history
  • Loading branch information
yupix committed Feb 24, 2024
1 parent ed8275a commit ca30721
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
7 changes: 1 addition & 6 deletions mipac/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""MiPACで使用する設定を保持するクラスを定義するモジュールです"""
"""MiPACで使用する設定を保持するクラスを定義するモジュール"""

from dataclasses import dataclass
from typing import Self
Expand Down Expand Up @@ -30,7 +30,6 @@ def __init__(
is_ssl: bool = True,
cache: CacheConfigData | None = None,
) -> None:
self.account_id: str = ""
self.is_ssl: bool = is_ssl
self.host: str = host
self.cache: CacheConfig = CacheConfig(cache or CacheConfigData())
Expand All @@ -41,7 +40,6 @@ def from_dict(
host: str | None = None,
is_ssl: bool | None = None,
cache: CacheConfigData | None = None,
account_id: str | None = None,
) -> Self:
"""dictから設定を更新します
Expand All @@ -53,8 +51,6 @@ def from_dict(
サーバーがsslかどうか, by default None
cache : CacheConfigData | None, optional
キャッシュの設定, by default None
account_id : str | None, optional
自身のアカウントID, by default None
Returns
-------
Expand All @@ -65,7 +61,6 @@ def from_dict(
self.is_ssl = is_ssl if is_ssl is not None else self.is_ssl
if cache:
self.cache = CacheConfig(cache)
self.account_id = account_id or self.account_id
return self


Expand Down
1 change: 0 additions & 1 deletion mipac/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,5 +128,4 @@ async def login(self) -> IMeDetailedSchema | None:
self._session = aiohttp.ClientSession(ws_response_class=MisskeyClientWebSocketResponse)
if self._token:
data: IMeDetailedSchema = await self.request(Route("POST", "/api/i"), auth=True)
config.from_dict(account_id=data["id"])
return data

0 comments on commit ca30721

Please sign in to comment.