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

@ -31,6 +31,15 @@ class CentralCommand:
mission.step()
return True
def run_interactive(self):
print('auto mode. hit enter to stop')
t = Thread(target=self.wait_for_stop)
t.daemon = True
t.start()
self.run()
print('manual mode')
def wait_for_stop(self):
try:
input()
@ -39,13 +48,6 @@ class CentralCommand:
self.stopping = True
print('stopping...')
def run_interactive(self):
print('auto mode. hit enter to stop')
t = Thread(target=self.wait_for_stop)
t.daemon = True
t.start()
self.run()
print('manual mode')
def run(self):
self.update_missions()

View File

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

View File

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