Change return value of datecsv.getTweetsByDate() to a list of tweets rather than None
Move CSV output function to tools.printCSV()
This commit is contained in:
parent
6a1cce1b97
commit
e2ab015218
|
@ -3,7 +3,7 @@
|
|||
|
||||
import tools
|
||||
|
||||
import csv, sys, datetime
|
||||
import sys, datetime
|
||||
|
||||
def checkDate(date):
|
||||
try:
|
||||
|
@ -71,11 +71,8 @@ def queryBuilder(strings = [], fr = "", to = ""):
|
|||
|
||||
def getTweetsByDate(strings = [], path = tools.config.dbpath, fr = "", to = ""):
|
||||
db = tools.dbHelper(path)
|
||||
tweets = db.executeQuery(queryBuilder(strings,fr,to))
|
||||
writer = csv.writer(sys.stdout)
|
||||
|
||||
writer.writerows(tweets)
|
||||
return db.executeQuery(queryBuilder(strings,fr,to))
|
||||
|
||||
if __name__ == "__main__":
|
||||
strings, fr, to = dateArgs()
|
||||
getTweetsByDate(strings = strings, fr = fr, to = to)
|
||||
tools.printCSV(getTweetsByDate(strings = strings, fr = fr, to = to))
|
||||
|
|
Loading…
Reference in a new issue