Add date to email
This commit is contained in:
parent
dfe5e5830b
commit
8ef0585916
@ -19,6 +19,7 @@ from email import encoders
|
|||||||
from email.mime.base import MIMEBase
|
from email.mime.base import MIMEBase
|
||||||
from email.mime.multipart import MIMEMultipart
|
from email.mime.multipart import MIMEMultipart
|
||||||
from email.mime.text import MIMEText
|
from email.mime.text import MIMEText
|
||||||
|
from email.utils import formatdate
|
||||||
|
|
||||||
import logger as log
|
import logger as log
|
||||||
|
|
||||||
@ -53,6 +54,7 @@ def sendMail(msg_body :str, retry):
|
|||||||
message['From'] = smtpFrom
|
message['From'] = smtpFrom
|
||||||
message['To'] = "server-notification-receipt@fjla.uk"
|
message['To'] = "server-notification-receipt@fjla.uk"
|
||||||
message['Subject'] = "OwlBoard - dbmanager Logs"
|
message['Subject'] = "OwlBoard - dbmanager Logs"
|
||||||
|
message['Data'] = formatdate(localtime = True)
|
||||||
filename = "cif_data"
|
filename = "cif_data"
|
||||||
message.attach(MIMEText(msg_body, "plain"))
|
message.attach(MIMEText(msg_body, "plain"))
|
||||||
if os.path.exists(filename):
|
if os.path.exists(filename):
|
||||||
|
@ -56,7 +56,11 @@ def parse(codeList):
|
|||||||
for ii in codeList:
|
for ii in codeList:
|
||||||
if stops == ii['stops'] and code != ii['code']:
|
if stops == ii['stops'] and code != ii['code']:
|
||||||
log.out(f"Identical stopping pattern found: {ii['code']}","DBUG")
|
log.out(f"Identical stopping pattern found: {ii['code']}","DBUG")
|
||||||
codeList.remove(ii) # Instead of removing, I should add a property (duplicate: true), then I can filter this out on the backend when searching by start and end stations and just use query one for other queries, this means that when searching by code, a perfectly valid code won't show 0 results.
|
codeList.remove(ii) # Instead of removing, I should add a property (duplicate: true),
|
||||||
|
# then I can filter this out on the backend when searching by start
|
||||||
|
# and end stations and just use query one for other queries, this
|
||||||
|
# means that when searching by code, a perfectly valid code won't
|
||||||
|
# show 0 results.
|
||||||
tiplocs = []
|
tiplocs = []
|
||||||
for iii in stops:
|
for iii in stops:
|
||||||
print(iii)
|
print(iii)
|
||||||
|
Reference in New Issue
Block a user