From f7696e2d67c5706f9611b19f7fb0cdf94a0338d9 Mon Sep 17 00:00:00 2001 From: Anna Date: Fri, 21 May 2010 12:11:57 -0400 Subject: [PATCH] Fixed CustomApi so that _username is defined --- apithreads.py | 1 + oauthtwitter.py | 1 - python-twitter-GetListStatuses.patch | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apithreads.py b/apithreads.py index e810bcb..3933cf9 100644 --- a/apithreads.py +++ b/apithreads.py @@ -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) diff --git a/oauthtwitter.py b/oauthtwitter.py index 940f34d..692f268 100755 --- a/oauthtwitter.py +++ b/oauthtwitter.py @@ -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: diff --git a/python-twitter-GetListStatuses.patch b/python-twitter-GetListStatuses.patch index 85990bc..85cb33c 100644 --- a/python-twitter-GetListStatuses.patch +++ b/python-twitter-GetListStatuses.patch @@ -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