Show More
@@ -370,16 +370,21 class fncachestore(basicstore): | |||
|
370 | 370 | self.encode = encode |
|
371 | 371 | self.path = path + '/store' |
|
372 | 372 | self.createmode = _calcmode(self.path) |
|
373 | op = openertype(self.path) | |
|
373 | ||
|
374 | storeself = self | |
|
375 | ||
|
376 | class fncacheopener(openertype): | |
|
377 | def __call__(self, path, mode='r', *args, **kw): | |
|
378 | if mode not in ('r', 'rb') and path.startswith('data/'): | |
|
379 | fnc.add(path) | |
|
380 | return openertype.__call__(self, storeself.encode(path), mode, | |
|
381 | *args, **kw) | |
|
382 | ||
|
383 | op = fncacheopener(self.path) | |
|
374 | 384 | op.createmode = self.createmode |
|
375 | 385 | fnc = fncache(op) |
|
376 | 386 | self.fncache = fnc |
|
377 | ||
|
378 | def fncacheopener(path, mode='r', *args, **kw): | |
|
379 | if mode not in ('r', 'rb') and path.startswith('data/'): | |
|
380 | fnc.add(path) | |
|
381 | return op(self.encode(path), mode, *args, **kw) | |
|
382 | self.opener = fncacheopener | |
|
387 | self.opener = op | |
|
383 | 388 | |
|
384 | 389 | def join(self, f): |
|
385 | 390 | return self.path + '/' + self.encode(f) |
General Comments 0
You need to be logged in to leave comments.
Login now