Commit 0804678a authored by Josh Roesslein's avatar Josh Roesslein
Browse files

Tutorial fixes. Also fixed issue with binder fetching cached results.

parent abba38c0
...@@ -3,7 +3,6 @@ The plan of attack for the next version of Tweepy. ...@@ -3,7 +3,6 @@ The plan of attack for the next version of Tweepy.
1.0 -> 1.0.1 1.0 -> 1.0.1
============ ============
+ changing profile and background images [DONE] + changing profile and background images [DONE]
+ prepare for social graph changes mentioned on mailinglist
+ finish search api + finish search api
+ autodetect authenticated user's ID [DONE] + autodetect authenticated user's ID [DONE]
...@@ -14,3 +13,4 @@ Future... ...@@ -14,3 +13,4 @@ Future...
+ command line client example + command line client example
+ retweet api [DONE BUT NEEDS TESTING] + retweet api [DONE BUT NEEDS TESTING]
+ async requests + async requests
+ prepare for social graph changes mentioned on mailinglist
...@@ -22,7 +22,7 @@ public_timeline = no_auth_api.public_timeline() ...@@ -22,7 +22,7 @@ public_timeline = no_auth_api.public_timeline()
print 'Public timeline...' print 'Public timeline...'
for status in public_timeline: for status in public_timeline:
print status.text print status.text
print 'from: %s' % status.user.screen_name print 'from: %s' % status.author.screen_name
""" """
Tweepy provides a non-authenticated instance of the API for you already Tweepy provides a non-authenticated instance of the API for you already
...@@ -51,7 +51,7 @@ friends_timeline = auth_api.friends_timeline() ...@@ -51,7 +51,7 @@ friends_timeline = auth_api.friends_timeline()
print 'Friends timeline...' print 'Friends timeline...'
for status in friends_timeline: for status in friends_timeline:
print status.text print status.text
print 'from: %s' % status.user.screen_name print 'from: %s' % status.author.screen_name
""" The End """ The End
......
...@@ -36,7 +36,7 @@ If you wish to use your own cache implementation just ...@@ -36,7 +36,7 @@ If you wish to use your own cache implementation just
extend the Cache interface class (tweepy/cache.py). extend the Cache interface class (tweepy/cache.py).
Then when you create your API instance pass it in. Then when you create your API instance pass it in.
""" """
my_api = tweepy.API(cache=MyCache()) #my_api = tweepy.API(cache=MyCache())
""" The End """ """ The End """
...@@ -71,7 +71,12 @@ def bind_api(path, parser, allowed_param=None, method='GET', require_auth=False, ...@@ -71,7 +71,12 @@ def bind_api(path, parser, allowed_param=None, method='GET', require_auth=False,
cache_result = api.cache.get(url, timeout) cache_result = api.cache.get(url, timeout)
if cache_result: if cache_result:
# if cache result found and not expired, return it # if cache result found and not expired, return it
cache_result._api = api # restore api reference to this api instance # must restore api reference
if isinstance(cache_result, list):
for result in cache_result:
result._api = api
else:
cache_result._api = api
return cache_result return cache_result
# Open connection # Open connection
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment