From bc70a05ecb383015167adfebf322764be76f4eb4 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Sun, 30 Jul 2023 22:34:20 +0200 Subject: [PATCH] refactoring --- dotdrop/comparator.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/dotdrop/comparator.py b/dotdrop/comparator.py index 7b0514a..3ffda97 100644 --- a/dotdrop/comparator.py +++ b/dotdrop/comparator.py @@ -38,7 +38,7 @@ class Comparator: ignore = [] local_path = os.path.expanduser(local_path) deployed_path = os.path.expanduser(deployed_path) - self.log.dbg(f'comparing {local_path} and {deployed_path}') + self.log.dbg(f'comparing \"{local_path}\" and \"{deployed_path}\"') self.log.dbg(f'ignore pattern(s): {ignore}') # test type of file @@ -59,7 +59,7 @@ class Comparator: ret = self._comp_mode(local_path, deployed_path, mode=mode) return ret - self.log.dbg(f'{local_path} is a directory') + self.log.dbg(f'\"{local_path}\" is a directory') ret = self._comp_dir(local_path, deployed_path, ignore) if not ret: @@ -100,10 +100,13 @@ class Comparator: self.log.dbg(f'compare directory {local_path} with {deployed_path}') if not os.path.exists(deployed_path): return '' - if (self.ignore_missing_in_dotdrop and not - os.path.exists(local_path)) \ - or must_ignore([local_path, deployed_path], ignore, - debug=self.debug): + ign_missing = self.ignore_missing_in_dotdrop and not \ + os.path.exists(local_path) + paths = [local_path, deployed_path] + must_ign = must_ignore(paths, + ignore, + debug=self.debug) + if ign_missing or must_ign: self.log.dbg(f'ignoring diff {local_path} and {deployed_path}') return '' if not os.path.isdir(deployed_path):