1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 15:39:43 +00:00

refactoring

This commit is contained in:
deadc0de6
2023-12-29 08:40:49 +01:00
committed by deadc0de
parent 10a835c67d
commit b7003a7c12
2 changed files with 14 additions and 14 deletions

View File

@@ -239,7 +239,7 @@ def _match_ignore_pattern(path, pattern, debug=False):
ret = fnmatch.fnmatch(subpath, pattern)
if ret:
if debug:
LOG.dbg(f'ignore \"{pattern}\" match: {subpath} from {path}',
LOG.dbg(f'ignore \"{pattern}\" match: {subpath} ({path})',
force=True)
return ret
subpath = os.path.dirname(subpath)
@@ -322,17 +322,17 @@ def must_ignore(paths, ignores, debug=False):
if not ignores:
return False
if debug:
LOG.dbg(f'IGNORE? \"{paths}\" against {ignores}',
LOG.dbg(f'[IGN] IGNORE? \"{paths}\" against {ignores}',
force=True)
nign, ign = categorize(
lambda ign: ign.startswith('!'), ignores)
for path in paths:
if _must_ignore(path, ign, nign, debug=debug):
if debug:
LOG.dbg(f'IGNORING \"{paths}\"', force=True)
LOG.dbg(f'[IGN] IGNORING \"{paths}\"', force=True)
return True
if debug:
LOG.dbg(f'NOT IGNORING \"{paths}\"', force=True)
LOG.dbg(f'[IGN] NOT IGNORING \"{paths}\"', force=True)
return False

View File

@@ -227,21 +227,21 @@ clean_both
create_in_dst
cd "${ddpath}" | ${bin} import -f -c "${cfg3}" -p p1 -V "${tmpd}/mpv"
[ ! -e "${dotpath}/${tmpd}/mpv/watch_later/keepme" ] && echo "import (cfg3) failed" && exit 1
[ ! -d "${dotpath}/${tmpd}/mpv/watch_later/keepmetoo" ] && echo "import (cfg3) failed" && exit 1
[ ! -e "${dotpath}/${tmpd}/mpv/watch_later/keepmetoo/keepmetoo" ] && echo "import (cfg3) failed" && exit 1
[ ! -e "${dotpath}/${tmpd}/mpv/watch_later/keepmeaswell/keepmeaswell" ] && echo "import (cfg3) failed" && exit 1
[ -e "${dotpath}/${tmpd}/mpv/watch_later/watch_later_file" ] && echo "import (cfg3) failed" && exit 1
[ ! -e "${dotpath}/${tmpd}/mpv/watch_later/keepme" ] && echo "import (cfg3) 1 failed" && exit 1
[ ! -d "${dotpath}/${tmpd}/mpv/watch_later/keepmetoo" ] && echo "import (cfg3) 2 failed" && exit 1
[ ! -e "${dotpath}/${tmpd}/mpv/watch_later/keepmetoo/keepmetoo" ] && echo "import (cfg3) 3 failed" && exit 1
[ ! -e "${dotpath}/${tmpd}/mpv/watch_later/keepmeaswell/keepmeaswell" ] && echo "import (cfg3) 4 failed" && exit 1
[ -e "${dotpath}/${tmpd}/mpv/watch_later/watch_later_file" ] && echo "import (cfg3) 5 failed" && exit 1
clean_both
create_in_dst
cd "${ddpath}" | ${bin} import -f -c "${cfg4}" -p p1 -V "${tmpd}/mpv"
[ ! -e "${dotpath}/${tmpd}/mpv/watch_later/keepme" ] && echo "import (cfg4) failed" && exit 1
[ ! -d "${dotpath}/${tmpd}/mpv/watch_later/keepmetoo" ] && echo "import (cfg4) failed" && exit 1
[ ! -e "${dotpath}/${tmpd}/mpv/watch_later/keepmetoo/keepmetoo" ] && echo "import (cfg4) failed" && exit 1
[ ! -e "${dotpath}/${tmpd}/mpv/watch_later/keepmeaswell/keepmeaswell" ] && echo "import (cfg4) failed" && exit 1
[ -e "${dotpath}/${tmpd}/mpv/watch_later/watch_later_file" ] && echo "import (cfg4) failed" && exit 1
[ ! -e "${dotpath}/${tmpd}/mpv/watch_later/keepme" ] && echo "import (cfg4) 1 failed" && exit 1
[ ! -d "${dotpath}/${tmpd}/mpv/watch_later/keepmetoo" ] && echo "import (cfg4) 2 failed" && exit 1
[ ! -e "${dotpath}/${tmpd}/mpv/watch_later/keepmetoo/keepmetoo" ] && echo "import (cfg4) 3 failed" && exit 1
[ ! -e "${dotpath}/${tmpd}/mpv/watch_later/keepmeaswell/keepmeaswell" ] && echo "import (cfg4) 4 failed" && exit 1
[ -e "${dotpath}/${tmpd}/mpv/watch_later/watch_later_file" ] && echo "import (cfg4) 5 failed" && exit 1
###################################################
# test compare