"""Генерирует базовый набор иконок оборудования (SVG) в app/static/icons. Запуск: python tools/make_icons.py""" from pathlib import Path OUT = Path(__file__).resolve().parent.parent / "app" / "static" / "icons" S = 'fill="none" stroke="#fff" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"' F = 'fill="#fff"' ICONS = { # имя: (цвет фона, содержимое) "pump": ("#2563eb", f''), "motor": ("#0f766e", f''), "compressor": ("#7c3aed", f''), "conveyor": ("#b45309", f''), "boiler": ("#c2410c", f''), "fan": ("#0284c7", f''), "crane": ("#ca8a04", f''), "press": ("#475569", f''), "tank": ("#15803d", f''), "valve": ("#be123c", f''), "generator": ("#d97706", f''), "transformer": ("#9333ea", f''), "lathe": ("#334155", f''), "forklift": ("#ea580c", f''), "panel": ("#1d4ed8", f''), "hvac": ("#0891b2", f''), "mixer": ("#4d7c0f", f''), "furnace": ("#b91c1c", f''), "gear": ("#57534e", f''), "robot": ("#0369a1", f''), } def main(): OUT.mkdir(parents=True, exist_ok=True) for name, (bg, body) in ICONS.items(): svg = (f'' f'{body}\n') (OUT / f"{name}.svg").write_text(svg, encoding="utf-8") print(f"{len(ICONS)} иконок -> {OUT}") if __name__ == "__main__": main()