Fixed user_ids and screen_names argument of the new method to receive a list.
authorkk6 <kekelo1603@gmail.com>
Wed, 13 Mar 2013 13:14:24 +0000 (22:14 +0900)
committerkk6 <kekelo1603@gmail.com>
Thu, 27 Mar 2014 16:44:19 +0000 (01:44 +0900)
tests/test_api.py
tweepy/api.py

index 8419fb4997cf1c6200dfa9bf91cf33b1a264f49d..1d31c7fedd402091721f7a14e9f440600790945c 100644 (file)
@@ -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):
index a538491be61759c4cb915d6a7009b0abdd202168..e438ba50d50cdf247c1e700a1e24daaf3cdbdb23 100644 (file)
@@ -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
     )