(self, mod_name: str, struct_name: str)
| 5536 | return |
| 5537 | |
| 5538 | def __create_or_edit_structure(self, mod_name: str, struct_name: str) -> int: |
| 5539 | path = pathlib.Path(gef.config["pcustom.struct_path"]).expanduser() / f"{mod_name}.py" |
| 5540 | if path.is_file(): |
| 5541 | info(f"Editing '{path}'") |
| 5542 | else: |
| 5543 | ok(f"Creating '{path}' from template") |
| 5544 | self.__create_template(struct_name, path) |
| 5545 | |
| 5546 | cmd = (os.getenv("EDITOR") or "nano").split() |
| 5547 | cmd.append(str(path.absolute())) |
| 5548 | return subprocess.call(cmd) |
| 5549 | |
| 5550 | def __create_template(self, structname: str, fpath: pathlib.Path) -> None: |
| 5551 | template = f"""from ctypes import * |
no test coverage detected