fnp
/
audio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Disable login_required.
[audio.git]
/
apps
/
archive
/
utils.py
diff --git
a/apps/archive/utils.py
b/apps/archive/utils.py
old mode 100755
(executable)
new mode 100644
(file)
index
c69fe1c
..
3e89a8b
--- a/
apps/archive/utils.py
+++ b/
apps/archive/utils.py
@@
-1,4
+1,6
@@
from hashlib import sha1
from hashlib import sha1
+import os
+import os.path
from django.core.files.storage import FileSystemStorage
from django.core.files.uploadedfile import UploadedFile
from django.core.files.storage import FileSystemStorage
from django.core.files.uploadedfile import UploadedFile
@@
-32,3
+34,11
@@
def sha1_file(f):
for piece in iter(lambda: f.read(1024*1024), ''):
sha.update(piece)
return sha.hexdigest()
for piece in iter(lambda: f.read(1024*1024), ''):
sha.update(piece)
return sha.hexdigest()
+
+
+def all_files(root_path):
+ root_len = len(root_path)
+ for path, dirs, files in os.walk(root_path):
+ for fname in files:
+ yield os.path.join(path, fname)[root_len:].lstrip('/')
+