| 153 | return self.retType + "(" + (record.name + "::" if record else "") + "*)(" + str.join(", ", [x.type for name, x in vars(desc.fields).items()]) + ")" + ("const" if desc.isConst else "") |
| 154 | |
| 155 | def write(self, path, content): |
| 156 | RE_PYTHON_ADDR = re.compile(r"<.+? object at 0x[0-9a-fA-F]+>") |
| 157 | directory = os.path.dirname(path) |
| 158 | if not os.path.exists(directory): |
| 159 | os.makedirs(directory, exist_ok=True) |
| 160 | open(path, "wb").write(content.encode("utf-8")) |
| 161 | |
| 162 | python_addr = RE_PYTHON_ADDR.search(content) |
| 163 | if python_addr: |
| 164 | abort('Found "{}" in {} ({})'.format( |
| 165 | python_addr.group(0), os.path.basename(path), path)) |
| 166 | |
| 167 | |
| 168 | def load_generator(i, path): |