From 1d180a7e17a025c225dab55d9c763b7ca2d91e41 Mon Sep 17 00:00:00 2001 From: npdev453 Date: Tue, 24 Nov 2020 12:54:13 +0300 Subject: [PATCH 1/3] fix: incorrect json wallpaper path Fix json path export on windows thats generate before --- pywal/export.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pywal/export.py b/pywal/export.py index 47ea4d2a..b92c7649 100644 --- a/pywal/export.py +++ b/pywal/export.py @@ -77,7 +77,12 @@ def template(colors, input_file, output_file=None): def flatten_colors(colors): """Prepare colors to be exported. Flatten dicts and convert colors to util.Color()""" - all_colors = {"wallpaper": colors["wallpaper"], + wallpaper_path = colors["wallpaper"] + + if os == "Windows" : + wallpaper_path = wallpaper_path.replace("\\","\\\\") + + all_colors = {"wallpaper": wallpaper_path, "alpha": colors["alpha"], **colors["special"], **colors["colors"]} From 89119f88abbfc4ea130ab482b07061eda5f68be2 Mon Sep 17 00:00:00 2001 From: npdev453 Date: Tue, 24 Nov 2020 12:57:50 +0300 Subject: [PATCH 2/3] style: commas and spaces --- pywal/export.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pywal/export.py b/pywal/export.py index b92c7649..2e28ae07 100644 --- a/pywal/export.py +++ b/pywal/export.py @@ -79,8 +79,8 @@ def flatten_colors(colors): Flatten dicts and convert colors to util.Color()""" wallpaper_path = colors["wallpaper"] - if os == "Windows" : - wallpaper_path = wallpaper_path.replace("\\","\\\\") + if os == "Windows": + wallpaper_path = wallpaper_path.replace("\\", "\\\\") all_colors = {"wallpaper": wallpaper_path, "alpha": colors["alpha"], From cec20ffba1a2563fc47cd1964b95f4c30e169bdf Mon Sep 17 00:00:00 2001 From: npdev453 Date: Tue, 24 Nov 2020 13:17:29 +0300 Subject: [PATCH 3/3] Update export.py --- pywal/export.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pywal/export.py b/pywal/export.py index 2e28ae07..0ce4698a 100644 --- a/pywal/export.py +++ b/pywal/export.py @@ -6,7 +6,7 @@ import re from . import util -from .settings import CACHE_DIR, CONF_DIR, MODULE_DIR +from .settings import CACHE_DIR, CONF_DIR, MODULE_DIR, OS def template(colors, input_file, output_file=None): @@ -79,7 +79,7 @@ def flatten_colors(colors): Flatten dicts and convert colors to util.Color()""" wallpaper_path = colors["wallpaper"] - if os == "Windows": + if OS == "Windows": wallpaper_path = wallpaper_path.replace("\\", "\\\\") all_colors = {"wallpaper": wallpaper_path,