fixed appadmin/check_credentials problem

This commit is contained in:
mdipierro
2014-09-06 22:57:26 -05:00
parent 83bda542ad
commit 4bcd905f4f
2 changed files with 7 additions and 1 deletions

View File

@@ -1 +1 @@
Version 2.9.7-stable+timestamp.2014.09.06.18.10.46
Version 2.9.7-stable+timestamp.2014.09.06.22.57.21

View File

@@ -1,12 +1,18 @@
import os, uuid
def generate(filename, depth=2, base=512):
if os.path.sep in filename:
path, filename = os.path.split(filename)
else:
path = None
dummyhash = sum(ord(c)*256**(i % 4) for i,c in enumerate(filename)) % base**depth
folders = []
for level in range(depth-1,-1,-1):
code, dummyhash = divmod(dummyhash, base**level)
folders.append("%03x" % code)
folders.append(filename)
if path:
folders.insert(0,path)
return os.path.join(*folders)
def exists(filename, path=None):