def __call__(self, args):
self.args = args<EOL>self.field_definitions = load_field_definitions()<EOL>with open(self.args.report_a_path) as f:<EOL><INDENT>report_a = json.load(f, object_pairs_hook=OrderedDict)<EOL><DEDENT>with open(self.args.report_b_path) as f:<EOL><INDENT>report_b = json.load(f, object_pairs_hook=OrderedDict)<EOL><DEDENT>diff = self.diff(report_a, report_b)<EOL>output_format = os.path.splitext(self.args.output_path)[<NUM_LIT:1>]<EOL>if output_format == '<STR_LIT>':<EOL><INDENT>with open(self.args.output_path, '<STR_LIT:w>') as f:<EOL><INDENT>self.html(diff, f)<EOL><DEDENT><DEDENT>elif output_format == '<STR_LIT>':<EOL><INDENT>with open(self.args.output_path, '<STR_LIT:w>') as f:<EOL><INDENT>json.dump(diff, f, indent=<NUM_LIT:4>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise Exception('<STR_LIT>' % output_format)<EOL><DEDENT>
Compare two data files and generate a report of their differences.