Change return type of getTweetsByDate() to list
Concatenate lists to have one less call of tools.printCSV()
This commit is contained in:
parent
4371ba7b41
commit
ba433a79e7
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue