mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-02-09 15:00:31 +01:00
config: Versioned scheme files.
This commit is contained in:
parent
6c69a34e5a
commit
b9f7eac2cf
@ -7,7 +7,7 @@ import shutil
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from .settings import CACHE_DIR, COLOR_COUNT
|
from .settings import CACHE_DIR, COLOR_COUNT, __version__
|
||||||
from . import util
|
from . import util
|
||||||
|
|
||||||
|
|
||||||
@ -85,9 +85,10 @@ def create_palette(img, colors):
|
|||||||
def get(img, cache_dir=CACHE_DIR,
|
def get(img, cache_dir=CACHE_DIR,
|
||||||
color_count=COLOR_COUNT, notify=False):
|
color_count=COLOR_COUNT, notify=False):
|
||||||
"""Get the colorscheme."""
|
"""Get the colorscheme."""
|
||||||
# _home_dylan_img_jpg.json
|
# home_dylan_img_jpg_1.2.2.json
|
||||||
cache_file = img.replace("/", "_").replace("\\", "_").replace(".", "_")
|
cache_file = re.sub("[/|\\|.]", "_", img)
|
||||||
cache_file = os.path.join(cache_dir, "schemes", cache_file + ".json")
|
cache_file = os.path.join(cache_dir, "schemes", cache_file + "_" +
|
||||||
|
__version__ + ".json")
|
||||||
|
|
||||||
if os.path.isfile(cache_file):
|
if os.path.isfile(cache_file):
|
||||||
colors = file(cache_file)
|
colors = file(cache_file)
|
||||||
|
Loading…
Reference in New Issue
Block a user