myl 0.8.10__py3-none-any.whl → 0.8.12__py3-none-any.whl
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.
- {myl-0.8.10.dist-info → myl-0.8.12.dist-info}/METADATA +2 -1
- myl-0.8.12.dist-info/RECORD +7 -0
- myl.py +26 -6
- myl-0.8.10.dist-info/RECORD +0 -7
- {myl-0.8.10.dist-info → myl-0.8.12.dist-info}/LICENSE +0 -0
- {myl-0.8.10.dist-info → myl-0.8.12.dist-info}/WHEEL +0 -0
- {myl-0.8.10.dist-info → myl-0.8.12.dist-info}/entry_points.txt +0 -0
- {myl-0.8.10.dist-info → myl-0.8.12.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: myl
|
3
|
-
Version: 0.8.
|
3
|
+
Version: 0.8.12
|
4
4
|
Summary: Dead simple IMAP CLI client
|
5
5
|
Author-email: Philipp Schmitt <philipp@schmitt.co>
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
@@ -690,6 +690,7 @@ License-File: LICENSE
|
|
690
690
|
Requires-Dist: imap-tools <2.0.0,>=1.5.0
|
691
691
|
Requires-Dist: myl-discovery >=0.6.0
|
692
692
|
Requires-Dist: rich <14.0.0,>=13.0.0
|
693
|
+
Requires-Dist: html2text >=2024.2.26
|
693
694
|
|
694
695
|
# 📧 myl
|
695
696
|
|
@@ -0,0 +1,7 @@
|
|
1
|
+
myl.py,sha256=l3hgASE9E3Po7C5pB-yxaFjteMh15GKHwsnW693Z-pc,10591
|
2
|
+
myl-0.8.12.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
3
|
+
myl-0.8.12.dist-info/METADATA,sha256=LkmLWD0Q6gwkDDbDRveC8UFtn4xLCe2EzORSffywUB4,43318
|
4
|
+
myl-0.8.12.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
5
|
+
myl-0.8.12.dist-info/entry_points.txt,sha256=q6nr0Kzim7JzreXQE3BTU4asLh2sx5-D0w1yLBOcHxc,33
|
6
|
+
myl-0.8.12.dist-info/top_level.txt,sha256=Wn88OJVVWyYSsKVoqzlHXxfFxh5IbrJ_Yw-ldNLe7Po,4
|
7
|
+
myl-0.8.12.dist-info/RECORD,,
|
myl.py
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
# coding: utf-8
|
3
|
+
|
1
4
|
import argparse
|
5
|
+
import html2text
|
2
6
|
import json
|
3
7
|
import logging
|
4
8
|
import ssl
|
@@ -69,8 +73,12 @@ def parse_args():
|
|
69
73
|
parser.add_argument(
|
70
74
|
"-u", "--username", help="IMAP username", required=True
|
71
75
|
)
|
72
|
-
parser.
|
73
|
-
|
76
|
+
password_group = parser.add_mutually_exclusive_group(required=True)
|
77
|
+
password_group.add_argument("-p", "--password", help="IMAP password")
|
78
|
+
password_group.add_argument(
|
79
|
+
"--password-file",
|
80
|
+
help="IMAP password (file path)",
|
81
|
+
type=argparse.FileType("r"),
|
74
82
|
)
|
75
83
|
parser.add_argument(
|
76
84
|
"-t", "--no-title", help="Do not show title", action="store_true"
|
@@ -115,6 +123,10 @@ def main():
|
|
115
123
|
)
|
116
124
|
LOGGER.debug(args)
|
117
125
|
|
126
|
+
imap_password = args.password or (
|
127
|
+
args.password_file and args.password_file.read()
|
128
|
+
)
|
129
|
+
|
118
130
|
if args.google:
|
119
131
|
args.server = GMAIL_IMAP_SERVER
|
120
132
|
args.port = GMAIL_IMAP_PORT
|
@@ -128,7 +140,7 @@ def main():
|
|
128
140
|
if args.auto:
|
129
141
|
try:
|
130
142
|
settings = autodiscover(
|
131
|
-
args.username, password=
|
143
|
+
args.username, password=imap_password
|
132
144
|
).get("imap")
|
133
145
|
except Exception:
|
134
146
|
error_msg("Failed to autodiscover IMAP settings")
|
@@ -187,7 +199,7 @@ def main():
|
|
187
199
|
|
188
200
|
try:
|
189
201
|
with mb(**mb_kwargs).login(
|
190
|
-
args.username,
|
202
|
+
args.username, imap_password, args.folder
|
191
203
|
) as mailbox:
|
192
204
|
if args.MAILID:
|
193
205
|
msg = next(
|
@@ -234,7 +246,13 @@ def main():
|
|
234
246
|
)
|
235
247
|
return 0
|
236
248
|
|
237
|
-
|
249
|
+
output = msg.text
|
250
|
+
if args.html:
|
251
|
+
if args.raw:
|
252
|
+
output = msg.html
|
253
|
+
else:
|
254
|
+
output = html2text.html2text(msg.html)
|
255
|
+
print(output)
|
238
256
|
for att in msg.attachments:
|
239
257
|
print(
|
240
258
|
f"📎 Attachment: {att.filename}", file=sys.stderr
|
@@ -283,13 +301,15 @@ def main():
|
|
283
301
|
else "???"
|
284
302
|
),
|
285
303
|
)
|
286
|
-
if
|
304
|
+
if table.row_count >= args.count:
|
287
305
|
break
|
288
306
|
|
289
307
|
if args.json:
|
290
308
|
print_json(json.dumps(json_data))
|
291
309
|
else:
|
292
310
|
console.print(table)
|
311
|
+
if table.row_count == 0:
|
312
|
+
print("[yellow italic]No messages[/yellow italic]", file=sys.stderr)
|
293
313
|
return 0
|
294
314
|
except Exception:
|
295
315
|
console.print_exception(show_locals=True)
|
myl-0.8.10.dist-info/RECORD
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
myl.py,sha256=Fl41na7U0JOiyoebMhLMWSkMHd578sNrpHWZURRL-WM,9894
|
2
|
-
myl-0.8.10.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
3
|
-
myl-0.8.10.dist-info/METADATA,sha256=oLqUBwsPgTLYLpU0rAjQ0dnzRAiST2sDEBM5ECF7WRs,43281
|
4
|
-
myl-0.8.10.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
5
|
-
myl-0.8.10.dist-info/entry_points.txt,sha256=q6nr0Kzim7JzreXQE3BTU4asLh2sx5-D0w1yLBOcHxc,33
|
6
|
-
myl-0.8.10.dist-info/top_level.txt,sha256=Wn88OJVVWyYSsKVoqzlHXxfFxh5IbrJ_Yw-ldNLe7Po,4
|
7
|
-
myl-0.8.10.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|