| 6 | |
| 7 | |
| 8 | class EventSchema: |
| 9 | def __init__(self, type_list, role_list, type_role_dict): |
| 10 | self.type_list = type_list |
| 11 | self.role_list = role_list |
| 12 | self.type_role_dict = type_role_dict |
| 13 | |
| 14 | @staticmethod |
| 15 | def read_from_file(filename): |
| 16 | lines = open(filename).readlines() |
| 17 | type_list = json.loads(lines[0]) |
| 18 | role_list = json.loads(lines[1]) |
| 19 | type_role_dict = json.loads(lines[2]) |
| 20 | return EventSchema(type_list, role_list, type_role_dict) |
| 21 | |
| 22 | def write_to_file(self, filename): |
| 23 | with open(filename, 'w') as output: |
| 24 | output.write(json.dumps(self.type_list) + '\n') |
| 25 | output.write(json.dumps(self.role_list) + '\n') |
| 26 | output.write(json.dumps(self.type_role_dict) + '\n') |
| 27 | |
| 28 | |
| 29 | def merge_schema(schema_list: List[EventSchema]): |
no outgoing calls
no test coverage detected