(self, data, filepath)
| 98 | self.__write_file(data, filepath) |
| 99 | |
| 100 | def __write_file(self, data, filepath): |
| 101 | data_str = json.dumps( |
| 102 | data, |
| 103 | ensure_ascii=False, |
| 104 | cls=CustomEncoder, |
| 105 | indent=self.indent, |
| 106 | # We're handling sorting in customized encoder |
| 107 | sort_keys=False) |
| 108 | data_bytes = data_str.encode('utf8') |
| 109 | with open(filepath, 'wb') as f: |
| 110 | f.write(data_bytes) |
| 111 | |
| 112 | def __secure_name(self, name): |
| 113 | """ |