Skip to content

Commit

Permalink
Properly forward debug level so that build cache sees it
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Smith committed Oct 16, 2014
1 parent 0a8e4ef commit 5e1188c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions data/buildcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tradedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


############################################################
Expand Down

0 comments on commit 5e1188c

Please sign in to comment.