From 3cfd9209802b4ea26a3e0046e71f9d7faaf5d37b Mon Sep 17 00:00:00 2001 From: kk6 Date: Wed, 13 Mar 2013 22:14:24 +0900 Subject: [PATCH] Fixed user_ids and screen_names argument of the new method to receive a list. --- tests.py | 2 +- tweepy/api.py | 24 ++++++++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/tests.py b/tests.py index 5fb7772..b5b2aaa 100644 --- a/tests.py +++ b/tests.py @@ -281,7 +281,7 @@ class TweepyAPITests(unittest.TestCase): 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 8464090..5d6dddc 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -574,19 +574,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 ) -- 2.25.1