xenoslib 0.1.29.8__tar.gz → 0.1.29.10__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {xenoslib-0.1.29.8/xenoslib.egg-info → xenoslib-0.1.29.10}/PKG-INFO +1 -1
- {xenoslib-0.1.29.8 → xenoslib-0.1.29.10}/xenoslib/about.py +1 -1
- {xenoslib-0.1.29.8 → xenoslib-0.1.29.10}/xenoslib/mail.py +18 -7
- {xenoslib-0.1.29.8 → xenoslib-0.1.29.10/xenoslib.egg-info}/PKG-INFO +1 -1
- {xenoslib-0.1.29.8 → xenoslib-0.1.29.10}/LICENSE +0 -0
- {xenoslib-0.1.29.8 → xenoslib-0.1.29.10}/README.md +0 -0
- {xenoslib-0.1.29.8 → xenoslib-0.1.29.10}/setup.cfg +0 -0
- {xenoslib-0.1.29.8 → xenoslib-0.1.29.10}/setup.py +0 -0
- {xenoslib-0.1.29.8 → xenoslib-0.1.29.10}/xenoslib/__init__.py +0 -0
- {xenoslib-0.1.29.8 → xenoslib-0.1.29.10}/xenoslib/__main__.py +0 -0
- {xenoslib-0.1.29.8 → xenoslib-0.1.29.10}/xenoslib/base.py +0 -0
- {xenoslib-0.1.29.8 → xenoslib-0.1.29.10}/xenoslib/dev.py +0 -0
- {xenoslib-0.1.29.8 → xenoslib-0.1.29.10}/xenoslib/extend.py +0 -0
- {xenoslib-0.1.29.8 → xenoslib-0.1.29.10}/xenoslib/linux.py +0 -0
- {xenoslib-0.1.29.8 → xenoslib-0.1.29.10}/xenoslib/mock.py +0 -0
- {xenoslib-0.1.29.8 → xenoslib-0.1.29.10}/xenoslib/onedrive.py +0 -0
- {xenoslib-0.1.29.8 → xenoslib-0.1.29.10}/xenoslib/win_trayicon.py +0 -0
- {xenoslib-0.1.29.8 → xenoslib-0.1.29.10}/xenoslib/windows.py +0 -0
- {xenoslib-0.1.29.8 → xenoslib-0.1.29.10}/xenoslib.egg-info/SOURCES.txt +0 -0
- {xenoslib-0.1.29.8 → xenoslib-0.1.29.10}/xenoslib.egg-info/dependency_links.txt +0 -0
- {xenoslib-0.1.29.8 → xenoslib-0.1.29.10}/xenoslib.egg-info/requires.txt +0 -0
- {xenoslib-0.1.29.8 → xenoslib-0.1.29.10}/xenoslib.egg-info/top_level.txt +0 -0
|
@@ -72,9 +72,17 @@ class MailFetcher:
|
|
|
72
72
|
continue
|
|
73
73
|
body = email.message_from_bytes(msg[b"BODY[]"])
|
|
74
74
|
subject = str(email.header.make_header(email.header.decode_header(body["Subject"])))
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
if body.is_multipart():
|
|
76
|
+
for part in body.walk():
|
|
77
|
+
if "text/plain" in part.get_content_type():
|
|
78
|
+
payload = part.get_payload(decode=True)
|
|
79
|
+
else:
|
|
80
|
+
payload = body.get_payload(decode=True)
|
|
81
|
+
if isinstance(payload, bytes):
|
|
82
|
+
try:
|
|
83
|
+
payload = payload.decode()
|
|
84
|
+
except UnicodeDecodeError:
|
|
85
|
+
payload = payload.decode("latin1") # failover decode
|
|
78
86
|
body["raw"] = msg[b"BODY[]"]
|
|
79
87
|
body["subjectx"] = subject
|
|
80
88
|
body["payload"] = payload
|
|
@@ -158,9 +166,12 @@ def test_imap():
|
|
|
158
166
|
mail_addr = os.environ["IMAP_ADDR"]
|
|
159
167
|
mail_pwd = os.environ["IMAP_PASS"]
|
|
160
168
|
for email_data in MailFetcher(
|
|
161
|
-
imap_server, mail_addr, mail_pwd, interval=1, days=
|
|
169
|
+
imap_server, mail_addr, mail_pwd, interval=1, days=1, skip_current=False
|
|
162
170
|
):
|
|
163
|
-
print(email_data["subject"])
|
|
171
|
+
# ~ print(email_data["subject"])
|
|
172
|
+
print(email_data["subjectx"])
|
|
173
|
+
print(email_data["payload"])
|
|
174
|
+
# ~ print(email_data.keys())
|
|
164
175
|
|
|
165
176
|
|
|
166
177
|
def test():
|
|
@@ -179,5 +190,5 @@ def test():
|
|
|
179
190
|
|
|
180
191
|
|
|
181
192
|
if __name__ == "__main__":
|
|
182
|
-
|
|
183
|
-
test()
|
|
193
|
+
test_imap()
|
|
194
|
+
# ~ test()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|