mirror of
https://github.com/Findus23/shuffle.git
synced 2024-09-18 13:33:44 +02:00
only output results during testing
This commit is contained in:
parent
6aa81c2734
commit
0a4e97bdb9
3 changed files with 6 additions and 4 deletions
|
@ -5,3 +5,5 @@ people = {
|
|||
}
|
||||
|
||||
sender = "Randomizer <script@example.com>"
|
||||
|
||||
debug = False
|
||||
|
|
4
mail.py
4
mail.py
|
@ -1,7 +1,7 @@
|
|||
import smtplib
|
||||
from email.mime.text import MIMEText
|
||||
|
||||
from config import sender
|
||||
from config import sender, debug
|
||||
|
||||
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['From'] = sender
|
||||
msg['To'] = to
|
||||
print(msg.as_string())
|
||||
if debug: print(msg.as_string())
|
||||
s.sendmail(sender, [to], msg.as_string())
|
||||
|
|
4
main.py
4
main.py
|
@ -1,11 +1,11 @@
|
|||
from config import people
|
||||
from config import people, debug
|
||||
from derangement import get_derangement
|
||||
from mail import notify
|
||||
|
||||
names = list(people.keys())
|
||||
|
||||
shuffled = get_derangement(names)
|
||||
print(shuffled)
|
||||
if debug: print(shuffled)
|
||||
|
||||
i = 0
|
||||
for name, email in people.items():
|
||||
|
|
Loading…
Reference in a new issue