1
0
Fork 0
mirror of https://github.com/Findus23/shuffle.git synced 2024-09-19 14:43:45 +02:00

only output results during testing

This commit is contained in:
Lukas Winkler 2020-05-08 14:26:10 +02:00
parent 6aa81c2734
commit 0a4e97bdb9
Signed by: lukas
GPG key ID: 54DE4D798D244853
3 changed files with 6 additions and 4 deletions

View file

@ -5,3 +5,5 @@ people = {
} }
sender = "Randomizer <script@example.com>" sender = "Randomizer <script@example.com>"
debug = False

View file

@ -1,7 +1,7 @@
import smtplib import smtplib
from email.mime.text import MIMEText from email.mime.text import MIMEText
from config import sender from config import sender, debug
s = smtplib.SMTP('localhost') s = smtplib.SMTP('localhost')
@ -13,5 +13,5 @@ def notify(name: str, email: str, chosen_person: str) -> None:
msg['Subject'] = f"Result of shuffle for {name}" msg['Subject'] = f"Result of shuffle for {name}"
msg['From'] = sender msg['From'] = sender
msg['To'] = to msg['To'] = to
print(msg.as_string()) if debug: print(msg.as_string())
s.sendmail(sender, [to], msg.as_string()) s.sendmail(sender, [to], msg.as_string())

View file

@ -1,11 +1,11 @@
from config import people from config import people, debug
from derangement import get_derangement from derangement import get_derangement
from mail import notify from mail import notify
names = list(people.keys()) names = list(people.keys())
shuffled = get_derangement(names) shuffled = get_derangement(names)
print(shuffled) if debug: print(shuffled)
i = 0 i = 0
for name, email in people.items(): for name, email in people.items():