have it running an waking up forever

This commit is contained in:
Jan Grewe 2019-08-21 20:23:19 +02:00
parent cc1594d9c1
commit 376fe4a7f5

View File

@ -11,14 +11,13 @@
import sys
import imaplib
import os
import sys
import email
import email.header
from IPython import embed
import smtplib
from email.message import EmailMessage
import re
import datetime as dt
import time
EMAIL_ACCOUNT = "bzigr02"
EMAIL_FOLDER = "INBOX"
@ -170,6 +169,7 @@ class Participation(object):
f.write("\n")
f.write("; ".join(values))
return filename
def __str__(self):
str = ""
str += "Name: %s %s\n" % (self._first_name, self._last_name)
@ -281,7 +281,7 @@ def send_confirmation(p=None, csv_file=None):
s.quit()
if __name__ == "__main__":
def check_for_mails():
M = imaplib.IMAP4_SSL(IMAP_SERVER)
try:
rv, data = M.login(EMAIL_ACCOUNT, EMAIL_PSWD)
@ -304,3 +304,9 @@ if __name__ == "__main__":
M.close()
M.logout()
if __name__ == "__main__":
while True:
check_for_mails()
time.sleep(60)