Fix apparent problems with database objects in filler

This commit is contained in:
Klaus-Uwe Mitterer 2016-08-04 18:17:59 +02:00
parent 5fc9078ea8
commit 8381c4469a

View file

@ -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))