projects
/
tweepy.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
87d38c4
)
Add parser for lists.
author
Josh Roesslein
<jroesslein@gmail.com>
Sat, 31 Oct 2009 01:20:28 +0000
(20:20 -0500)
committer
Josh Roesslein
<jroesslein@gmail.com>
Sat, 31 Oct 2009 01:20:28 +0000
(20:20 -0500)
tweepy/parsers.py
patch
|
blob
|
blame
|
history
diff --git
a/tweepy/parsers.py
b/tweepy/parsers.py
index e2d76a59a59b136c7e279b1784a2b37adae8bd38..b856fe54e326a1a2596835509dfcd0c738febb9a 100644
(file)
--- 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
+