Lines 29-35
class database(fs_template.FsBased):
Link Here
|
29 |
try: |
29 |
try: |
30 |
myf = codecs.open(fp, mode='r', encoding='utf_8', errors='replace') |
30 |
myf = codecs.open(fp, mode='r', encoding='utf_8', errors='replace') |
31 |
try: |
31 |
try: |
32 |
d = self._parse_data(myf, cpv) |
32 |
d = self._parse_data(myf.readlines(), cpv) |
33 |
if '_mtime_' not in d: |
33 |
if '_mtime_' not in d: |
34 |
# Backward compatibility with old cache |
34 |
# Backward compatibility with old cache |
35 |
# that uses mtime mangling. |
35 |
# that uses mtime mangling. |
Lines 87-93
class database(fs_template.FsBased):
Link Here
|
87 |
os.remove(fp) |
87 |
os.remove(fp) |
88 |
raise cache_errors.CacheCorruption(cpv, e) |
88 |
raise cache_errors.CacheCorruption(cpv, e) |
89 |
|
89 |
|
90 |
|
|
|
91 |
def _delitem(self, cpv): |
90 |
def _delitem(self, cpv): |
92 |
# import pdb;pdb.set_trace() |
91 |
# import pdb;pdb.set_trace() |
93 |
try: |
92 |
try: |
Lines 98-108
class database(fs_template.FsBased):
Link Here
|
98 |
else: |
97 |
else: |
99 |
raise cache_errors.CacheCorruption(cpv, e) |
98 |
raise cache_errors.CacheCorruption(cpv, e) |
100 |
|
99 |
|
101 |
|
|
|
102 |
def __contains__(self, cpv): |
100 |
def __contains__(self, cpv): |
103 |
return os.path.exists(os.path.join(self.location, cpv)) |
101 |
return os.path.exists(os.path.join(self.location, cpv)) |
104 |
|
102 |
|
105 |
|
|
|
106 |
def __iter__(self): |
103 |
def __iter__(self): |
107 |
"""generator for walking the dir struct""" |
104 |
"""generator for walking the dir struct""" |
108 |
dirs = [self.location] |
105 |
dirs = [self.location] |