Fix database integrity check breaking after a catalog generation. Fix thumbs.zip in use error when generating catalog on some windows machines. Apparently, os.remove is broken on windows

This commit is contained in:
Kovid Goyal 2011-01-02 13:37:22 -07:00
parent 559ecdaf24
commit a8d9f7aaa0
2 changed files with 1 additions and 3 deletions

View File

@ -1005,7 +1005,6 @@ class EPUB_MOBI(CatalogPlugin):
self.opts.log.warning(" invalidating cache at '%s'" % self.__archive_path) self.opts.log.warning(" invalidating cache at '%s'" % self.__archive_path)
self.opts.log.warning(' thumb_width changed: %1.2f" => %1.2f"' % self.opts.log.warning(' thumb_width changed: %1.2f" => %1.2f"' %
(float(cached_thumb_width),float(self.opts.thumb_width))) (float(cached_thumb_width),float(self.opts.thumb_width)))
os.remove(self.__archive_path)
with ZipFile(self.__archive_path, mode='w') as zfw: with ZipFile(self.__archive_path, mode='w') as zfw:
zfw.writestr("Catalog Thumbs Archive",'') zfw.writestr("Catalog Thumbs Archive",'')
else: else:

View File

@ -102,7 +102,7 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
if self.user_version == 0: if self.user_version == 0:
self.initialize_database() self.initialize_database()
# remember to add any filter to the connect method in sqlite.py as well # remember to add any filter to the connect method in sqlite.py as well
# so that various code taht connects directly will not complain about # so that various code that connects directly will not complain about
# missing functions # missing functions
self.books_list_filter = self.conn.create_dynamic_filter('books_list_filter') self.books_list_filter = self.conn.create_dynamic_filter('books_list_filter')
# Store temporary tables in memory # Store temporary tables in memory
@ -2778,7 +2778,6 @@ books_series_link feeds
os.remove(dest) os.remove(dest)
raise raise
else: else:
os.remove(self.dbpath)
shutil.copyfile(dest, self.dbpath) shutil.copyfile(dest, self.dbpath)
self.connect() self.connect()
self.initialize_dynamic() self.initialize_dynamic()