offlineimap_notify: remove debug output
This commit is contained in:
parent
bae6358151
commit
4e96078e09
4
offlineimap_notify.py
Normal file → Executable file
4
offlineimap_notify.py
Normal file → Executable file
@ -20,11 +20,8 @@ for m in mailboxes.strip('\n').split(" "):
|
|||||||
def new_mail(event):
|
def new_mail(event):
|
||||||
with open(event.pathname, 'r') as f:
|
with open(event.pathname, 'r') as f:
|
||||||
mail = MaildirMessage(message=f)
|
mail = MaildirMessage(message=f)
|
||||||
print(mail)
|
|
||||||
efrom = 'From: ' + mail['From']
|
efrom = 'From: ' + mail['From']
|
||||||
print(efrom)
|
|
||||||
esubject = 'Subject: ' + mail['Subject']
|
esubject = 'Subject: ' + mail['Subject']
|
||||||
print(esubject)
|
|
||||||
n = pynotify.Notification("New mail in " + '/'.join(
|
n = pynotify.Notification("New mail in " + '/'.join(
|
||||||
event.path.split('/')[-3:-1]), efrom + "\n" + esubject)
|
event.path.split('/')[-3:-1]), efrom + "\n" + esubject)
|
||||||
n.set_timeout(8000)
|
n.set_timeout(8000)
|
||||||
@ -38,4 +35,5 @@ for box in boxes:
|
|||||||
watch_manager.add_watch(join(maildir, box, 'new'),
|
watch_manager.add_watch(join(maildir, box, 'new'),
|
||||||
pyinotify.IN_CREATE | pyinotify.IN_MOVED_TO)
|
pyinotify.IN_CREATE | pyinotify.IN_MOVED_TO)
|
||||||
|
|
||||||
|
print('running new mail notifier in a loop...')
|
||||||
file_notifier.loop()
|
file_notifier.loop()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user