25 lines
657 B
Python
25 lines
657 B
Python
from connector import get_connexion
|
|
|
|
|
|
def get_contract(title):
|
|
for c in get_connexion().space_center.contract_manager.active_contracts:
|
|
if c.title == title:
|
|
return c
|
|
|
|
raise LookupError('Contract "{}" not found'.format(title))
|
|
|
|
|
|
def get_vessel(name):
|
|
for v in get_connexion().space_center.vessels:
|
|
if v.name == name:
|
|
return v
|
|
|
|
raise LookupError("Vessel {} not found".format(name))
|
|
|
|
|
|
def get_rescuee_vessel(rescuee_name):
|
|
for v in get_connexion().space_center.vessels:
|
|
if rescuee_name in v.name:
|
|
return v
|
|
|
|
raise LookupError("Rescuee {} vessel not found".format(rescuee_name)) |