set_unittest_config.py 718 B

12345678910111213141516171819202122
  1. import argparse
  2. import json
  3. import os
  4. def set_config(guest_party_id, host_party_id):
  5. os.makedirs('./jobs', exist_ok=True)
  6. with open(os.path.join('./jobs', 'party_info.json'), 'w') as fw:
  7. json.dump({
  8. 'guest': guest_party_id,
  9. 'host': host_party_id
  10. }, fw)
  11. if __name__ == '__main__':
  12. arg_parser = argparse.ArgumentParser()
  13. arg_parser.add_argument("guest_party_id", type=int, help="please input guest party id")
  14. arg_parser.add_argument("host_party_id", type=int, help="please input host party id")
  15. args = arg_parser.parse_args()
  16. guest_party_id = args.guest_party_id
  17. host_party_id = args.host_party_id
  18. set_config(guest_party_id, host_party_id)