2019-09-05 04:28:30 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
# This script updates icons from the SVG file
|
|
|
|
import os
|
|
|
|
import subprocess
|
|
|
|
import sys
|
|
|
|
|
|
|
|
BASEDIR = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
|
2021-08-04 03:31:28 +02:00
|
|
|
inkscape_bin = os.environ.get("INKSCAPE_BIN", "inkscape")
|
2019-09-05 04:28:30 +02:00
|
|
|
|
|
|
|
if sys.platform == 'darwin':
|
2021-01-08 14:58:29 +01:00
|
|
|
inkscape_app_path = '/Applications/Inkscape.app/Contents/MacOS/inkscape'
|
2019-09-05 04:28:30 +02:00
|
|
|
if os.path.exists(inkscape_app_path):
|
2021-08-04 03:31:28 +02:00
|
|
|
inkscape_bin = inkscape_app_path
|
2019-09-05 04:28:30 +02:00
|
|
|
|
|
|
|
cmd = (
|
2021-08-04 03:31:28 +02:00
|
|
|
inkscape_bin,
|
2019-09-05 04:28:30 +02:00
|
|
|
os.path.join(BASEDIR, "prvicons.svg"),
|
2019-10-29 18:54:58 +01:00
|
|
|
"--export-width=1792",
|
2019-09-05 04:28:30 +02:00
|
|
|
"--export-height=256",
|
2021-01-08 14:58:29 +01:00
|
|
|
"--export-type=png",
|
|
|
|
"--export-filename=" + os.path.join(BASEDIR, "prvicons.png"),
|
2019-09-05 04:28:30 +02:00
|
|
|
)
|
|
|
|
subprocess.check_call(cmd)
|