summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Araps <dylan.araps@gmail.com>2018-02-01 10:35:00 +1100
committerDylan Araps <dylan.araps@gmail.com>2018-02-01 10:35:00 +1100
commitb9f7eac2cf9936b091cfdc7d4dfef3d92eb54483 (patch)
tree996d353ce9020bb5e7506e3d36b3b7284f4198e0
parent6c69a34e5a089dff4a7887bde5a7a7976766dcaf (diff)
config: Versioned scheme files.
-rw-r--r--pywal/colors.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/pywal/colors.py b/pywal/colors.py
index 7294e68..53321eb 100644
--- a/pywal/colors.py
+++ b/pywal/colors.py
@@ -7,7 +7,7 @@ import shutil
import subprocess
import sys
-from .settings import CACHE_DIR, COLOR_COUNT
+from .settings import CACHE_DIR, COLOR_COUNT, __version__
from . import util
@@ -85,9 +85,10 @@ def create_palette(img, colors):
def get(img, cache_dir=CACHE_DIR,
color_count=COLOR_COUNT, notify=False):
"""Get the colorscheme."""
- # _home_dylan_img_jpg.json
- cache_file = img.replace("/", "_").replace("\\", "_").replace(".", "_")
- cache_file = os.path.join(cache_dir, "schemes", cache_file + ".json")
+ # home_dylan_img_jpg_1.2.2.json
+ cache_file = re.sub("[/|\\|.]", "_", img)
+ cache_file = os.path.join(cache_dir, "schemes", cache_file + "_" +
+ __version__ + ".json")
if os.path.isfile(cache_file):
colors = file(cache_file)