mirror of https://github.com/testerSunshine/12306
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
918 B
31 lines
918 B
# -*- 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:]) |
|
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() |
|
|
|
|