[adwaita-icon-theme: 2/3] code refactoring
- From: Jakub Steiner <jimmac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [adwaita-icon-theme: 2/3] code refactoring
- Date: Tue, 23 Nov 2021 22:28:14 +0000 (UTC)
commit bcc99dd2a883c5d22f7580ff166a3dd23a3cf0b6
Author: Leandro Guedes <leandroguedes protonmail com>
Date: Thu Nov 18 19:24:10 2021 -0300
code refactoring
render-icon-theme.py | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/render-icon-theme.py b/render-icon-theme.py
index 987f94bb..d9e8e5a9 100755
--- a/render-icon-theme.py
+++ b/render-icon-theme.py
@@ -8,7 +8,7 @@ import subprocess
OPTIPNG = '/usr/bin/optipng'
ZOPFLIPNG = '/usr/bin/zopflipng'
SRC = os.path.join('.', 'src', 'fullcolor')
-INKSCAPE_PREFIX = ['flatpak','run','org.inkscape.Inkscape']
+INKSCAPE_CMD = ['flatpak','run','org.inkscape.Inkscape']
inkscape_process = None
@@ -37,8 +37,8 @@ def wait_for_prompt(process, command=None):
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));
- commandline_sulfix = ['--batch-process', '-i', rect, '--export-type=png', '-o', output_file, icon_file]
- subprocess.run(INKSCAPE_PREFIX + commandline_sulfix)
+ inkscape_args = ['--batch-process', '-i', rect, '--export-type=png', '-o', output_file, icon_file]
+ subprocess.run(INKSCAPE_CMD + inkscape_args)
optimize_png(output_file)
class ContentHandler(xml.sax.ContentHandler):
@@ -146,10 +146,9 @@ if subprocess.run(['flatpak', 'info', '--show-ref', 'org.inkscape.Inkscape']).re
try:
subprocess.run(['inkscape', '--version'])
except FileNotFoundError:
- print("Inkscape is required for this script")
- exit()
+ sys.exit("Inkscape is required for this script")
- INKSCAPE_PREFIX = ['inkscape']
+ INKSCAPE_CMD = ['inkscape']
if len(sys.argv) == 1:
if not os.path.exists('Adwaita'):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]