diff --git a/deltachat-rpc-client/src/deltachat_rpc_client/account.py b/deltachat-rpc-client/src/deltachat_rpc_client/account.py index 86ee9addb..b1e9fea63 100644 --- a/deltachat-rpc-client/src/deltachat_rpc_client/account.py +++ b/deltachat-rpc-client/src/deltachat_rpc_client/account.py @@ -20,7 +20,7 @@ class Account: id: int @property - def _rpc(self) -> Rpc: + def _rpc(self) -> "Rpc": return self.manager.rpc async def wait_for_event(self) -> AttrDict: diff --git a/deltachat-rpc-client/src/deltachat_rpc_client/chat.py b/deltachat-rpc-client/src/deltachat_rpc_client/chat.py index 443927b38..7dac7d2f4 100644 --- a/deltachat-rpc-client/src/deltachat_rpc_client/chat.py +++ b/deltachat-rpc-client/src/deltachat_rpc_client/chat.py @@ -22,7 +22,7 @@ class Chat: id: int @property - def _rpc(self) -> Rpc: + def _rpc(self) -> "Rpc": return self.account._rpc async def delete(self) -> None: @@ -218,8 +218,8 @@ class Chat: async def get_locations( self, contact: Optional[Contact] = None, - timestamp_from: Optional[datetime] = None, - timestamp_to: Optional[datetime] = None, + timestamp_from: Optional["datetime"] = None, + timestamp_to: Optional["datetime"] = None, ) -> List[AttrDict]: """Get list of location snapshots for the given contact in the given timespan.""" time_from = calendar.timegm(timestamp_from.utctimetuple()) if timestamp_from else 0 diff --git a/deltachat-rpc-client/src/deltachat_rpc_client/client.py b/deltachat-rpc-client/src/deltachat_rpc_client/client.py index 1f1a14506..6f816e5de 100644 --- a/deltachat-rpc-client/src/deltachat_rpc_client/client.py +++ b/deltachat-rpc-client/src/deltachat_rpc_client/client.py @@ -39,7 +39,7 @@ class Client: def __init__( self, - account: Account, + account: "Account", hooks: Optional[Iterable[Tuple[Callable, Union[type, EventFilter]]]] = None, logger: Optional[logging.Logger] = None, ) -> None: diff --git a/deltachat-rpc-client/src/deltachat_rpc_client/contact.py b/deltachat-rpc-client/src/deltachat_rpc_client/contact.py index 9e9417790..efb3e9297 100644 --- a/deltachat-rpc-client/src/deltachat_rpc_client/contact.py +++ b/deltachat-rpc-client/src/deltachat_rpc_client/contact.py @@ -21,7 +21,7 @@ class Contact: id: int @property - def _rpc(self) -> Rpc: + def _rpc(self) -> "Rpc": return self.account._rpc async def block(self) -> None: diff --git a/deltachat-rpc-client/src/deltachat_rpc_client/deltachat.py b/deltachat-rpc-client/src/deltachat_rpc_client/deltachat.py index aea4ccd1f..c2cecd60d 100644 --- a/deltachat-rpc-client/src/deltachat_rpc_client/deltachat.py +++ b/deltachat-rpc-client/src/deltachat_rpc_client/deltachat.py @@ -13,7 +13,7 @@ class DeltaChat: This is the root of the object oriented API. """ - def __init__(self, rpc: Rpc) -> None: + def __init__(self, rpc: "Rpc") -> None: self.rpc = rpc async def add_account(self) -> Account: diff --git a/deltachat-rpc-client/src/deltachat_rpc_client/events.py b/deltachat-rpc-client/src/deltachat_rpc_client/events.py index 0330c87d9..4896527b9 100644 --- a/deltachat-rpc-client/src/deltachat_rpc_client/events.py +++ b/deltachat-rpc-client/src/deltachat_rpc_client/events.py @@ -82,7 +82,7 @@ class RawEvent(EventFilter): return (self.types, self.func) == (other.types, other.func) return False - async def filter(self, event: AttrDict) -> bool: + async def filter(self, event: "AttrDict") -> bool: if self.types and event.type not in self.types: return False return await self._call_func(event) @@ -120,7 +120,7 @@ class NewMessage(EventFilter): command: Optional[str] = None, is_bot: Optional[bool] = False, is_info: Optional[bool] = None, - func: Optional[Callable[[AttrDict], bool]] = None, + func: Optional[Callable[["AttrDict"], bool]] = None, ) -> None: super().__init__(func=func) self.is_bot = is_bot @@ -159,7 +159,7 @@ class NewMessage(EventFilter): ) return False - async def filter(self, event: AttrDict) -> bool: + async def filter(self, event: "AttrDict") -> bool: if self.is_bot is not None and self.is_bot != event.message_snapshot.is_bot: return False if self.is_info is not None and self.is_info != event.message_snapshot.is_info: @@ -201,7 +201,7 @@ class MemberListChanged(EventFilter): return (self.added, self.func) == (other.added, other.func) return False - async def filter(self, event: AttrDict) -> bool: + async def filter(self, event: "AttrDict") -> bool: if self.added is not None and self.added != event.member_added: return False return await self._call_func(event) @@ -233,7 +233,7 @@ class GroupImageChanged(EventFilter): return (self.deleted, self.func) == (other.deleted, other.func) return False - async def filter(self, event: AttrDict) -> bool: + async def filter(self, event: "AttrDict") -> bool: if self.deleted is not None and self.deleted != event.image_deleted: return False return await self._call_func(event) @@ -258,7 +258,7 @@ class GroupNameChanged(EventFilter): return self.func == other.func return False - async def filter(self, event: AttrDict) -> bool: + async def filter(self, event: "AttrDict") -> bool: return await self._call_func(event) diff --git a/deltachat-rpc-client/src/deltachat_rpc_client/message.py b/deltachat-rpc-client/src/deltachat_rpc_client/message.py index 224931ba1..5ec30961a 100644 --- a/deltachat-rpc-client/src/deltachat_rpc_client/message.py +++ b/deltachat-rpc-client/src/deltachat_rpc_client/message.py @@ -18,7 +18,7 @@ class Message: id: int @property - def _rpc(self) -> Rpc: + def _rpc(self) -> "Rpc": return self.account._rpc async def send_reaction(self, *reaction: str):