Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Zahra Rajabi
tweepy
Commits
cb050623
Commit
cb050623
authored
Sep 02, 2016
by
Hugo Hromic
Browse files
replace raw print() calls with proper logging-based calls
parent
cd46550b
Changes
2
Hide whitespace changes
Inline
Side-by-side
tweepy/binder.py
View file @
cb050623
...
...
@@ -158,7 +158,7 @@ def bind_api(**config):
sleep_time
=
self
.
_reset_time
-
int
(
time
.
time
())
if
sleep_time
>
0
:
if
self
.
wait_on_rate_limit_notify
:
pr
in
t
(
"Rate limit reached. Sleeping for:
"
,
sleep_time
)
log
.
warn
in
g
(
"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 \
...
...
@@ -166,7 +166,7 @@ def bind_api(**config):
# sleep_time = self._reset_time - int(time.time())
# if sleep_time > 0:
# if self.wait_on_rate_limit_notify:
#
pr
in
t
("Rate limit reached. Sleeping for:
" + str(
sleep_time)
)
#
log.warn
in
g
("Rate limit reached. Sleeping for:
%d" %
sleep_time)
# time.sleep(sleep_time + 5) # sleep for few extra sec
# Apply authentication
...
...
tweepy/cache.py
View file @
cb050623
...
...
@@ -8,6 +8,7 @@ import time
import
datetime
import
threading
import
os
import
logging
try
:
import
cPickle
as
pickle
...
...
@@ -27,6 +28,7 @@ except ImportError:
# TODO: use win32file
pass
log
=
logging
.
getLogger
(
'tweepy.cache'
)
class
Cache
(
object
):
"""Cache interface"""
...
...
@@ -157,7 +159,7 @@ class FileCache(Cache):
self
.
_lock_file
=
self
.
_lock_file_win32
self
.
_unlock_file
=
self
.
_unlock_file_win32
else
:
print
(
'W
arning
!
FileCache locking not supported on this system!'
)
log
.
w
arning
(
'
FileCache locking not supported on this system!'
)
self
.
_lock_file
=
self
.
_lock_file_dummy
self
.
_unlock_file
=
self
.
_unlock_file_dummy
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment