myl 0.4__tar.gz → 0.6__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: myl
3
- Version: 0.4
3
+ Version: 0.6
4
4
  Summary: Dead simple IMAP CLI client
5
5
  Author-email: Philipp Schmitt <philipp@schmitt.co>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: myl
3
- Version: 0.4
3
+ Version: 0.6
4
4
  Summary: Dead simple IMAP CLI client
5
5
  Author-email: Philipp Schmitt <philipp@schmitt.co>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -17,7 +17,11 @@ def parse_args():
17
17
  parser.add_argument("-P", "--port", help="IMAP server port", default=143)
18
18
  parser.add_argument("--starttls", help="Start TLS", action="store_true")
19
19
  parser.add_argument(
20
- "-c", "--count", help="Number of messages to fetch", default=10, type=int
20
+ "-c",
21
+ "--count",
22
+ help="Number of messages to fetch",
23
+ default=10,
24
+ type=int,
21
25
  )
22
26
  parser.add_argument(
23
27
  "-m", "--mark-seen", help="Mark seen", action="store_true"
@@ -32,6 +36,7 @@ def parse_args():
32
36
  "-t", "--no-title", help="Do not show title", action="store_true"
33
37
  )
34
38
  parser.add_argument("-f", "--folder", help="IMAP folder", default="INBOX")
39
+ parser.add_argument("-S", "--search", help="Search string", default="ALL")
35
40
  parser.add_argument("-w", "--wrap", help="Wrap text", action="store_true")
36
41
  parser.add_argument("-H", "--html", help="Show HTML", action="store_true")
37
42
  parser.add_argument("MAILID", help="Mail ID to fetch", nargs="?")
@@ -62,20 +67,21 @@ def main():
62
67
  args.username, args.password, args.folder
63
68
  ) as mailbox:
64
69
  if args.MAILID:
65
- msg = [
66
- x
67
- for x in mailbox.fetch(
70
+ msg = next(
71
+ mailbox.fetch(
68
72
  f"UID {args.MAILID}", mark_seen=args.mark_seen
69
73
  )
70
- ][0]
74
+ )
71
75
  print(msg.text if not args.html else msg.html)
72
76
  return 0
73
77
 
74
78
  for msg in mailbox.fetch(
79
+ criteria=args.search,
75
80
  reverse=True,
76
81
  bulk=True,
77
82
  limit=args.count,
78
83
  mark_seen=args.mark_seen,
84
+ headers_only=True,
79
85
  ):
80
86
  table.add_row(
81
87
  msg.uid if msg.uid else "???",
@@ -19,7 +19,7 @@ dependencies = [
19
19
  "imap_tools",
20
20
  "rich"
21
21
  ]
22
- version = "0.4"
22
+ version = "0.6"
23
23
 
24
24
  [tool.black]
25
25
  line-length = 79
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