Skip to content

Commit

Permalink
Added TradeDB.getSystem
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Aug 14, 2014
1 parent b6bde7e commit f3d9904
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tradedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,17 @@ def validate(self):
if not sys in link.links:
raise ValueError("System %s does not have a reciprocal link in %s's links" % (name, link.str()))

def getSystem(self, name):
""" Look up a system by it's name. """
if isinstance(name, System):
return name
if isinstance(name, Station):
return name.system

system = self.list_search("System", name, self.systemIDs.keys())
return self.systemIDs[system]


def getStation(self, name):
if isinstance(name, Station):
return name
Expand Down

0 comments on commit f3d9904

Please sign in to comment.