(lang: str, export_path: str, content: str)
| 1014 | |
| 1015 | # ------------------ Export helper ------------------ |
| 1016 | def export_text(lang: str, export_path: str, content: str) -> None: |
| 1017 | if not export_path.strip(): |
| 1018 | return |
| 1019 | p = Path(export_path).expanduser() |
| 1020 | try: |
| 1021 | p.parent.mkdir(parents=True, exist_ok=True) |
| 1022 | p.write_text(content, encoding="utf-8") |
| 1023 | except Exception as e: |
| 1024 | print(t("err_export", lang, path=p, err=e), file=sys.stderr) |
| 1025 | |
| 1026 | |
| 1027 | # ------------------ Installer (no root) ------------------ |
no test coverage detected