summaryrefslogtreecommitdiff
path: root/pywal/colors.py
diff options
context:
space:
mode:
Diffstat (limited to 'pywal/colors.py')
-rw-r--r--pywal/colors.py10
1 files changed, 1 insertions, 9 deletions
diff --git a/pywal/colors.py b/pywal/colors.py
index b0cfbe6..63200c5 100644
--- a/pywal/colors.py
+++ b/pywal/colors.py
@@ -6,7 +6,6 @@ import os
import random
import re
import sys
-import hashlib
from . import theme
from . import util
@@ -87,19 +86,12 @@ def saturate_colors(colors, amount):
def cache_fname(img, backend, light, cache_dir, sat=""):
"""Create the cache file name."""
color_type = "light" if light else "dark"
- file_hash = hashf(img)
+ file_hash = util.hashf(img)
file_parts = [file_hash, color_type, backend, sat, __cache_version__]
return [cache_dir, "schemes", "%s_%s_%s_%s_%s.json" % (*file_parts,)]
-def hashf(fpath):
- return hashlib.md5(file_bytes(open(fpath, 'rb'))).hexdigest()
-
-def file_bytes(fpath):
- with fpath:
- return fpath.read()
-
def get_backend(backend):
"""Figure out which backend to use."""
if backend == "random":