summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Steiner <jimmac@gmail.com>2020-06-08 12:09:11 +0200
committerJakub Steiner <jimmac@gmail.com>2020-06-08 12:10:47 +0200
commite6f52be35ddc3d8f409512cbb9e075cb63aa8e81 (patch)
treeb8c9b9c018be1725f98779475ec0726f5b1a7eae
parent89ca0189bdc42f363c3935451b907a5e2b0918c3 (diff)
downloadadwaita-icon-theme-e6f52be35ddc3d8f409512cbb9e075cb63aa8e81.tar.gz
Fullcolor: fix rendering script for inkscape 1.0
- inkscape 1.0 would keep complaining about syntax with --shell and the Popen way - just using dumb subprocess.run() made it shut up Fixes https://gitlab.gnome.org/GNOME/adwaita-icon-theme/-/issues/87
-rwxr-xr-xrender-icon-theme.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/render-icon-theme.py b/render-icon-theme.py
index 68fd93eeb..51a75ba4d 100755
--- a/render-icon-theme.py
+++ b/render-icon-theme.py
@@ -34,16 +34,9 @@ def wait_for_prompt(process, command=None):
output += process.stdout.read(1)
output = output[1:]
-def start_inkscape():
- process = subprocess.Popen(['flatpak','run','org.inkscape.Inkscape','--shell'], bufsize=0, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
- wait_for_prompt(process)
- return process
-
-def inkscape_render_rect(icon_file, rect, output_file):
- global inkscape_process
- if inkscape_process is None:
- inkscape_process = start_inkscape()
- wait_for_prompt(inkscape_process, '%s -i %s -e %s' % (icon_file, rect, output_file))
+def inkscape_render_rect(icon_file, rect, output_file):
+ #print("flatpak run org.inkscape.Inkscape --batch-process -i %s --export-type=png -o %s %s" % (rect, output_file,icon_file));
+ subprocess.run(['flatpak','run','org.inkscape.Inkscape', '--batch-process', '-i', rect, '--export-type=png', '-o', output_file, icon_file])
optimize_png(output_file)
class ContentHandler(xml.sax.ContentHandler):