-def main_process_market(user_market, before=False, after=False):
- if before:
- process_sell_all__1_all_sell(user_market)
- if after:
- portfolio.Portfolio.wait_for_recent(user_market)
- process_sell_all__2_all_buy(user_market)
+def main_process_market(user_market, action, before=False, after=False):
+ if action is None:
+ if before:
+ process_sell_all__1_all_sell(user_market)
+ if after:
+ portfolio.Portfolio.wait_for_recent(user_market)
+ process_sell_all__2_all_buy(user_market)
+ elif action == "print_balances":
+ print_balances(user_market)
+ elif action == "print_orders":
+ print_orders(user_market)
+ else:
+ raise NotImplementedError("Unknown action {}".format(action))