From ba433a79e71c801fcb64122f75dc5c054da9676e Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Mon, 27 Apr 2015 20:37:37 +0200 Subject: [PATCH] Change return type of getTweetsByDate() to list Concatenate lists to have one less call of tools.printCSV() --- getdates.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/getdates.py b/getdates.py index 7b9f8f3..95ea00b 100755 --- a/getdates.py +++ b/getdates.py @@ -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))