From 8381c4469a3c369bd196842051198ff8b56b6167 Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Thu, 4 Aug 2016 18:17:59 +0200 Subject: [PATCH] Fix apparent problems with database objects in filler --- filler.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/filler.py b/filler.py index 657301f..8f56c21 100755 --- a/filler.py +++ b/filler.py @@ -24,8 +24,6 @@ def getTweets(db=dbtools.dbHelper(), user=twitools.twObject().whoami(), two=twit last = status.id tw_counter = tw_counter + 1 - db.closeConnection() - return tw_counter, last, savepoint def getMessages(db=dbtools.dbHelper(), two=twitools.twObject()): @@ -97,11 +95,12 @@ def getFollowing(db=dbtools.dbHelper(), two=twitools.twObject()): return gained, lost if __name__ == "__main__": - count, last, first = getTweets() + db = dbtools.dbHelper() + count, last, first = getTweets(db) print("Stored %i tweets." % count) - count, last, first = getMessages() + count, last, first = getMessages(db) print("Stored %i messages." % count) - gained, lost = getFollowers() + gained, lost = getFollowers(db) print("Gained %i followers, lost %i." % (gained, lost)) - gained, lost = getFollowing() + gained, lost = getFollowing(db) print("Started following %i, stopped following %i." % (gained, lost))