#!/usr/bin/env python
# -*- coding: utf-8 -*-

import argparse
from gfail.webpage import create_info


if __name__ == '__main__':
    desc = '''
    Create info.json for an event's ground failure result. The code
    looks in the event directory for the model results (in hdf5 format)
    that are output by the 'gfail' program.

    Note: the file is temporarily named "info2.json" since "info.json"
    is also created by another script and I don't want to delete that
    until we are sure that this file is sufficient.
    '''
    parser = argparse.ArgumentParser(description=desc)
    parser.add_argument('-e', '--event_dir',
                        help='Directory containing ground failure results for '
                             'this event.',
                        required=True)
    args = parser.parse_args()
    create_info(args.event_dir)
