# Path: baobab/utils/authentication.py
# class Authentication(object):
# 
#     def __init__(self, consumer_key, consumer_secret, token_key, token_secret):
#         consumer = Consumer(key=consumer_key, secret=consumer_secret)
#         token = Token(key=token_key, secret=token_secret)
# 
#         proxy_info = None
#         if hasattr(settings, 'PROXY_HOST') and \
#                 hasattr(settings, 'PROXY_PORT'):
#             proxy_info = ProxyInfo(
#                 proxy_type=PROXY_TYPE_HTTP,
#                 proxy_host=settings.PROXY_HOST,
#                 proxy_port=settings.PROXY_PORT)
#         self.client = Client(
#             consumer=consumer,
#             token=token,
#             proxy_info=proxy_info)
# 
#     def __enter__(self):
#         return self
# 
#     def __exit__(self, exc_type, exc_val, exc_tb):
#         pass
# 
# Path: baobab/socialnetwork/base.py
# class SocialNetworkBase(object):
# 
#     """
#     interface for all social network, each social network have to
#     inherited from this class
#     """
# 
#     name = None
# 
#     @classmethod
#     def is_configured(cls):
#         raise NotImplementedError()
# 
#     @classmethod
#     def get_max_char(cls, default):
#         raise NotImplementedError()
# 
#     def publish(self, msg, url):
#         """
#         should raise if it failed
#         """
#         raise NotImplementedError()
# 
#     def  __enter__(self):
#         raise NotImplementedError()
# 
#     def __exit__(self, exc_type, exc_val, exc_tb):
#         raise NotImplementedError()
# 
# class UnPublishedException(Exception):
#     pass


from datetime import datetime, timedelta
from django.conf import settings
from baobab.utils.authentication import Authentication
from .base import SocialNetworkBase, UnPublishedException
import json
import logging
import pytz
import urllib
# -*- coding: utf-8 -*-




LOG = logging.getLogger(__name__)


class Twitter(Authentication, SocialNetworkBase):

    name = 'twitter'
    url_api = None
    rate_limit = {}
    manual_rate_limit = {
        # '%s/statuses/update.json' % url_api: {
        #     'max_request': 15,
        #     'window_request': 15,  # in minutes
        #     'request_done': 0,
        #     'request_window': None,
        # },

# Path: baobab/utils/authentication.py
# class Authentication(object):
# 
#     def __init__(self, consumer_key, consumer_secret, token_key, token_secret):
#         consumer = Consumer(key=consumer_key, secret=consumer_secret)
#         token = Token(key=token_key, secret=token_secret)
# 
#         proxy_info = None
#         if hasattr(settings, 'PROXY_HOST') and \
#                 hasattr(settings, 'PROXY_PORT'):
#             proxy_info = ProxyInfo(
#                 proxy_type=PROXY_TYPE_HTTP,
#                 proxy_host=settings.PROXY_HOST,
#                 proxy_port=settings.PROXY_PORT)
#         self.client = Client(
#             consumer=consumer,
#             token=token,
#             proxy_info=proxy_info)
# 
#     def __enter__(self):
#         return self
# 
#     def __exit__(self, exc_type, exc_val, exc_tb):
#         pass
# 
# Path: baobab/socialnetwork/base.py
# class SocialNetworkBase(object):
# 
#     """
#     interface for all social network, each social network have to
#     inherited from this class
#     """
# 
#     name = None
# 
#     @classmethod
#     def is_configured(cls):
#         raise NotImplementedError()
# 
#     @classmethod
#     def get_max_char(cls, default):
#         raise NotImplementedError()
# 
#     def publish(self, msg, url):
#         """
#         should raise if it failed
#         """
#         raise NotImplementedError()
# 
#     def  __enter__(self):
#         raise NotImplementedError()
# 
#     def __exit__(self, exc_type, exc_val, exc_tb):
#         raise NotImplementedError()
# 
# class UnPublishedException(Exception):
#     pass


# Path: baobab/socialnetwork/twitter.py
from datetime import datetime, timedelta
from django.conf import settings
from baobab.utils.authentication import Authentication
from .base import SocialNetworkBase, UnPublishedException
import json
import logging
import pytz
import urllib

# -*- coding: utf-8 -*-




LOG = logging.getLogger(__name__)


class Twitter(Authentication, SocialNetworkBase):

    name = 'twitter'
    url_api = None
    rate_limit = {}
    manual_rate_limit = {
        # '%s/statuses/update.json' % url_api: {
        #     'max_request': 15,
        #     'window_request': 15,  # in minutes
        #     'request_done': 0,
        #     'request_window': None,
        # },

    }