b38661f588
Python application / build (push) Has been cancelled
- Add\Rework UI - Add Split Table and Listing - Add Support Customazeble schems
31 lines
928 B
Python
31 lines
928 B
Python
"""Download official plantuml.jar into md2gost/vendor (for exe builds)."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
if str(ROOT) not in sys.path:
|
|
sys.path.insert(0, str(ROOT))
|
|
|
|
from md2gost.diagram_renderer import PLANTUML_JAR_URL, fetch_plantuml_jar, vendor_plantuml_path
|
|
|
|
|
|
def main() -> int:
|
|
dest = vendor_plantuml_path()
|
|
print(f"PlantUML: {PLANTUML_JAR_URL}")
|
|
print(f"Куда: {dest}")
|
|
if dest.is_file() and dest.stat().st_size > 1000:
|
|
print("Уже скачан.")
|
|
return 0
|
|
if fetch_plantuml_jar(dest):
|
|
print(f"Готово: {dest} ({dest.stat().st_size} байт)")
|
|
return 0
|
|
print("Не удалось скачать plantuml.jar (exe соберётся, диаграммы пойдут через kroki.io).")
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|