2021-06-07 11:38:43 -07:00
|
|
|
#!/usr/bin/env pyston3
|
|
|
|
|
|
|
|
import argparse
|
|
|
|
import logging
|
|
|
|
import os
|
|
|
|
import os.path
|
|
|
|
import sys
|
|
|
|
import traceback
|
|
|
|
|
|
|
|
sys.path.insert(0, os.path.abspath(
|
2021-06-25 02:33:40 -07:00
|
|
|
os.path.join(os.path.dirname(__file__), "..")))
|
2021-06-07 11:38:43 -07:00
|
|
|
import mango # nopep8
|
|
|
|
|
|
|
|
parser = argparse.ArgumentParser(description="Shows the on-chain data of a Mango Markets Group.")
|
2021-07-23 02:20:44 -07:00
|
|
|
mango.ContextBuilder.add_command_line_parameters(parser)
|
2021-06-07 11:38:43 -07:00
|
|
|
args = parser.parse_args()
|
|
|
|
|
|
|
|
logging.getLogger().setLevel(args.log_level)
|
|
|
|
logging.warning(mango.WARNING_DISCLAIMER_TEXT)
|
|
|
|
|
|
|
|
try:
|
2021-07-23 02:20:44 -07:00
|
|
|
context = mango.ContextBuilder.from_command_line_parameters(args)
|
2021-06-07 11:38:43 -07:00
|
|
|
|
2021-06-25 07:50:37 -07:00
|
|
|
group = mango.Group.load(context)
|
2021-06-07 11:38:43 -07:00
|
|
|
print(group)
|
|
|
|
except Exception as exception:
|
2021-06-20 11:34:59 -07:00
|
|
|
logging.critical(f"show-group stopped because of exception: {exception} - {traceback.format_exc()}")
|
2021-06-07 11:38:43 -07:00
|
|
|
except:
|
2021-06-20 11:34:59 -07:00
|
|
|
logging.critical(f"show-group stopped because of uncatchable error: {traceback.format_exc()}")
|