Commit Graph

272 Commits

Author SHA1 Message Date
Martin Rusev
d0b3fa495e Update CHANGELOG.md 2018-08-14 17:30:56 +02:00
Martin Rusev
038094e16d Update version and changelog 2018-08-14 08:24:18 -07:00
Martin Rusev
e1eb91b689 Update CHANGELOG.md 2018-08-10 12:34:53 +02:00
Martin Rusev
dbdc96f91e Merge pull request #147 from sblondon/master
fix: readd the flag Deleted to delete a message
2018-07-31 09:53:04 +02:00
Stephane Blondon
4dc43d2ba2 fix: readd the flag Deleted to delete a message 2018-07-31 13:17:18 +08:00
Martin Rusev
fd35764586 Merge pull request #146 from sblondon/remove_a_print
remove a print() call
2018-07-30 11:15:05 +02:00
Stephane Blondon
acfd162c8a remove a print() call 2018-07-30 16:17:18 +08:00
Martin Rusev
9dbf9a9071 Merge pull request #145 from sblondon/add_python_3.7
Library is compatible with python 3.7
2018-07-30 10:17:02 +02:00
Stephane Blondon
0249d59a73 Library is compatible with python 3.7 2018-07-30 16:08:27 +08:00
Martin Rusev
1ad18477f1 Merge pull request #144 from sblondon/add_vendors_directory_to_package
Add vendors directory to package
2018-07-28 17:39:18 +02:00
Martin Rusev
079569dac9 Merge pull request #143 from sblondon/master
Add a forgotten parameter in a log line
2018-07-28 17:39:01 +02:00
Stephane Blondon
7ea534fbda Add imbox/vendors/ directory to python package 2018-07-28 16:13:13 +02:00
Stephane Blondon
db30a8044f Add a forgotten parameter in a log line 2018-07-28 15:43:15 +02:00
Martin Rusev
d5a4e47904 Merge pull request #142 from sblondon/master
Remove the minus in charset if the charset is not found
2018-07-28 15:29:31 +02:00
Stephane Blondon
330a989452 Remove the minus in charset if it's not found to fix Lookup error when searching the appropriate codec 2018-07-28 12:45:19 +02:00
Martin Rusev
aa6739d91f Merge pull request #139 from zevaverbach/vendors
created vendors package
2018-07-27 22:33:10 +02:00
f82ce52220 added type hints for new stuff 2018-07-27 16:00:17 -04:00
87e42a9fdd Merge branch 'vendors' of https://github.com/zevaverbach/imbox into vendors 2018-07-27 15:41:52 -04:00
86cf1fbf9b added basic structure for vendors module, including mostly blank GmailMessages class. 'vendor' is now a kwarg for Imbox, but there's also a lookup dict created in vendors/__init__.py for 'magic' determination of the vendor from the hostname.
added `authentication_error_message` as a class attribute to `Imbox`.  If `Imbox.vendor` is not None, look for a custom authentication error string, and raise it if there's a problem logging in.  The default error value is raised if there is no custom string.

created `name_authentication_string_dict` from all subclasses of `Messages` in `vendors/__init__.py`, for the lookup mentioned above.

Implement architecture discussed in #131, deciding whether to use `Messages` or a subclass of it in `Imbox.messages` based on the `Imbox.vendor` value.  Use the `folder_lookup` dict, present on `Messages` but only filled in on its subclasses, to select the right folder based on a lowercased "standard" name given as the value of `folder`.

created a blank `folder_lookup` on `Messages`.

filled in the first vendor that subclasses `Messages`, `GmailMessages`.  It contains class attributes `authentication_error_message`, `hostname`, `name`, used for purposes described above, as well as `folder_lookup` which is a dict containing aliases, sometimes several, for Gmail's unique folder naming scheme.  These aliases are meant to be "human-friendly" for intuitive `folder` selection in calls to `Imbox.messages`.

fixes #131.

prevent too much bookkeeping in vendors/__init__.py by adding each vendor.__name__ to __all__ from the vendors list.
2018-07-27 15:41:13 -04:00
6f3cc1ab92 prevent too much bookkeeping in vendors/__init__.py by adding each vendor.__name__ to __all__ from the vendors list. 2018-07-27 14:44:35 -04:00
1fbb8511b9 added authentication_error_message as a class attribute to Imbox. If Imbox.vendor is not None, look for a custom authentication error string, and raise it if there's a problem logging in. The default error value is raised if there is no custom string.
created `name_authentication_string_dict` from all subclasses of `Messages` in `vendors/__init__.py`, for the lookup mentioned above.

Implement architecture discussed in #131, deciding whether to use `Messages` or a subclass of it in `Imbox.messages` based on the `Imbox.vendor` value.  Use the `folder_lookup` dict, present on `Messages` but only filled in on its subclasses, to select the right folder based on a lowercased "standard" name given as the value of `folder`.

created a blank `folder_lookup` on `Messages`.

filled in the first vendor that subclasses `Messages`, `GmailMessages`.  It contains class attributes `authentication_error_message`, `hostname`, `name`, used for purposes described above, as well as `folder_lookup` which is a dict containing aliases, sometimes several, for Gmail's unique folder naming scheme.  These aliases are meant to be "human-friendly" for intuitive `folder` selection in calls to `Imbox.messages`.

