sleep_time = self._reset_time - int(time.time())
if sleep_time > 0:
if self.wait_on_rate_limit_notify:
- print("Rate limit reached. Sleeping for:", sleep_time)
+ log.warning("Rate limit reached. Sleeping for: %d" % sleep_time)
time.sleep(sleep_time + 5) # sleep for few extra sec
# if self.wait_on_rate_limit and self._reset_time is not None and \
# sleep_time = self._reset_time - int(time.time())
# if sleep_time > 0:
# if self.wait_on_rate_limit_notify:
- # print("Rate limit reached. Sleeping for: " + str(sleep_time))
+ # log.warning("Rate limit reached. Sleeping for: %d" % sleep_time)
# time.sleep(sleep_time + 5) # sleep for few extra sec
# Apply authentication
import datetime
import threading
import os
+import logging
try:
import cPickle as pickle
# TODO: use win32file
pass
+log = logging.getLogger('tweepy.cache')
class Cache(object):
"""Cache interface"""
self._lock_file = self._lock_file_win32
self._unlock_file = self._unlock_file_win32
else:
- print('Warning! FileCache locking not supported on this system!')
+ log.warning('FileCache locking not supported on this system!')
self._lock_file = self._lock_file_dummy
self._unlock_file = self._unlock_file_dummy