Fixed printing lists for users
This commit is contained in:
parent
8fac5ad7c2
commit
9af8d9a496
|
@ -259,7 +259,7 @@ class GetUserLists(ApiThread):
|
|||
twitter_lists = self.api.GetUserLists()
|
||||
for name in [l.name for l in twitter_lists['lists']]:
|
||||
list_members = self.api.GetListMembers(name)
|
||||
lists[name] = [u.name for u in list_members['users']]
|
||||
lists[name] = [u.screen_name for u in list_members['users']]
|
||||
except (HTTPError, URLError) as exception:
|
||||
print 'debug: GetUserLists had error: ' + str(exception.code)
|
||||
sleep(30)
|
||||
|
|
10
hrafn.py
10
hrafn.py
|
@ -341,24 +341,20 @@ class Hrafn():
|
|||
found_lists = []
|
||||
username = re.sub('user: ', '', name)
|
||||
|
||||
|
||||
# We're not going to change the data, just access it.
|
||||
# This condition only exists to let us know when the lists are
|
||||
# ready
|
||||
# Ergo, we can release it right after we get out of the conditional
|
||||
self.lists_cond.acquire()
|
||||
while not self.lists.has_key(self.username):
|
||||
self.lists_cond.wait()
|
||||
self.lists_cond.release()
|
||||
|
||||
for list_name in self.lists[self.username].keys():
|
||||
try:
|
||||
i = self.lists[self.username][list_name].index(username)
|
||||
found_lists.append(list_name)
|
||||
except:
|
||||
except ValueError:
|
||||
pass
|
||||
new_pane.set_lists(found_lists)
|
||||
|
||||
self.lists_cond.release()
|
||||
|
||||
new_pane.connect('at-clicked', self.on_at_button_clicked)
|
||||
new_pane.connect('follow-clicked', self.on_follow_button_clicked)
|
||||
apithreads.GetFollowing(api=self.api, pane=new_pane, user=name).start()
|
||||
|
|
|
@ -753,13 +753,14 @@ class UserBox(gtk.VBox):
|
|||
self.verified_label.hide()
|
||||
self.name_label.hide()
|
||||
self.avatar.hide()
|
||||
self.list_label.hide()
|
||||
|
||||
|
||||
def set_lists(self, lists):
|
||||
if not lists:
|
||||
return
|
||||
|
||||
list_label_text = 'In lists: '
|
||||
list_label_text = 'Lists: '
|
||||
|
||||
for l in lists:
|
||||
list_label_text += l + ' '
|
||||
|
|
Reference in New Issue
Block a user