from tweepy.models import ResultSet
-class NoIdItem(object): pass
+class NoIdItem: pass
-class IdItem(object):
+class IdItem:
def __init__(self, id):
self.id = id
from tweepy.utils import list_to_csv
-class API(object):
+class API:
"""Twitter API"""
def __init__(self, auth_handler=None,
log = logging.getLogger(__name__)
-class AuthHandler(object):
+class AuthHandler:
def apply_auth(self, url, method, headers, parameters):
"""Apply authentication headers to request"""
def bind_api(**config):
- class APIMethod(object):
+ class APIMethod:
api = config['api']
path = config['path']
log = logging.getLogger(__name__)
-class Cache(object):
+class Cache:
"""Cache interface"""
def __init__(self, timeout=60):
from tweepy.parsers import ModelParser, RawParser
-class Cursor(object):
+class Cursor:
"""Pagination helper class"""
def __init__(self, method, *args, **kwargs):
return i
-class BaseIterator(object):
+class BaseIterator:
def __init__(self, method, *args, **kwargs):
self.method = method
return [item.id for item in self if hasattr(item, 'id')]
-class Model(object):
+class Model:
def __init__(self, api=None):
self._api = api
return media
-class ModelFactory(object):
+class ModelFactory:
"""
Used by parsers for creating instances
of models. You may subclass this factory
from tweepy.models import ModelFactory
-class Parser(object):
+class Parser:
def parse(self, method, payload, *args, **kwargs):
"""
log = logging.getLogger(__name__)
-class StreamListener(object):
+class StreamListener:
def __init__(self, api=None):
self.api = api or API()
"""Called when a user withheld content notice arrives"""
return
-class ReadBuffer(object):
+class ReadBuffer:
"""Buffer data from the response in a smarter way than httplib/requests can.
Tweets are roughly in the 2-12kb range, averaging around 3kb.
return r.decode(self._encoding)
-class Stream(object):
+class Stream:
def __init__(self, auth, listener, **options):
self.auth = auth