Skip to content

Commit

Permalink
Only print deprecation warnings when debug is specified
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Smith committed Nov 5, 2014
1 parent 575d386 commit 4921cfb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions buildcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,22 +546,22 @@ def processPricesFile(db, pricesPath, stationID=None, defaultZero=False, debug=0

######################################################################

def deprecationCheckSystem(line):
def deprecationCheckSystem(line, debug):
correctSystem = corrections.correctSystem(line[0])
if correctSystem != line[0]:
print("System.csv: deprecated system: {}".format(line[0]))
if debug: print("! System.csv: deprecated system: {}".format(line[0]))
line[0] = correctSystem


def deprecationCheckStation(line):
def deprecationCheckStation(line, debug):
correctSystem = corrections.correctSystem(line[0])
if correctSystem != line[0]:
print("Station.csv: deprecated system: {}".format(line[0]))
if debug: print("! Station.csv: deprecated system: {}".format(line[0]))
line[0] = correctSystem

correctStation = corrections.correctStation(line[1])
if correctStation != line[1]:
print("Station.csv: deprecated station: {}".format(line[1]))
if debug: print("! Station.csv: deprecated station: {}".format(line[1]))
line[1] = correctStation


Expand Down Expand Up @@ -624,7 +624,7 @@ def processImportFile(db, importPath, tableName, debug=0):

for linein in csvin:
if len(linein) == columnCount:
if deprecationFn: deprecationFn(linein)
if deprecationFn: deprecationFn(linein, debug)
if debug > 1:
print("- Values: {}".format(', '.join(linein)))
try:
Expand Down

0 comments on commit 4921cfb

Please sign in to comment.