mirror of
https://github.com/chatmail/core.git
synced 2026-05-20 15:26:30 +03:00
fix mypy errors
This commit is contained in:
@@ -10,6 +10,7 @@ from imap_tools import MailBox, MailBoxTls, errors, AND, Header, MailMessageFlag
|
|||||||
import imaplib
|
import imaplib
|
||||||
import deltachat
|
import deltachat
|
||||||
from deltachat import const, Account
|
from deltachat import const, Account
|
||||||
|
from typing import List
|
||||||
|
|
||||||
|
|
||||||
FLAGS = b'FLAGS'
|
FLAGS = b'FLAGS'
|
||||||
@@ -118,7 +119,7 @@ class DirectImap:
|
|||||||
if foldername:
|
if foldername:
|
||||||
return self.select_folder(foldername)
|
return self.select_folder(foldername)
|
||||||
|
|
||||||
def list_folders(self) -> [str]:
|
def list_folders(self) -> List[str]:
|
||||||
""" return list of all existing folder names"""
|
""" return list of all existing folder names"""
|
||||||
assert not self._idling
|
assert not self._idling
|
||||||
return [folder.name for folder in self.conn.folder.list()]
|
return [folder.name for folder in self.conn.folder.list()]
|
||||||
@@ -133,11 +134,11 @@ class DirectImap:
|
|||||||
if expunge:
|
if expunge:
|
||||||
self.conn.expunge()
|
self.conn.expunge()
|
||||||
|
|
||||||
def get_all_messages(self) -> [MailMessage]:
|
def get_all_messages(self) -> List[MailMessage]:
|
||||||
assert not self._idling
|
assert not self._idling
|
||||||
return [mail for mail in self.conn.fetch()]
|
return [mail for mail in self.conn.fetch()]
|
||||||
|
|
||||||
def get_unread_messages(self) -> [str]:
|
def get_unread_messages(self) -> List[str]:
|
||||||
assert not self._idling
|
assert not self._idling
|
||||||
return [msg.uid for msg in self.conn.fetch(AND(seen=False))]
|
return [msg.uid for msg in self.conn.fetch(AND(seen=False))]
|
||||||
|
|
||||||
@@ -196,7 +197,7 @@ class DirectImap:
|
|||||||
self._idling = True
|
self._idling = True
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def idle_check(self, terminate=False, timeout=60) -> [bytes]:
|
def idle_check(self, terminate=False, timeout=60) -> List[bytes]:
|
||||||
""" (blocking) wait for next idle message from server. """
|
""" (blocking) wait for next idle message from server. """
|
||||||
assert self._idling
|
assert self._idling
|
||||||
self.account.log("imap-direct: calling idle_check")
|
self.account.log("imap-direct: calling idle_check")
|
||||||
|
|||||||
Reference in New Issue
Block a user