diff --git a/data/buildcache.py b/data/buildcache.py index 60a7280d..d34b69b7 100644 --- a/data/buildcache.py +++ b/data/buildcache.py @@ -125,7 +125,8 @@ def processPricesFile(db, pricesPath, stationID=None, debug=0): db.executemany(stmt, bindValues) db.commit() except FileNotFoundError: - print("WARNING: processPricesFile found no {} file".format(pricesPath)) + if debug: + print("WARNING: processPricesFile found no {} file".format(pricesPath)) def buildCache(dbPath, sqlPath, pricesPath, debug=0): """ @@ -153,7 +154,7 @@ def buildCache(dbPath, sqlPath, pricesPath, debug=0): tempDB.executescript(sqlScript) # Parse the prices file - processPricesFile(tempDB, pricesPath) + processPricesFile(tempDB, pricesPath, debug=debug) # Database is ready; copy it to a persistent store. if debug: print("* Populating SQLite database file '%s'" % dbPath) diff --git a/tradedb.py b/tradedb.py index c2d10eeb..72a17b56 100644 --- a/tradedb.py +++ b/tradedb.py @@ -408,7 +408,7 @@ def getMostRecentTimestamp(altPath): print("* Building DB cache") import data.buildcache - data.buildcache.buildCache(dbPath=self.dbPath, sqlPath=self.sqlPath, pricesPath=self.pricesPath) + data.buildcache.buildCache(dbPath=self.dbPath, sqlPath=self.sqlPath, pricesPath=self.pricesPath, debug=self.debug) ############################################################