maildir-zero: sort by count
This commit is contained in:
parent
eacc4c3b4f
commit
fe1b463d7e
1 changed files with 10 additions and 2 deletions
12
maildir-zero
12
maildir-zero
|
@ -37,6 +37,7 @@ def mailbox_name(maildir, root):
|
||||||
|
|
||||||
ignore_zero = True
|
ignore_zero = True
|
||||||
ignore = [r'spam']
|
ignore = [r'spam']
|
||||||
|
sort_by_count = True
|
||||||
|
|
||||||
|
|
||||||
root = os.path.expanduser('~/Maildir')
|
root = os.path.expanduser('~/Maildir')
|
||||||
|
@ -53,5 +54,12 @@ for maildir in maildirs(root):
|
||||||
|
|
||||||
counts[name] = all_
|
counts[name] = all_
|
||||||
|
|
||||||
for name in sorted(counts.keys()):
|
if sort_by_count:
|
||||||
print('{:30} {:5d}'.format(name, counts[name]))
|
key = lambda i: i[1]
|
||||||
|
reverse = True
|
||||||
|
else:
|
||||||
|
key = lambda i: i[0]
|
||||||
|
reverse = False
|
||||||
|
|
||||||
|
for name, count in sorted(counts.items(), key=key, reverse=reverse):
|
||||||
|
print('{:30} {:5d}'.format(name, count))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue