forked from twys1018/proxy_pool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
proxyPool.py
45 lines (34 loc) · 967 Bytes
/
proxyPool.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
34
35
36
37
38
39
40
41
42
43
44
45
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: proxy_pool
Description : proxy pool 启动入口
Author : JHao
date: 2020/6/19
-------------------------------------------------
Change Activity:
2020/6/19:
-------------------------------------------------
"""
__author__ = 'JHao'
import click
from setting import BANNER
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
@click.group(context_settings=CONTEXT_SETTINGS)
@click.version_option(version='2.1.0')
def cli():
"""ProxyPool cli工具"""
@cli.command(name="schedule")
def schedule():
""" 启动调度程序 """
click.echo(BANNER)
from helper.scheduler import runScheduler
runScheduler()
@cli.command(name="server")
def server():
""" 启动api服务 """
click.echo(BANNER)
from api.proxyApi import runFlask
runFlask()
if __name__ == '__main__':
cli()