Update Updater

This commit is contained in:
OzzieIsaacs 2020-02-23 07:54:58 +01:00
parent 27a18d60a7
commit 371097eb4d
2 changed files with 12 additions and 2 deletions

View file

@ -42,5 +42,4 @@ var reader;
alert(error); alert(error);
}); });
} }
// reader.book.package.metadata.direction= "rtl"; wait for reader reader before changing reading direction
})(); })();

View file

@ -193,7 +193,12 @@ class Updater(threading.Thread):
exclude = ( exclude = (
os.sep + 'app.db', os.sep + 'calibre-web.log1', os.sep + 'calibre-web.log2', os.sep + 'gdrive.db', 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 + '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 root, dirs, files in os.walk(destination, topdown=True):
for name in files: for name in files:
old_list.append(os.path.join(root, name).replace(destination, '')) 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) logger.debug("Could not remove: %s", item_path)
shutil.rmtree(source, ignore_errors=True) 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 @classmethod
def _nightly_version_info(cls): def _nightly_version_info(cls):
if is_sha1(constants.NIGHTLY_VERSION[0]) and len(constants.NIGHTLY_VERSION[1]) > 0: if is_sha1(constants.NIGHTLY_VERSION[0]) and len(constants.NIGHTLY_VERSION[1]) > 0: