1 #!/usr/bin/env python2.5
10 maildir = os.path.join(os.getenv('HOME'), 'Maildir')
13 no_template = 'nada nuevo'
14 yes_template = '%(name)s (%(messages)s)'
21 secs = int(sys.argv[1])
25 folders = [f for f in glob.glob(os.path.join(maildir, '.*'))
26 if not f.endswith('.historial')
27 and os.path.exists(os.path.join(f, 'new'))]
29 folders.insert(0, maildir)
33 for folder in folders:
34 name = folder[len(maildir)+2:]
35 if not name: name = 'INBOX'
36 messages = len(glob.glob(os.path.join(folder, 'new', '*')))
38 new.append((name, messages))
40 print join_str.join([yes_template % dict(name=n, messages=m)