From 6fc2d8526eb0e8a6f5ad1dc47d4d1cacfa79d4d7 Mon Sep 17 00:00:00 2001 From: The Dod Date: Thu, 10 Apr 2014 04:01:06 +0700 Subject: [PATCH] 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) --- twister.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/twister.py b/twister.py index bc21a59..82eb71b 100644 --- a/twister.py +++ b/twister.py @@ -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')]