Skip to content

Commit

Permalink
Gave TradeDB a way to lookup a ship by name: TradeDB.getShip("Type 9")
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Aug 21, 2014
1 parent 650570b commit 9e702bc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tradedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,9 @@ def getStation(self, name):
raise ValueError("System '%s' has %d stations, please specify a station instead." % (name, len(system.stations)))
return system.stations[0]

def getShip(self, name):
""" Look up a ship by name """
return self.list_search("Ship", name, self.ships, key=lambda item: item.name)

def query(self, *args):
""" Perform an SQL query on the DB and return the cursor. """
Expand Down

0 comments on commit 9e702bc

Please sign in to comment.