diff --git a/nullptr/central_command.py b/nullptr/central_command.py index cd87dad..7c6f590 100644 --- a/nullptr/central_command.py +++ b/nullptr/central_command.py @@ -30,14 +30,6 @@ class CentralCommand: mission = self.missions[ship] mission.step() return True - - def wait_for_stop(self): - try: - input() - except EOFError: - pass - self.stopping = True - print('stopping...') def run_interactive(self): print('auto mode. hit enter to stop') @@ -46,7 +38,17 @@ class CentralCommand: t.start() self.run() print('manual mode') - + + + def wait_for_stop(self): + try: + input() + except EOFError: + pass + self.stopping = True + print('stopping...') + + def run(self): self.update_missions() while not self.stopping: diff --git a/nullptr/commander.py b/nullptr/commander.py index 8b84e92..1a223f6 100644 --- a/nullptr/commander.py +++ b/nullptr/commander.py @@ -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: diff --git a/nullptr/models/marketplace.py b/nullptr/models/marketplace.py index 6ae0e98..ca6e4ae 100644 --- a/nullptr/models/marketplace.py +++ b/nullptr/models/marketplace.py @@ -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