Move utils.hash_file -> imagecache._hash_file

`hash_file` is only used by `imagecache` so it doesn't make sense (yet) for it
to be included in utils.

Change-Id: I2f4d1deb03e4afceb911ef4b6d6ae6760ddca225
This commit is contained in:
Rick Harris
2013-10-04 16:58:08 +00:00
parent 2254145c1f
commit 98cfa8f078

View File

@@ -22,7 +22,6 @@
import contextlib
import datetime
import functools
import hashlib
import inspect
import os
import pyclbr
@@ -769,14 +768,6 @@ def read_cached_file(filename, cache_info, reload_func=None):
return cache_info['data']
def hash_file(file_like_object):
"""Generate a hash for the contents of a file."""
checksum = hashlib.sha1()
for chunk in iter(lambda: file_like_object.read(32768), b''):
checksum.update(chunk)
return checksum.hexdigest()
@contextlib.contextmanager
def temporary_mutation(obj, **kwargs):
"""Temporarily set the attr on a particular object to a given value then