From de4bbf9700b827d58cdd51ca5ea8e6f81cd058f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lov=C3=A9n?= Date: Sun, 24 Mar 2019 15:54:29 +0100 Subject: [PATCH] Only process .svg files. Fix #4 --- generate.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generate.py b/generate.py index b8f9c02..044c345 100644 --- a/generate.py +++ b/generate.py @@ -5,6 +5,8 @@ ICON_SIZE = 1024 def make_file(directory, name, out): out.write('\n'.format(name, ICON_SIZE)) for f in os.listdir(directory): + if not f.endswith('.svg'): + continue with open(os.path.join(directory, f), 'r') as fp: name = os.path.splitext(f)[0] data = fp.read() @@ -18,7 +20,7 @@ def make_file(directory, name, out): out.write(''.format(name, 1/scale) + data[start:-6] + '\n') out.write('') -# Run this in Font-Awesome/advanced-options/raw-svg/ +# Run this in Font-Awesome/svgs # with open("hass-fontawesome-brands.html", 'w') as out: # make_file('brands', 'fab', out)