Skip to content

Commit

Permalink
Do not use the dataDir if the DB-name was given on the commandline.
Browse files Browse the repository at this point in the history
  • Loading branch information
bgol committed Dec 6, 2014
1 parent abeb5a7 commit c75adff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tradedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def __init__(self,
self.tdenv = tdenv or TradeEnv(debug=(debug or 0))

dataDir = Path(tdenv.dataDir).resolve()
self.dbPath = dataDir / Path(tdenv.dbFilename or TradeDB.defaultDB)
self.dbPath = Path(tdenv.dbFilename or dataDir / TradeDB.defaultDB)
self.sqlPath = dataDir / Path(tdenv.sqlFilename or TradeDB.defaultSQL)
self.pricesPath = dataDir / Path(tdenv.pricesFilename or TradeDB.defaultPrices)
self.importTables = [(str(dataDir / Path(x[0])), x[1]) for x in TradeDB.defaultTables]
Expand Down Expand Up @@ -719,7 +719,7 @@ def lookup(name, candidates):
# Nothing matched
if not any([exactMatch, closeMatch, wordMatch, anyMatch]):
raise TradeException("Unrecognized place: {}".format(name))

# More than one match
raise AmbiguityError(
'System/Station', name,
Expand Down

0 comments on commit c75adff

Please sign in to comment.