Skip to content

Commit c98258d

Browse files
author
=
committed
test
1 parent 2996e16 commit c98258d

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

mail/mail_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def attach_mail(file_list, to_list, subject, content):
8585
return False
8686

8787

88-
if __name__ == '__main__':
88+
def test():
8989
to_address = 'nan.wang@htouhui.com'
9090
sub = '你好'
9191
cont = '<html><body><h1>你好!</h1></body></html>'

main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import web
44
from schedule.schedule_test import start_schedule
5+
from mail.mail_test import test
56

67
# URL 映射
78
urls = (
@@ -20,6 +21,7 @@ def GET(self):
2021

2122

2223
if __name__ == '__main__':
24+
test()
2325
start_schedule()
2426
app.run()
2527

schedule/schedule_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# -*- coding:utf-8 -*-
22
from apscheduler.schedulers.background import BackgroundScheduler
3+
from log import logger
34
from mail.mail_test import send_mail
45
import time
56

67

78
def my_job():
8-
print time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time()))
9+
logger.info(time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())))
910

1011

1112
def start_schedule():

0 commit comments

Comments
 (0)