From 21c90eb39483cfe32a9515cbbede2143a59d83eb Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Fri, 5 Aug 2016 23:20:18 +0200 Subject: [PATCH] Convert generator to list for getFollowers()/getFollowing() Fix SQL query in getFollowing() --- filler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/filler.py b/filler.py index 1fc7514..5782bf9 100755 --- a/filler.py +++ b/filler.py @@ -51,7 +51,7 @@ def getMessages(db=dbtools.dbHelper(), two=twitools.twObject()): return mcount, savepoint or 0, db.getLatestMessage() def getFollowers(db=dbtools.dbHelper(), two=twitools.twObject(), firstrun=False): - current = db.getFollowers() + current = list(db.getFollowers()) new = list(twitools.getNamesByIDs(twitools.getFollowerIDs())) gained = 0 lost = 0 @@ -77,7 +77,7 @@ def getFollowers(db=dbtools.dbHelper(), two=twitools.twObject(), firstrun=False) return gained, lost def getFollowing(db=dbtools.dbHelper(), two=twitools.twObject(), firstrun=False): - current = db.getFollowing() + current = list(db.getFollowing()) new = list(twitools.getNamesByIDs(twitools.getFollowingIDs())) gained = 0 lost = 0 @@ -94,7 +94,7 @@ def getFollowing(db=dbtools.dbHelper(), two=twitools.twObject(), firstrun=False) for following in current: if following not in new: - db.executeQuery("UPDATE following SET `until` = %i WHERE `id` = %s AND `until` IS NULL" % (int(time.time()), following)) + db.executeQuery("UPDATE following SET `until` = %i WHERE `id` = '%s' AND `until` IS NULL" % (int(time.time()), following)) print("You no longer follow: %s" % following) lost += 1