No more "phantom reply footer"

reversed(...) returns an iterator, so if you "not not" it, you
don't get False for an empty list (ouch)
This commit is contained in:
The Dod 2014-04-10 04:01:06 +07:00
parent 294c0c69e1
commit 6fc2d8526e

View File

@ -59,7 +59,7 @@ class Twister:
})
@functioncache(60,ignore_instance=True)
def get_twist_replies(self,username,k):
return reversed([self._format_post_info(r['p']['v']) for r in self.twister.dhtget(username,'replies{0}'.format(k),'m')]) # We show them oldest first
return list(reversed([self._format_post_info(r['p']['v']) for r in self.twister.dhtget(username,'replies{0}'.format(k),'m')])) # We show them oldest first
@functioncache(60,ignore_instance=True)
def get_twist_rts(self,username,k):
return [self._format_post_info(r['p']['v']) for r in self.twister.dhtget(username,'rts{0}'.format(k),'m')]
@ -103,7 +103,7 @@ class Twister:
return [{"username":u} for u in self.twister.getfollowing(localusername)]
@functioncache(60*5,ignore_instance=True)
def get_promoted_posts(self,num=8):
return reversed([self._format_post_info(p) for p in self.twister.getspamposts(num)]) # Don't ask me why reversed :)
return list(reversed([self._format_post_info(p) for p in self.twister.getspamposts(num)])) # Don't ask me why reversed :)
@functioncache(60,ignore_instance=True)
def get_tag_posts(self,tag):
return [self._format_post_info(p['p']['v']) for p in self.twister.dhtget(tag,'hashtag','m')]