fixes #131.
2018-07-27 14:31:21 -04:00
Martin Rusev
adf70cbed5 Update .travis.yml 2018-07-27 14:52:06 +02:00
Martin Rusev
c04c340bb7 Update .travis.yml 2018-07-27 14:34:24 +02:00
Martin Rusev
b52d43c496 Update CHANGELOG.md 2018-07-27 10:53:58 +02:00
Martin Rusev
a8440f60ca Update CHANGELOG.md 2018-07-27 10:52:21 +02:00
Martin Rusev
c86cbe766d Update README.rst 2018-07-27 10:38:07 +02:00
Martin Rusev
16a05e15e5 Merge pull request #136 from zevaverbach/stubs
Stubs!
2018-07-27 10:37:08 +02:00
7d11b590d8 added basic structure for vendors module, including mostly blank GmailMessages class. 'vendor' is now a kwarg for Imbox, but there's also a lookup dict created in vendors/__init__.py for 'magic' determination of the vendor from the hostname. 2018-07-26 15:48:31 -04:00
dfca46886f filled in stub files 2018-07-26 15:30:02 -04:00
6d527a2f1d added type hint stubs for all modules 2018-07-26 15:24:20 -04:00
80d6104387 conflict 2018-07-26 15:08:08 -04:00
Martin Rusev
0464a5a74d Merge pull request #134 from zevaverbach/126_128_130
Added flags to messages, moved classes out of __init__.py, and documented that the inbox is where Imbox.messages are from without any folder argument.
2018-07-26 21:06:51 +02:00
5b27fa1b76 removed errant dash that was causing Travis-CI to fail 2018-07-26 11:06:48 -04:00
9cffb51a81 Added missing documentation for all supported query keyword arguments. Fixes #124. Added Pycharm directory to .gitignore.
Fixed var names in documentation of query keywords

moved Messages and Imbox to their own modules, imported Imbox.imbox into __init__.py and put it in __all__. fixes #130.

clarified in documentation and Imbox.messages logging that, unless a folder is specified in the kwargs to Imbox.messages, the returned messages will be from the inbox.  In the documentation this is accomplished exclusively by the var names. fixes #128.

amended `8df7d7c` to reflect manual changes made to `README.rst` in current master, but also added `inbox_` to several var names to make that explicit in the documentation.  Added flags to messages returned by `fetch_email_by_uid`, using the new function `parse_flags` in `parser.py`.  Fixes #126.

added TODO back into query.py
2018-07-26 10:50:10 -04:00
Martin Rusev
06aa4e054b Update README.rst 2018-07-26 14:47:02 +02:00
Martin Rusev
63bddbd73c Update README.rst 2018-07-26 14:45:34 +02:00
2838639bfa conflict in .gitignore 2018-07-25 14:25:14 -04:00
Martin Rusev
34149efed5 Merge pull request #129 from zevaverbach/encapsulate_generator
Created Message class to encapsulate the "messages" generator
2018-07-25 19:46:49 +02:00
73fafcb368 made Messages methods private, as well as uid_list. 2018-07-25 12:11:59 -04:00
8e26e92a39 Moved query_ids from Imbox to Messages.
Moved `fetch_list` to `Messages` and renamed `fetch_email_list`, moving assignment of uid_list to the constructor of `Messages`.

Moved `fetch_by_uid` from `Imbox` to a pure function in `parser` module.

Replaced call to `Imbox.fetch_list` with a call to `Messages` instead.

created `Messages` class, which encapsulates the generator `Messages.fetch_email_list`, while also implementing `__len__` to show how many emails match a given query, and `__iter__` to refresh the `fetch_email_list` generator when it's exhausted.  It also implements `__getitem__` to support indexing of the emails matching a query.  Messages requires the `connection` and `parser_policy` established in `Imbox` and accepts arbitrary keyword arguments, which it uses in the IMAP query as well as in the `__repr__`.
2018-07-25 11:48:19 -04:00
635d15441e shortened up the ImapTransport constructor, a couple of similar cleanups 2018-07-25 09:00:21 -04:00
55f64a1922 removed some unused args, renamed to avoid shadowing a name in the global scope. 2018-07-25 08:46:59 -04:00
71942a69e8 fixed var names in documentation of query keywords 2018-07-25 08:27:40 -04:00
b4cb03e145 added Pycharm directory to .gitignore 2018-07-25 08:24:05 -04:00
b53a1e6837 Added missing documentation for all supported query keyword arguments. Fixes #124. 2018-07-25 08:22:50 -04:00
Martin Rusev
a1801af56e Merge pull request #119 from sblondon/factorize-version
Reuse __version__ for the library version
2018-04-05 10:21:07 +02:00
Stephane Blondon
6a0da4b105 reuse __version__ for the library version 2018-04-04 18:27:27 +02:00
Martin Rusev
5d09b6f3e4 Merge pull request #117 from sblondon/fix-encoding-in-logger
Fix encoding in logger
2018-04-04 15:43:56 +02:00
Stephane Blondon
ecb62b585c refactoring: string formatting more readable 2018-03-21 18:31:08 +01:00
Stephane Blondon
cbb46ef078 fix decoding of sender e-mail if badly encoded 2018-03-21 18:24:59 +01:00