# Path: src/libs/base.py
# class ServiceBase(object):
#     """ 所有服务的基类 """
# 
#     def __init__(self):
#         #设置全局超时时间(如连接超时)
#         self.timeout= 2
#         #建立redis单机或集群连接
#         self.redis  = from_url(REDIS)
#         self.rqredis  = from_url(RQREDIS)
#         #解析mysql配置并建立读写分离连接
#         self._minfo = ParseMySQL(MYSQL)
#         self._mysql = Connection(
#                     host     = "%s:%s" %(self._minfo.get('Host', '127.0.0.1'), self._minfo.get('Port', 3306)),
#                     user     = self._minfo.get('User', 'root'),
#                     password = self._minfo.get('Password'),
#                     database = self._minfo.get('Database'),
#                     time_zone= self._minfo.get('Timezone','+8:00'),
#                     charset  = self._minfo.get('Charset', 'utf8'),
#                     connect_timeout=self.timeout,
#                     max_idle_time=self.timeout)
#         self.mysql_read = self._mysql
#         self.mysql_write= self._mysql
#         self.asyncQueue = Queue(connection=self.rqredis)
#         self.asyncQueueLow = Queue(name='low', connection=self.rqredis)
#         self.asyncQueueHigh = Queue(name='high', connection=self.rqredis)


import requests, sys, json
from config import PLUGINS
from torndb import IntegrityError
from utils.tool import logger, get_today, ListEqualSplit, md5, DO, user_pat, sql_safestring_check, get_current_timestamp, str_count
from .base import ServiceBase
# -*- coding: utf-8 -*-
"""
    EauDouce.libs.api
    ~~~~~~~~~~~~~~

    Interface class.

    :copyright: (c) 2017 by Mr.tao.
    :license: MIT, see LICENSE for more details.
"""




# Path: src/libs/base.py
# class ServiceBase(object):
#     """ 所有服务的基类 """
# 
#     def __init__(self):
#         #设置全局超时时间(如连接超时)
#         self.timeout= 2
#         #建立redis单机或集群连接
#         self.redis  = from_url(REDIS)
#         self.rqredis  = from_url(RQREDIS)
#         #解析mysql配置并建立读写分离连接
#         self._minfo = ParseMySQL(MYSQL)
#         self._mysql = Connection(
#                     host     = "%s:%s" %(self._minfo.get('Host', '127.0.0.1'), self._minfo.get('Port', 3306)),
#                     user     = self._minfo.get('User', 'root'),
#                     password = self._minfo.get('Password'),
#                     database = self._minfo.get('Database'),
#                     time_zone= self._minfo.get('Timezone','+8:00'),
#                     charset  = self._minfo.get('Charset', 'utf8'),
#                     connect_timeout=self.timeout,
#                     max_idle_time=self.timeout)
#         self.mysql_read = self._mysql
#         self.mysql_write= self._mysql
#         self.asyncQueue = Queue(connection=self.rqredis)
#         self.asyncQueueLow = Queue(name='low', connection=self.rqredis)
#         self.asyncQueueHigh = Queue(name='high', connection=self.rqredis)


# Path: src/libs/api.py
import requests, sys, json
from config import PLUGINS
from torndb import IntegrityError
from utils.tool import logger, get_today, ListEqualSplit, md5, DO, user_pat, sql_safestring_check, get_current_timestamp, str_count
from .base import ServiceBase

# -*- coding: utf-8 -*-
"""
    EauDouce.libs.api
    ~~~~~~~~~~~~~~

    Interface class.

    :copyright: (c) 2017 by Mr.tao.
    :license: MIT, see LICENSE for more details.
"""




class BlogApiManager(ServiceBase):