(self, save_path, json_stream)
| 468 | self.save_json_stream(path, out_stream()) |
| 469 | |
| 470 | def save_json_stream(self, save_path, json_stream): |
| 471 | if self.loose_json: |
| 472 | with open(save_path, 'w') as f: |
| 473 | for i, j in enumerate(json_stream): |
| 474 | write_string = '' |
| 475 | if i != 0: |
| 476 | write_string = '\n' |
| 477 | write_string += json.dumps(j) |
| 478 | f.write(write_string) |
| 479 | else: |
| 480 | jsons = [j for j in json_stream] |
| 481 | json.dump(jsons, open(save_path, 'w'), separators=(',', ':')) |
| 482 | |
| 483 | def load_json_stream(self, load_path): |
| 484 | if not self.loose_json: |