prvicons_update.py 566 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env python3
  2. # This script updates icons from the SVG file
  3. import os
  4. import subprocess
  5. import sys
  6. BASEDIR = os.path.abspath(os.path.dirname(__file__))
  7. inkscape_path = 'inkscape'
  8. if sys.platform == 'darwin':
  9. inkscape_app_path = '/Applications/Inkscape.app/Contents/Resources/script'
  10. if os.path.exists(inkscape_app_path):
  11. inkscape_path = inkscape_app_path
  12. cmd = (
  13. inkscape_path,
  14. os.path.join(BASEDIR, "prvicons.svg"),
  15. "--without-gui",
  16. "--export-png=" + os.path.join(BASEDIR, "prvicons.png"),
  17. )
  18. subprocess.check_call(cmd)