some fixes
This commit is contained in:
20
wichteln.py
20
wichteln.py
@ -4,15 +4,15 @@
|
|||||||
import random
|
import random
|
||||||
import smtplib
|
import smtplib
|
||||||
|
|
||||||
DEBUG = False
|
DEBUG = True
|
||||||
|
|
||||||
def sendmail(sender, receiver, msg):
|
def sendmail(sender, receiver, msg):
|
||||||
smtp = None
|
smtp = None
|
||||||
try:
|
try:
|
||||||
smtp = smtplib.SMTP("localhost")
|
smtp = smtplib.SMTP("localhost")
|
||||||
smtp.sendmail("nobody@hotti.de", (receiver), msg);
|
smtp.sendmail("nobody@hottis.de", (receiver), msg)
|
||||||
except SMTPException:
|
except smtplib.SMTPException as e:
|
||||||
print("Fehler beim Senden der Mail an {0}".format(self.name))
|
print("Fehler beim Senden der Mail an {0}, {1}, {2}".format(msg, receiver, e))
|
||||||
raise Exception("Nochmal von vorne")
|
raise Exception("Nochmal von vorne")
|
||||||
finally:
|
finally:
|
||||||
if smtp:
|
if smtp:
|
||||||
@ -49,7 +49,7 @@ class Wichtelee(object):
|
|||||||
To: {0} <{1}>
|
To: {0} <{1}>
|
||||||
Subject: Wichteln
|
Subject: Wichteln
|
||||||
|
|
||||||
Du, {0}, darfst ein Geschenk für {2} besorgen.
|
Du, {0}, darfst ein Geschenk fuer {2} besorgen.
|
||||||
|
|
||||||
Der Geist der Weihnacht
|
Der Geist der Weihnacht
|
||||||
""".format(self.name, self.email, self.receiverName)
|
""".format(self.name, self.email, self.receiverName)
|
||||||
@ -63,10 +63,10 @@ Der Geist der Weihnacht
|
|||||||
|
|
||||||
|
|
||||||
wichtelees = [
|
wichtelees = [
|
||||||
Wichtelee("Wolfgang", "woho@hottis.de", ("Patty", "Matthias", "Anna")),
|
Wichtelee("Wolfgang", "wolfgang.hottgenroth@icloud.com", ("Patty", "Matthias", "Anna")),
|
||||||
Wichtelee("Patty", "patty@hottis.de", ("Wolfgang", "Matthias", "Anna")),
|
Wichtelee("Patty", "patricia.hottgenroth@icloud.com", ("Wolfgang", "Matthias", "Anna")),
|
||||||
Wichtelee("Matthias", "matthias@hottis.de", ("Wolfgang", "Patty", "Anna", "Robert")),
|
Wichtelee("Matthias", "matthias.hottgenroth@icloud.com", ("Wolfgang", "Patty", "Anna", "Robert")),
|
||||||
Wichtelee("Anna", "anna@hottis.de", ("Wolfgang", "Patty", "Matthias", "Lucia")),
|
Wichtelee("Anna", "anna.hottgenroth@icloud.com", ("Wolfgang", "Patty", "Matthias", "Lucia")),
|
||||||
Wichtelee("Thomas", "thomas@nober.de", ("Sandra")),
|
Wichtelee("Thomas", "thomas@nober.de", ("Sandra")),
|
||||||
Wichtelee("Sandra", "sandra.nober@web.de", ("Thomas")),
|
Wichtelee("Sandra", "sandra.nober@web.de", ("Thomas")),
|
||||||
Wichtelee("Philipp", "philipp@nicolai.eu", ("Barbara")),
|
Wichtelee("Philipp", "philipp@nicolai.eu", ("Barbara")),
|
||||||
@ -109,7 +109,7 @@ for first in wichtelees:
|
|||||||
|
|
||||||
|
|
||||||
notarMsg = """Subject: Wichtelergebnis
|
notarMsg = """Subject: Wichtelergebnis
|
||||||
To: Papa <heribert-ludger@nober.de
|
To: Papa <heribert-ludger@nober.de>
|
||||||
From: Wolfgang <woho@hottis.de>
|
From: Wolfgang <woho@hottis.de>
|
||||||
|
|
||||||
Bitte gut aufheben und keinem zeigen!
|
Bitte gut aufheben und keinem zeigen!
|
||||||
|
Reference in New Issue
Block a user