diff --git a/README.rst b/README.rst index 7f6c593..da29dd1 100644 --- a/README.rst +++ b/README.rst @@ -1,27 +1,32 @@ .. http://docutils.sourceforge.net/docs/user/rst/quickref.html +.. |nbsp| unicode:: 0xA0 + :trim: + imap_tools 📧 ============= -Work with email by IMAP: +High level lib for work with email by IMAP: - Basic message operations: fetch, uids, numbers - Parsed email message attributes -- Query builder for searching emails +- Query builder for search criteria - Actions with emails: copy, delete, flag, move, append - Actions with folders: list, set, get, create, exists, rename, subscribe, delete, status - IDLE commands: start, poll, stop, wait - Exceptions on failed operations -- No external dependencies +- No external dependencies, tested .. image:: https://img.shields.io/pypi/dm/imap_tools.svg?style=social -=============== =============================================================== +=============== ================================================================================================ Python version 3.5+ License Apache-2.0 PyPI https://pypi.python.org/pypi/imap_tools/ -RFC `IMAP4.1 `_, `EMAIL `_, `IMAP related RFCs `_ -=============== =============================================================== +RFC `IMAP4.1 `_, + `EMAIL `_, + `IMAP related RFCs `_ +=============== ================================================================================================ .. contents:: @@ -172,9 +177,9 @@ See `query examples `_, `NickC-NZ `_, `mweinelt `_, -`lucbouge `_ +`lucbouge `_, +`JacquelinCharbonnel `_ Donate ------ - -💰 You may `donate `_, if this library helped you. +`✋ I want to help this library `_ diff --git a/docs/donate.rst b/docs/donate.rst index 0aec616..a0de22c 100644 --- a/docs/donate.rst +++ b/docs/donate.rst @@ -1,14 +1,4 @@ -My PayPal 💰 - | https://paypal.me/KaukinVK - | KaukinVK@ya.ru - -Thanks to all who donated 🎉 - It is really nice. - -Targeted fundraising 🎯 - | 3k$ for create documentation. Style: https://alabaster.readthedocs.io/en/latest/ - | Considering the dynamics - in ~100 years :D - | So you'd better buy strings for my balalaika and meat for my bear. - -Do not forget to star imap_tools project ⭐ - https://github.com/ikvk/imap_tools +1. If you find a bug or figure out how to improve the library - create an issue / merge request 🎯 +2. If you haven't found any errors and haven't figured out how to improve, try to help other open projects that you use ✋ +3. Star the project ⭐ +4. If you have nowhere to put your money, spend it on your family, friends, loved ones, or people around you 💰 diff --git a/docs/release_notes.rst b/docs/release_notes.rst index 4531bdd..6fca48d 100644 --- a/docs/release_notes.rst +++ b/docs/release_notes.rst @@ -1,7 +1,11 @@ +0.55.0 +====== +* Fixed query builder bug with key - "header" and value - [Header] + 0.54.0 ====== * EmailAddress full is property now, parse_email_addresses fixed -* Added MailBoxTls into __init__ +* Added MailBoxTls into __init__.py * Fixed tls.py example, rename examples, added basic.py example 0.53.0 diff --git a/imap_tools/__init__.py b/imap_tools/__init__.py index 454a14b..89a2cba 100644 --- a/imap_tools/__init__.py +++ b/imap_tools/__init__.py @@ -10,4 +10,4 @@ from .utils import EmailAddress from .errors import * -__version__ = '0.54.0' +__version__ = '0.55.0' diff --git a/imap_tools/query.py b/imap_tools/query.py index 2472d64..b151ac1 100644 --- a/imap_tools/query.py +++ b/imap_tools/query.py @@ -24,6 +24,9 @@ def __init__(self, name: str, value: str): def __str__(self): return '{0.name}: {0.value}'.format(self) + def __lt__(self, other): + return '{0.name}{0.value}'.format(self) < '{0.name}{0.value}'.format(other) + class UidRange: """ @@ -82,7 +85,7 @@ def __init__( recent: Optional[bool] = None, all: Optional[bool] = None, # noqa uid: Optional[Union[str, Iterable[str], UidRange]] = None, - header: Optional[Header] = None, + header: Optional[Union[Header, List[Header]]] = None, gmail_label: Optional[Union[str, List[str]]] = None): # todo newline after drop 3.5 self.converted_strings = converted_strings for val in converted_strings: diff --git a/tests/test_query.py b/tests/test_query.py index dc8391d..47de929 100644 --- a/tests/test_query.py +++ b/tests/test_query.py @@ -65,6 +65,7 @@ def test_converters(self): self.assertEqual(A(all=True), '(ALL)') self.assertEqual(A(header=H('X-Google-Smtp-Source', '123')), '(HEADER "X-Google-Smtp-Source" "123")') + self.assertEqual(A(header=[H('b', '1'), H('a', '2')]), '(HEADER "a" "2" HEADER "b" "1")') self.assertEqual(A(uid='1,2'), '(UID 1,2)') self.assertEqual(A(uid=['3', '4']), '(UID 3,4)') self.assertEqual(A(uid=['3', '4:*']), '(UID 3,4:*)')