* fix: delete file only if there is one

This commit is contained in:
Eray Özkural
2005-12-19 00:22:32 +00:00
parent 57d23af38e
commit 87b6a208f6
+2 -1
View File
@@ -62,7 +62,8 @@ class FilesDB(shelve.LockedDBShelf):
def remove_files(self, files, txn = None): def remove_files(self, files, txn = None):
def proc(txn): def proc(txn):
for x in files.list: for x in files.list:
self.delete(str(x.path), txn) if self.has_key(x.path):
self.delete(x.path, txn)
self.txn_proc(proc, txn) self.txn_proc(proc, txn)
def has_file(self, path, txn = None): def has_file(self, path, txn = None):