[appimage] refactoring: removing '/' from INSTALLATION_PATH constant

This commit is contained in:
Vinicius Moreira
2021-11-29 10:45:10 -03:00
parent ab302d460b
commit 9f4e08e29c
4 changed files with 5 additions and 5 deletions

View File

@@ -8,7 +8,7 @@ from bauh.commons import resource
ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
APPIMAGE_SHARED_DIR = f'{SHARED_FILES_DIR}/appimage' APPIMAGE_SHARED_DIR = f'{SHARED_FILES_DIR}/appimage'
INSTALLATION_PATH = f'{APPIMAGE_SHARED_DIR}/installed/' INSTALLATION_PATH = f'{APPIMAGE_SHARED_DIR}/installed'
SUGGESTIONS_FILE = f'https://raw.githubusercontent.com/vinifmor/{__app_name__}-files/master/appimage/suggestions.txt' SUGGESTIONS_FILE = f'https://raw.githubusercontent.com/vinifmor/{__app_name__}-files/master/appimage/suggestions.txt'
CONFIG_FILE = f'{CONFIG_DIR}/appimage.yml' CONFIG_FILE = f'{CONFIG_DIR}/appimage.yml'
APPIMAGE_CONFIG_DIR = f'{CONFIG_DIR}/appimage' APPIMAGE_CONFIG_DIR = f'{CONFIG_DIR}/appimage'

View File

@@ -254,7 +254,7 @@ class AppImageManager(SoftwareManager):
res = SearchResult(installed_apps, [], 0) res = SearchResult(installed_apps, [], 0)
if os.path.exists(INSTALLATION_PATH): if os.path.exists(INSTALLATION_PATH):
installed = run_cmd('ls {}*/data.json'.format(INSTALLATION_PATH), print_error=False) installed = run_cmd(f'ls {INSTALLATION_PATH}/*/data.json', print_error=False)
if installed: if installed:
names = set() names = set()
@@ -553,7 +553,7 @@ class AppImageManager(SoftwareManager):
def _install(self, pkg: AppImage, watcher: ProcessWatcher, pre_downloaded_file: Optional[Tuple[str, str]] = None): def _install(self, pkg: AppImage, watcher: ProcessWatcher, pre_downloaded_file: Optional[Tuple[str, str]] = None):
handler = ProcessHandler(watcher) handler = ProcessHandler(watcher)
out_dir = INSTALLATION_PATH + pkg.get_clean_name() out_dir = f'{INSTALLATION_PATH}/{pkg.get_clean_name()}'
counter = 0 counter = 0
while True: while True:
if os.path.exists(out_dir): if os.path.exists(out_dir):

View File

@@ -94,7 +94,7 @@ class AppImage(SoftwarePackage):
if self.install_dir: if self.install_dir:
return self.install_dir return self.install_dir
elif self.name: elif self.name:
return INSTALLATION_PATH + self.name.lower() return f'{INSTALLATION_PATH}/{self.name.lower()}'
def get_disk_icon_path(self): def get_disk_icon_path(self):
return self.icon_path return self.icon_path

View File

@@ -234,7 +234,7 @@ class SymlinksVerifier(Thread):
def run(self): def run(self):
if os.path.exists(INSTALLATION_PATH): if os.path.exists(INSTALLATION_PATH):
installed_files = glob.glob('{}/*/*.json'.format(INSTALLATION_PATH)) installed_files = glob.glob(f'{INSTALLATION_PATH}/*/*.json')
if installed_files: if installed_files:
self.logger.info("Checking installed AppImage files with no symlinks created") self.logger.info("Checking installed AppImage files with no symlinks created")