X-Git-Url: https://git.mdrn.pl/audio.git/blobdiff_plain/d64f05ea901ccb7e61eacd9a5579bb81138b193d..eee35e00bf0d0eb3d2a9f08f72c7052962fecbf6:/apps/archive/utils.py?ds=inline diff --git a/apps/archive/utils.py b/apps/archive/utils.py deleted file mode 100755 index 6e0a8d1..0000000 --- a/apps/archive/utils.py +++ /dev/null @@ -1,22 +0,0 @@ -from hashlib import sha1 -from django.core.files.uploadedfile import UploadedFile - - -class ExistingFile(UploadedFile): - - def __init__(self, path, *args, **kwargs): - self.path = path - return super(ExistingFile, self).__init__(*args, **kwargs) - - def temporary_file_path(self): - return self.path - - def close(self): - pass - - -def sha1_file(f): - sha = sha1() - for piece in iter(lambda: f.read(1024*1024), ''): - sha.update(piece) - return sha.hexdigest()