From: kk6 Date: Wed, 13 Mar 2013 13:14:24 +0000 (+0900) Subject: Fixed user_ids and screen_names argument of the new method to receive a list. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=f15a2424bf95d81c7d5924d301e1e23e9a8db008;p=tweepy.git Fixed user_ids and screen_names argument of the new method to receive a list. --- diff --git a/tests/test_api.py b/tests/test_api.py index 8419fb4..1d31c7f 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -284,7 +284,7 @@ class TweepyAPITests(TweepyTestCase): params = { 'slug': 'test', 'owner_screen_name': username, - 'screen_name': 'twitterapi,twittermobile' + 'screen_names': ['twitterapi', 'twittermobile'] } def assert_list(l): diff --git a/tweepy/api.py b/tweepy/api.py index a538491..e438ba5 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -576,19 +576,35 @@ class API(object): require_auth = True ) - add_list_members = bind_api( + """ Perform bulk add of list members from user ID or screenname """ + def add_list_members(self, screen_names=None, user_ids=None, slug=None, + list_id=None, owner_id=None, owner_screen_name=None): + return self._add_list_members(list_to_csv(screen_names), + list_to_csv(user_ids), + slug, list_id, owner_id, + owner_screen_name) + + _add_list_members = bind_api( path = '/lists/members/create_all.json', method = 'POST', payload_type = 'list', - allowed_param = ['screen_name', 'user_id', 'owner_screen_name', 'owner_id', 'slug', 'list_id'], + allowed_param = ['screen_name', 'user_id', 'slug', 'lit_id', 'owner_id', 'owner_screen_name'], require_auth = True ) - remove_list_members = bind_api( + """ Perform bulk remove of list members from user ID or screenname """ + def remove_list_members(self, screen_names=None, user_ids=None, slug=None, + list_id=None, owner_id=None, owner_screen_name=None): + return self._remove_list_members(list_to_csv(screen_names), + list_to_csv(user_ids), + slug, list_id, owner_id, + owner_screen_name) + + _remove_list_members = bind_api( path = '/lists/members/destroy_all.json', method = 'POST', payload_type = 'list', - allowed_param = ['screen_name', 'user_id', 'owner_screen_name', 'owner_id', 'slug', 'list_id'], + allowed_param = ['screen_name', 'user_id', 'slug', 'lit_id', 'owner_id', 'owner_screen_name'], require_auth = True )