# Path: base/config.py

# 
# Path: auth/exceptions.py
# class OOIAuthException(OOIBaseException):
#     pass


import aiohttp
import asyncio
import json
import re
import time
from urllib.parse import urlparse, parse_qs
from base import config
from auth.exceptions import OOIAuthException
        self.world_ip = None
        self.api_token = None
        self.api_starttime = None
        self.entry = None

    def __del__(self):
        """析构函数，用于关闭aiohttp的会话。

        :return: none
        """
        self.session.close()

    @asyncio.coroutine
    def _request(self, url, method='GET', data=None, timeout_message='连接失败', timeout=10):
        """使用asyncio.wait_for包装过的会话向远端服务器发起请求。
        `url`为请求的URL地址，`method`为请求的方法， `data`为发起POST请求时的数据，`timeout_message`为请求超时后抛出异常所带的信息，
        `timeout`为超时时间，单位为秒。

        :param url: str
        :param method: str
        :param data: dict
        :param timeout_message: str
        :param timeout: int
        :return: generator
        """
        try:
            response = yield from asyncio.wait_for(self.session.request(method, url, data=data, headers=self.headers),
                                                   timeout)
            return response
        except asyncio.TimeoutError:

# Path: base/config.py

# 
# Path: auth/exceptions.py
# class OOIAuthException(OOIBaseException):
#     pass


# Path: auth/kancolle.py
import aiohttp
import asyncio
import json
import re
import time
from urllib.parse import urlparse, parse_qs
from base import config
from auth.exceptions import OOIAuthException

        self.world_ip = None
        self.api_token = None
        self.api_starttime = None
        self.entry = None

    def __del__(self):
        """析构函数，用于关闭aiohttp的会话。

        :return: none
        """
        self.session.close()

    @asyncio.coroutine
    def _request(self, url, method='GET', data=None, timeout_message='连接失败', timeout=10):
        """使用asyncio.wait_for包装过的会话向远端服务器发起请求。
        `url`为请求的URL地址，`method`为请求的方法， `data`为发起POST请求时的数据，`timeout_message`为请求超时后抛出异常所带的信息，
        `timeout`为超时时间，单位为秒。

        :param url: str
        :param method: str
        :param data: dict
        :param timeout_message: str
        :param timeout: int
        :return: generator
        """
        try:
            response = yield from asyncio.wait_for(self.session.request(method, url, data=data, headers=self.headers),
                                                   timeout)
            return response
        except asyncio.TimeoutError:

            raise OOIAuthException(timeout_message)