Show More
@@ -426,19 +426,10 b' class fncache(object):' | |||||
426 | self._dirty = True |
|
426 | self._dirty = True | |
427 | self.entries.add(fn) |
|
427 | self.entries.add(fn) | |
428 |
|
428 | |||
429 |
def __contains__(self, |
|
429 | def __contains__(self, fn): | |
430 | if self.entries is None: |
|
430 | if self.entries is None: | |
431 | self._load() |
|
431 | self._load() | |
432 | # Check for files (exact match) |
|
432 | return fn in self.entries | |
433 | if path + ".i" in self.entries: |
|
|||
434 | return True |
|
|||
435 | # Now check for directories (prefix match) |
|
|||
436 | if not path.endswith('/'): |
|
|||
437 | path += '/' |
|
|||
438 | for e in self.entries: |
|
|||
439 | if e.startswith(path): |
|
|||
440 | return True |
|
|||
441 | return False |
|
|||
442 |
|
433 | |||
443 | def __iter__(self): |
|
434 | def __iter__(self): | |
444 | if self.entries is None: |
|
435 | if self.entries is None: | |
@@ -524,7 +515,16 b' class fncachestore(basicstore):' | |||||
524 | def __contains__(self, path): |
|
515 | def __contains__(self, path): | |
525 | '''Checks if the store contains path''' |
|
516 | '''Checks if the store contains path''' | |
526 | path = "/".join(("data", path)) |
|
517 | path = "/".join(("data", path)) | |
527 | return path in self.fncache |
|
518 | # check for files (exact match) | |
|
519 | if path + '.i' in self.fncache: | |||
|
520 | return True | |||
|
521 | # now check for directories (prefix match) | |||
|
522 | if not path.endswith('/'): | |||
|
523 | path += '/' | |||
|
524 | for e in self.fncache: | |||
|
525 | if e.startswith(path): | |||
|
526 | return True | |||
|
527 | return False | |||
528 |
|
528 | |||
529 | def store(requirements, path, vfstype): |
|
529 | def store(requirements, path, vfstype): | |
530 | if 'store' in requirements: |
|
530 | if 'store' in requirements: |
General Comments 0
You need to be logged in to leave comments.
Login now