# Path: service/proxy.py
# def check_proxy(func):
#     """
#     校验代理的装饰器，使用情况较特殊，只针对请求超时异常
#     :param func:
#     :return:
#     """
#     def wrapper(*args, **kwargs):
#         for i in range(5):
#             try:
#                 resp = func(*args, **kwargs)
#                 return resp
#             except RequestException:
#                 update_proxy()
#         raise Exception('函数重试5次，仍无法成功')
#     return wrapper


import logging
import requests
import controller as ctrl
from service.account import *
from service.proxy import check_proxy
# -*- coding: utf-8 -*-
"""
Created on 2018/2/27

@author: will4906
"""



logging.getLogger(__name__).setLevel(logging.DEBUG)


@check_proxy
def get(*args, **kwargs):
    return request(request_type='get', **kwargs)



# Path: service/proxy.py
# def check_proxy(func):
#     """
#     校验代理的装饰器，使用情况较特殊，只针对请求超时异常
#     :param func:
#     :return:
#     """
#     def wrapper(*args, **kwargs):
#         for i in range(5):
#             try:
#                 resp = func(*args, **kwargs)
#                 return resp
#             except RequestException:
#                 update_proxy()
#         raise Exception('函数重试5次，仍无法成功')
#     return wrapper


# Path: service/request.py
import logging
import requests
import controller as ctrl
from service.account import *
from service.proxy import check_proxy

# -*- coding: utf-8 -*-
"""
Created on 2018/2/27

@author: will4906
"""



logging.getLogger(__name__).setLevel(logging.DEBUG)


@check_proxy
def get(*args, **kwargs):
    return request(request_type='get', **kwargs)



@check_proxy