aboutsummaryrefslogtreecommitdiff
path: root/neomutt
diff options
context:
space:
mode:
authorbozo.kopic <bozo@kopic.xyz>2024-01-08 18:50:10 +0100
committerbozo.kopic <bozo@kopic.xyz>2024-01-08 18:50:10 +0100
commit39abd6b00a427ac4d33564d9a00cde35abe90be8 (patch)
treec92ea389ab832929263612b556f8f141feb9ea1a /neomutt
parent52ee08731eeebed097cf2d17c76597d7ded5b038 (diff)
.
Diffstat (limited to 'neomutt')
-rw-r--r--neomutt/mailboxes.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/neomutt/mailboxes.py b/neomutt/mailboxes.py
new file mode 100644
index 0000000..d685553
--- /dev/null
+++ b/neomutt/mailboxes.py
@@ -0,0 +1,20 @@
+from pathlib import Path
+import sys
+
+
+def main():
+ for inbox_dir in sys.argv[1:]:
+ inbox_dir = Path(inbox_dir).resolve()
+ print(inbox_dir, '', end='')
+
+ for path in sorted(inbox_dir.glob('.*')):
+ if not path.is_dir():
+ continue
+
+ segments = path.name.split('.')
+ print(f'-label "{(len(segments) - 1) * 2 * " "}{segments[-1]}"',
+ path, '', end='')
+
+
+if __name__ == '__main__':
+ main()