Show More
@@ -166,7 +166,7 b' def _auxencode(path, dotencode):' | |||
|
166 | 166 | _maxstorepathlen = 120 |
|
167 | 167 | _dirprefixlen = 8 |
|
168 | 168 | _maxshortdirslen = 8 * (_dirprefixlen + 1) - 4 |
|
169 |
def _hybridencode(path, |
|
|
169 | def _hybridencode(path, dotencode): | |
|
170 | 170 | '''encodes path with a length limit |
|
171 | 171 | |
|
172 | 172 | Encodes all paths that begin with 'data/', according to the following. |
@@ -197,11 +197,13 b' def _hybridencode(path, auxencode):' | |||
|
197 | 197 | The string 'data/' at the beginning is replaced with 'dh/', if the hashed |
|
198 | 198 | encoding was used. |
|
199 | 199 | ''' |
|
200 |
|
|
|
200 | ef = encodefilename(path).split('/') | |
|
201 | res = '/'.join(_auxencode(ef, dotencode)) | |
|
201 | 202 | if len(res) > _maxstorepathlen: |
|
202 | 203 | path = encodedir(path) |
|
203 | 204 | digest = _sha(path).hexdigest() |
|
204 |
|
|
|
205 | le = lowerencode(path).split('/')[1:] | |
|
206 | parts = _auxencode(le, dotencode) | |
|
205 | 207 | basename = parts[-1] |
|
206 | 208 | _root, ext = os.path.splitext(basename) |
|
207 | 209 | sdirs = [] |
@@ -442,8 +444,8 b' class fncachestore(basicstore):' | |||
|
442 | 444 | def store(requirements, path, openertype): |
|
443 | 445 | if 'store' in requirements: |
|
444 | 446 | if 'fncache' in requirements: |
|
445 |
|
|
|
446 |
encode = lambda f: _hybridencode(f, |
|
|
447 | de = 'dotencode' in requirements | |
|
448 | encode = lambda f: _hybridencode(f, de) | |
|
447 | 449 | return fncachestore(path, openertype, encode) |
|
448 | 450 | return encodedstore(path, openertype) |
|
449 | 451 | return basicstore(path, openertype) |
General Comments 0
You need to be logged in to leave comments.
Login now