From 60497c60c1c16b9482cc5f0b576ee672729bb687 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sun, 7 Feb 2021 09:20:37 +0100 Subject: [PATCH] Update creating Home_Config variable for packaging support, added .HOMEDIR to ignored filename during update --- cps/constants.py | 6 ++++-- cps/updater.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cps/constants.py b/cps/constants.py index ac48a5b8..613d17ac 100644 --- a/cps/constants.py +++ b/cps/constants.py @@ -21,8 +21,10 @@ import sys import os from collections import namedtuple -# if installed via pip this variable is set to true -HOME_CONFIG = False +# if installed via pip this variable is set to true (empty file with name .HOMEDIR present) +HOME_CONFIG = os.path.isfile(os.path.join(os.path.dirname(os.path.abspath(__file__)), '.HOMEDIR')) + +#In executables updater is not available, so variable is set to False there UPDATER_AVAILABLE = True # Base dir is parent of current file, necessary if called from different folder diff --git a/cps/updater.py b/cps/updater.py index b03a0844..4d5117a9 100644 --- a/cps/updater.py +++ b/cps/updater.py @@ -227,7 +227,7 @@ class Updater(threading.Thread): 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 + 'venv', os.sep + 'virtualenv', os.sep + 'access.log', os.sep + 'access.log1', os.sep + 'access.log2', - os.sep + '.calibre-web.log.swp', os.sep + '_sqlite3.so' + os.sep + '.calibre-web.log.swp', os.sep + '_sqlite3.so', os.sep + 'cps' + os.sep + '.HOMEDIR' ) additional_path = self.is_venv() if additional_path: