Fixed CustomApi so that _username is defined

This commit is contained in:
Anna 2010-05-21 12:11:57 -04:00
parent 1a98de805f
commit f7696e2d67
3 changed files with 3 additions and 3 deletions

View File

@ -28,6 +28,7 @@ class CustomApi(OAuthApi):
self.sig_proxy = SigProxy()
self.username = self.GetUserInfo().screen_name
self._username = self.username
thread = GetUserLists(api=self)
thread.sig_proxy.connect('lists-ready', self.on_lists_ready)

View File

@ -114,7 +114,6 @@ class OAuthApi(Api):
encoded_post_data = None
req_url = req.to_url()
# Open and return the URL immediately if we're not going to cache
# OR we are posting data
if encoded_post_data or no_cache or not self._cache or not self._cache_timeout:

View File

@ -36,9 +36,9 @@ diff -r 51ac454d5d89 twitter.py
+ if not user and not self._username:
+ raise TwitterError("User must be specified if API is not authenticated.")
+ if user:
+ url = 'http://twitter.com/%s/lists/%s/statuses.json' % (user,list_slug)
+ url = 'http://api.twitter.com/1/%s/lists/%s/statuses.json' % (user,list_slug)
+ else:
+ url = 'http://twitter.com/%s/lists/%s/statuses.json' % (self._username,list_slug)
+ url = 'http://api.twitter.com/1/%s/lists/%s/statuses.json' % (self._username,list_slug)
+ parameters = {}
+ if since_id:
+ parameters['since_id']=since_id