Skip to content

Commit

Permalink
debug_log helper
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Aug 25, 2014
1 parent 3550c06 commit b56fc86
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion dbimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@
inDB = "Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=.\\TradeDangerous.accdb"
outDB = "tradedb.sq3"

systems = {}
systems, systemByID = {}, {}
stations, stationByOldID = {}, {}
categories, categoryByOldID = {}, {}
items, itemByOldID = {}, {}
debug = 1

# We also track the maximum distance any ship can jump,
# then we use this value to constrain links between stations.
maxJumpDistanceLy = 0.0

######################################################################
# Helpers

class check_item(object):
"""
Expand All @@ -49,6 +53,13 @@ def __exit__(self, type, value, traceback):
else:
print('[+]') if not self.noop else print("\bNO-OP")

def debug_log(level, message):
if debug >= level:
print(" [ {:^59} ]".format(message))

######################################################################
# Main

def main():
# Destroy the SQLite database if it already exists.
try: os.remove(outDB)
Expand Down

0 comments on commit b56fc86

Please sign in to comment.