Skip to content

Commit

Permalink
TradeDB.load() now takes buildLinks and loadTrades arguments (default…
Browse files Browse the repository at this point in the history
… True)
  • Loading branch information
kfsone committed Oct 26, 2014
1 parent 63e9fa3 commit fd64016
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tradedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ def getTrades(self, src, dst):
return srcStn.tradingWith[dstStn]


def load(self, dbFilename=None, maxSystemLinkLy=None):
def load(self, dbFilename=None, maxSystemLinkLy=None, buildLinks=True, includeTrades=True):
"""
Populate/re-populate this instance of TradeDB with data.
WARNING: This will orphan existing records you have
Expand Down Expand Up @@ -789,9 +789,11 @@ def load(self, dbFilename=None, maxSystemLinkLy=None):
self.maxSystemLinkLy = maxSystemLinkLy
if self.debug > 2: print("# Max ship jump distance: %s @ %f" % (longestJumper.name(), self.maxSystemLinkLy))

self.buildLinks()
if buildLinks:
self.buildLinks()

self.loadTrades()
if includeTrades:
self.loadTrades()

# In debug mode, check that everything looks sane.
if self.debug:
Expand Down

0 comments on commit fd64016

Please sign in to comment.