-
Notifications
You must be signed in to change notification settings - Fork 4
/
run.py
34 lines (27 loc) · 1008 Bytes
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# -*- coding=utf-8 -*-
import argparse
import sys
def parser_arguments(argv):
"""
不应该在这里定义,先放在这里
:param argv:
:return:
"""
parser = argparse.ArgumentParser()
parser.add_argument("operate", type=str, help="r: 运行抢票程序, c: 过滤cdn, t: 测试邮箱和server酱,server酱需要打开开关")
return parser.parse_args(argv)
if __name__ == '__main__':
args = parser_arguments(sys.argv[1:])
#from init import select_ticket_info
#select_ticket_info.select().main()
if args.operate == "r":
from init import select_ticket_info
select_ticket_info.select().main()
elif args.operate == "t":
from config.emailConf import sendEmail
from config.serverchanConf import sendServerChan
sendEmail(u"订票小助手测试一下")
sendServerChan("订票小助手测试一下")
elif args.operate == "c":
from agency.cdn_utils import filterCdn
filterCdn()