Update central_command.py, commander.py and one other file

This commit is contained in:
Richard Bronkhorst 2023-07-03 19:12:26 +02:00
parent d6fe1cf183
commit 3010a8186d
3 changed files with 14 additions and 9 deletions

View File

@ -30,14 +30,6 @@ class CentralCommand:
mission = self.missions[ship] mission = self.missions[ship]
mission.step() mission.step()
return True return True
def wait_for_stop(self):
try:
input()
except EOFError:
pass
self.stopping = True
print('stopping...')
def run_interactive(self): def run_interactive(self):
print('auto mode. hit enter to stop') print('auto mode. hit enter to stop')
@ -46,7 +38,17 @@ class CentralCommand:
t.start() t.start()
self.run() self.run()
print('manual mode') print('manual mode')
def wait_for_stop(self):
try:
input()
except EOFError:
pass
self.stopping = True
print('stopping...')
def run(self): def run(self):
self.update_missions() self.update_missions()
while not self.stopping: while not self.stopping:

View File

@ -123,6 +123,8 @@ class Commander(CommandLine):
def do_chaul(self): def do_chaul(self):
if not self.has_ship(): return if not self.has_ship(): return
if len(ship.cargo) > 0:
raise CommandError('please dump cargo first')
contract = self.active_contract() contract = self.active_contract()
delivery = contract.unfinished_delivery() delivery = contract.unfinished_delivery()
if delivery is None: if delivery is None:

View File

@ -25,6 +25,7 @@ class Marketplace(SystemMember):
price['symbol'] = symbol price['symbol'] = symbol
price['buy'] = mg(g, 'purchasePrice') price['buy'] = mg(g, 'purchasePrice')
price['sell'] = mg(g, 'sellPrice') price['sell'] = mg(g, 'sellPrice')
price['volume'] = mg(g, 'tradeVolume')
prices[symbol] = price prices[symbol] = price
self.prices = prices self.prices = prices