From b08f26d0b95c5baebb6b70a7005d3b82068500b2 Mon Sep 17 00:00:00 2001 From: Josh Roesslein Date: Fri, 30 Oct 2009 20:20:28 -0500 Subject: [PATCH] Add parser for lists. --- tweepy/parsers.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tweepy/parsers.py b/tweepy/parsers.py index e2d76a5..b856fe5 100644 --- a/tweepy/parsers.py +++ b/tweepy/parsers.py @@ -267,3 +267,20 @@ def parse_retweets(obj, api): retweets.append(_parse_retweet(item, api)) return retweets +def parse_list(obj, api): + + lst = models['list']() + for k,v in obj.items(): + if k == 'user': + setattr(lst, k, _parse_user(v, api)) + else: + setattr(lst, k, v) + return lst + +def parse_lists(obj, api): + + lists = [] + for item in obj: + lists.append(parse_list(item, api)) + return lists + -- 2.25.1