mirror of
https://github.com/janeczku/calibre-web
synced 2024-11-24 18:47:23 +00:00
Update Updater
This commit is contained in:
parent
27a18d60a7
commit
371097eb4d
@ -42,5 +42,4 @@ var reader;
|
||||
alert(error);
|
||||
});
|
||||
}
|
||||
// reader.book.package.metadata.direction= "rtl"; wait for reader reader before changing reading direction
|
||||
})();
|
||||
|
@ -193,7 +193,12 @@ class Updater(threading.Thread):
|
||||
exclude = (
|
||||
os.sep + 'app.db', os.sep + 'calibre-web.log1', os.sep + 'calibre-web.log2', os.sep + 'gdrive.db',
|
||||
os.sep + 'vendor', os.sep + 'calibre-web.log', os.sep + '.git', os.sep + 'client_secrets.json',
|
||||
os.sep + 'gdrive_credentials', os.sep + 'settings.yaml')
|
||||
os.sep + 'gdrive_credentials', os.sep + 'settings.yaml', os.sep + 'venv', os.sep + 'virtualenv',
|
||||
os.sep + 'access.log', os.sep + 'access.log1', os.sep + 'access.log2',
|
||||
)
|
||||
additional_path = self.is_venv()
|
||||
if additional_path:
|
||||
exclude = exclude + (additional_path,)
|
||||
for root, dirs, files in os.walk(destination, topdown=True):
|
||||
for name in files:
|
||||
old_list.append(os.path.join(root, name).replace(destination, ''))
|
||||
@ -229,6 +234,12 @@ class Updater(threading.Thread):
|
||||
logger.debug("Could not remove: %s", item_path)
|
||||
shutil.rmtree(source, ignore_errors=True)
|
||||
|
||||
def is_venv(self):
|
||||
if (hasattr(sys, 'real_prefix')) or (hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix):
|
||||
return os.sep + os.path.relpath(sys.prefix,constants.BASE_DIR)
|
||||
else:
|
||||
return False
|
||||
|
||||
@classmethod
|
||||
def _nightly_version_info(cls):
|
||||
if is_sha1(constants.NIGHTLY_VERSION[0]) and len(constants.NIGHTLY_VERSION[1]) > 0:
|
||||
|
Loading…
Reference in New Issue
Block a user