Change return type of getTweetsByDate() to list

Concatenate lists to have one less call of tools.printCSV()
This commit is contained in:
Klaus-Uwe Mitterer 2015-04-27 20:37:37 +02:00
parent 4371ba7b41
commit ba433a79e7

View file

@ -70,9 +70,8 @@ def queryBuilder(strings = [], fr = "", to = ""):
def getTweetsByDate(strings = [], path = tools.config.dbpath, fr = "", to = ""):
db = tools.dbHelper(path)
return db.executeQuery(queryBuilder(strings,fr,to))
return list(db.executeQuery(queryBuilder(strings,fr,to)))
if __name__ == "__main__":
strings, fr, to = dateArgs()
tools.printCSV([["Date", "Tweets"] + [s for s in strings]])
tools.printCSV(getTweetsByDate(strings = strings, fr = fr, to = to))
tools.printCSV([["Date", "Tweets"] + [s for s in strings]] + getTweetsByDate(strings = strings, fr = fr, to = to))