From a0d0cdda275aedfd07e5b2aaafb04aa1e1750df0 Mon Sep 17 00:00:00 2001 From: Edvard Rejthar Date: Thu, 9 Jan 2025 16:16:36 +0100 Subject: [PATCH] WIP --- .github/workflows/run-unittest.yml | 6 ++---- deduplidog/deduplidog.py | 6 ------ 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/run-unittest.yml b/.github/workflows/run-unittest.yml index 0cfb97a..706762d 100644 --- a/.github/workflows/run-unittest.yml +++ b/.github/workflows/run-unittest.yml @@ -5,8 +5,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - # python-version: [3.11, 3.12, 3.13] TODO - python-version: [3.12] + python-version: [3.11, 3.12, 3.13] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} @@ -16,5 +15,4 @@ jobs: - name: Install dependencies run: pip install -e . - name: Run tests - # run: python3 -m unittest discover tests TODO - run: python3 -m unittest tests.test_disk.TestSymlinked.test_basic + run: python3 -m unittest discover tests diff --git a/deduplidog/deduplidog.py b/deduplidog/deduplidog.py index 270cd48..f55cd49 100644 --- a/deduplidog/deduplidog.py +++ b/deduplidog/deduplidog.py @@ -454,7 +454,6 @@ def _process_file(self, work_file: Path, bar: tqdm): if name.startswith("✓"): # this file has been already processed self.ignored_count += 1 return - print("457: 1", work_file) # TODO stem = str(work_file.stem) if self.match.space2char: stem = stem.replace(" ", self.match.space2char) @@ -496,9 +495,7 @@ def _process_file(self, work_file: Path, bar: tqdm): # compare by date and size candidates = [p for p in _candidates_fact if p.suffix.match.casefold() == work_file.suffix.match.casefold()] \ if self.match.casefold else [p for p in _candidates_fact if p.suffix == work_file.suffix] - print("\n501: candidates", candidates) # TODO original = self._find_similar(work_file, candidates) - print("502: original", original) # TODO # original of the work_file has been found # one of them might be treated as a duplicate and thus affected @@ -700,9 +697,6 @@ def _find_similar(self, work_file: Path, candidates: list[Path]): """ compare by date and size """ for original in candidates: ost, wst = original.stat(), work_file.stat() - print("703: ost,wst", ost, wst) # TODO - print("704: wst.st_mtime", wst.st_mtime) # TODO - print("704: ost.st_mtime", ost.st_mtime) # TODO if (self.match.ignore_date or wst.st_mtime == ost.st_mtime or self.match.tolerate_hour and self.match.tolerate_hour[0] <= (wst.st_mtime - ost.st_mtime)/3600 <= self.match.tolerate_hour[1]