Showing preview only (2,286K chars total). Download the full file or copy to clipboard to get everything.
Repository: arsenetar/dupeguru
Branch: master
Commit: 16aa6c21ffc2
Files: 344
Total size: 2.1 MB
Directory structure:
gitextract_zc64qp50/
├── .ctags
├── .github/
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug_report.md
│ │ └── feature_request.md
│ └── workflows/
│ ├── codeql-analysis.yml
│ ├── default.yml
│ └── tx-push.yml
├── .gitignore
├── .pre-commit-config.yaml
├── .sonarcloud.properties
├── .tx/
│ └── config
├── .vscode/
│ ├── extensions.json
│ ├── launch.json
│ └── settings.json
├── CONTRIBUTING.md
├── CREDITS
├── LICENSE
├── MANIFEST.in
├── Makefile
├── README.md
├── Windows.md
├── build.py
├── commitlint.config.js
├── core/
│ ├── __init__.py
│ ├── app.py
│ ├── directories.py
│ ├── engine.py
│ ├── exclude.py
│ ├── export.py
│ ├── fs.py
│ ├── gui/
│ │ ├── __init__.py
│ │ ├── base.py
│ │ ├── deletion_options.py
│ │ ├── details_panel.py
│ │ ├── directory_tree.py
│ │ ├── exclude_list_dialog.py
│ │ ├── exclude_list_table.py
│ │ ├── ignore_list_dialog.py
│ │ ├── ignore_list_table.py
│ │ ├── prioritize_dialog.py
│ │ ├── problem_dialog.py
│ │ ├── problem_table.py
│ │ ├── result_table.py
│ │ └── stats_label.py
│ ├── ignore.py
│ ├── markable.py
│ ├── me/
│ │ ├── __init__.py
│ │ ├── fs.py
│ │ ├── prioritize.py
│ │ ├── result_table.py
│ │ └── scanner.py
│ ├── pe/
│ │ ├── __init__.py
│ │ ├── block.py
│ │ ├── block.pyi
│ │ ├── cache.py
│ │ ├── cache.pyi
│ │ ├── cache_sqlite.py
│ │ ├── exif.py
│ │ ├── matchblock.py
│ │ ├── matchexif.py
│ │ ├── modules/
│ │ │ ├── block.c
│ │ │ ├── block_osx.m
│ │ │ ├── cache.c
│ │ │ ├── common.c
│ │ │ └── common.h
│ │ ├── photo.py
│ │ ├── prioritize.py
│ │ ├── result_table.py
│ │ └── scanner.py
│ ├── prioritize.py
│ ├── results.py
│ ├── scanner.py
│ ├── se/
│ │ ├── __init__.py
│ │ ├── fs.py
│ │ ├── result_table.py
│ │ └── scanner.py
│ ├── tests/
│ │ ├── __init__.py
│ │ ├── app_test.py
│ │ ├── base.py
│ │ ├── block_test.py
│ │ ├── cache_test.py
│ │ ├── conftest.py
│ │ ├── directories_test.py
│ │ ├── engine_test.py
│ │ ├── exclude_test.py
│ │ ├── fs_test.py
│ │ ├── ignore_test.py
│ │ ├── markable_test.py
│ │ ├── prioritize_test.py
│ │ ├── result_table_test.py
│ │ ├── results_test.py
│ │ └── scanner_test.py
│ └── util.py
├── help/
│ ├── changelog
│ ├── changelog.tmpl
│ ├── conf.tmpl
│ ├── de/
│ │ ├── faq.rst
│ │ ├── folders.rst
│ │ ├── index.rst
│ │ ├── preferences.rst
│ │ ├── quick_start.rst
│ │ ├── reprioritize.rst
│ │ └── results.rst
│ ├── en/
│ │ ├── contribute.rst
│ │ ├── developer/
│ │ │ ├── core/
│ │ │ │ ├── app.rst
│ │ │ │ ├── directories.rst
│ │ │ │ ├── engine.rst
│ │ │ │ ├── fs.rst
│ │ │ │ ├── gui/
│ │ │ │ │ ├── deletion_options.rst
│ │ │ │ │ └── index.rst
│ │ │ │ ├── index.rst
│ │ │ │ └── results.rst
│ │ │ ├── hscommon/
│ │ │ │ ├── build.rst
│ │ │ │ ├── conflict.rst
│ │ │ │ ├── desktop.rst
│ │ │ │ ├── gui/
│ │ │ │ │ ├── base.rst
│ │ │ │ │ ├── column.rst
│ │ │ │ │ ├── progress_window.rst
│ │ │ │ │ ├── selectable_list.rst
│ │ │ │ │ ├── table.rst
│ │ │ │ │ ├── text_field.rst
│ │ │ │ │ └── tree.rst
│ │ │ │ ├── index.rst
│ │ │ │ ├── jobprogress/
│ │ │ │ │ ├── job.rst
│ │ │ │ │ └── performer.rst
│ │ │ │ ├── notify.rst
│ │ │ │ ├── path.rst
│ │ │ │ └── util.rst
│ │ │ └── index.rst
│ │ ├── faq.rst
│ │ ├── folders.rst
│ │ ├── index.rst
│ │ ├── preferences.rst
│ │ ├── quick_start.rst
│ │ ├── reprioritize.rst
│ │ ├── results.rst
│ │ └── scan.rst
│ ├── fr/
│ │ ├── faq.rst
│ │ ├── folders.rst
│ │ ├── index.rst
│ │ ├── preferences.rst
│ │ ├── quick_start.rst
│ │ ├── reprioritize.rst
│ │ └── results.rst
│ ├── hy/
│ │ ├── faq.rst
│ │ ├── folders.rst
│ │ ├── index.rst
│ │ ├── preferences.rst
│ │ ├── quick_start.rst
│ │ ├── reprioritize.rst
│ │ └── results.rst
│ ├── ru/
│ │ ├── faq.rst
│ │ ├── folders.rst
│ │ ├── index.rst
│ │ ├── preferences.rst
│ │ ├── quick_start.rst
│ │ ├── reprioritize.rst
│ │ └── results.rst
│ └── uk/
│ ├── faq.rst
│ ├── folders.rst
│ ├── index.rst
│ ├── preferences.rst
│ ├── quick_start.rst
│ ├── reprioritize.rst
│ └── results.rst
├── hscommon/
│ ├── LICENSE
│ ├── README
│ ├── __init__.py
│ ├── build.py
│ ├── conflict.py
│ ├── desktop.py
│ ├── gui/
│ │ ├── __init__.py
│ │ ├── base.py
│ │ ├── column.py
│ │ ├── progress_window.py
│ │ ├── selectable_list.py
│ │ ├── table.py
│ │ ├── text_field.py
│ │ └── tree.py
│ ├── jobprogress/
│ │ ├── __init__.py
│ │ ├── job.py
│ │ └── performer.py
│ ├── loc.py
│ ├── notify.py
│ ├── path.py
│ ├── plat.py
│ ├── pygettext.py
│ ├── sphinxgen.py
│ ├── tests/
│ │ ├── __init__.py
│ │ ├── conflict_test.py
│ │ ├── notify_test.py
│ │ ├── path_test.py
│ │ ├── selectable_list_test.py
│ │ ├── table_test.py
│ │ ├── tree_test.py
│ │ └── util_test.py
│ ├── testutil.py
│ ├── trans.py
│ └── util.py
├── images/
│ ├── dupeguru.icns
│ ├── exchange.icns
│ └── exchange_purple_waifu_s4_tta8.xcf
├── locale/
│ ├── ar/
│ │ └── LC_MESSAGES/
│ │ ├── columns.po
│ │ ├── core.po
│ │ └── ui.po
│ ├── columns.pot
│ ├── core.pot
│ ├── cs/
│ │ └── LC_MESSAGES/
│ │ ├── columns.po
│ │ ├── core.po
│ │ └── ui.po
│ ├── de/
│ │ └── LC_MESSAGES/
│ │ ├── columns.po
│ │ ├── core.po
│ │ └── ui.po
│ ├── el/
│ │ └── LC_MESSAGES/
│ │ ├── columns.po
│ │ ├── core.po
│ │ └── ui.po
│ ├── en/
│ │ └── LC_MESSAGES/
│ │ ├── columns.po
│ │ ├── core.po
│ │ └── ui.po
│ ├── es/
│ │ └── LC_MESSAGES/
│ │ ├── columns.po
│ │ ├── core.po
│ │ └── ui.po
│ ├── fr/
│ │ └── LC_MESSAGES/
│ │ ├── columns.po
│ │ ├── core.po
│ │ └── ui.po
│ ├── hy/
│ │ └── LC_MESSAGES/
│ │ ├── columns.po
│ │ ├── core.po
│ │ └── ui.po
│ ├── it/
│ │ └── LC_MESSAGES/
│ │ ├── columns.po
│ │ ├── core.po
│ │ └── ui.po
│ ├── ja/
│ │ └── LC_MESSAGES/
│ │ ├── columns.po
│ │ ├── core.po
│ │ └── ui.po
│ ├── ko/
│ │ └── LC_MESSAGES/
│ │ ├── columns.po
│ │ ├── core.po
│ │ └── ui.po
│ ├── ms/
│ │ └── LC_MESSAGES/
│ │ ├── columns.po
│ │ ├── core.po
│ │ └── ui.po
│ ├── nl/
│ │ └── LC_MESSAGES/
│ │ ├── columns.po
│ │ ├── core.po
│ │ └── ui.po
│ ├── pl_PL/
│ │ └── LC_MESSAGES/
│ │ ├── columns.po
│ │ ├── core.po
│ │ └── ui.po
│ ├── pt_BR/
│ │ └── LC_MESSAGES/
│ │ ├── columns.po
│ │ ├── core.po
│ │ └── ui.po
│ ├── ru/
│ │ └── LC_MESSAGES/
│ │ ├── columns.po
│ │ ├── core.po
│ │ └── ui.po
│ ├── tr/
│ │ └── LC_MESSAGES/
│ │ ├── columns.po
│ │ ├── core.po
│ │ └── ui.po
│ ├── ui.pot
│ ├── uk/
│ │ └── LC_MESSAGES/
│ │ ├── columns.po
│ │ ├── core.po
│ │ └── ui.po
│ ├── vi/
│ │ └── LC_MESSAGES/
│ │ ├── columns.po
│ │ ├── core.po
│ │ └── ui.po
│ ├── zh_CN/
│ │ └── LC_MESSAGES/
│ │ ├── columns.po
│ │ ├── core.po
│ │ └── ui.po
│ └── zh_TW/
│ └── LC_MESSAGES/
│ ├── columns.po
│ ├── core.po
│ └── ui.po
├── macos.md
├── package.py
├── pkg/
│ ├── arch/
│ │ ├── dupeguru.desktop
│ │ └── dupeguru.json
│ ├── debian/
│ │ ├── Makefile
│ │ ├── build_pe_modules.py
│ │ ├── changelog
│ │ ├── compat
│ │ ├── control
│ │ ├── copyright
│ │ ├── dirs
│ │ ├── dupeguru.desktop
│ │ ├── dupeguru.json
│ │ ├── rules
│ │ └── source/
│ │ ├── format
│ │ └── options
│ └── dupeguru.desktop
├── pyproject.toml
├── qt/
│ ├── __init__.py
│ ├── about_box.py
│ ├── app.py
│ ├── column.py
│ ├── deletion_options.py
│ ├── details_dialog.py
│ ├── details_table.py
│ ├── dg.qrc
│ ├── directories_dialog.py
│ ├── directories_model.py
│ ├── error_report_dialog.py
│ ├── exclude_list_dialog.py
│ ├── exclude_list_table.py
│ ├── ignore_list_dialog.py
│ ├── ignore_list_table.py
│ ├── me/
│ │ ├── __init__.py
│ │ ├── details_dialog.py
│ │ ├── preferences_dialog.py
│ │ └── results_model.py
│ ├── pe/
│ │ ├── __init__.py
│ │ ├── block.py
│ │ ├── block.pyi
│ │ ├── details_dialog.py
│ │ ├── image_viewer.py
│ │ ├── modules/
│ │ │ └── block.c
│ │ ├── photo.py
│ │ ├── preferences_dialog.py
│ │ └── results_model.py
│ ├── platform.py
│ ├── preferences.py
│ ├── preferences_dialog.py
│ ├── prioritize_dialog.py
│ ├── problem_dialog.py
│ ├── problem_table.py
│ ├── progress_window.py
│ ├── radio_box.py
│ ├── recent.py
│ ├── result_window.py
│ ├── results_model.py
│ ├── se/
│ │ ├── __init__.py
│ │ ├── details_dialog.py
│ │ ├── preferences_dialog.py
│ │ └── results_model.py
│ ├── search_edit.py
│ ├── selectable_list.py
│ ├── stats_label.py
│ ├── tabbed_window.py
│ ├── table.py
│ ├── tree_model.py
│ └── util.py
├── requirements-extra.txt
├── requirements.txt
├── run.py
├── setup.cfg
├── setup.nsi
├── setup.py
├── tox.ini
└── win_version_info.temp
================================================
FILE CONTENTS
================================================
================================================
FILE: .ctags
================================================
-R
--exclude=build
--exclude=env
--exclude=.tox
--python-kinds=-i
================================================
FILE: .github/FUNDING.yml
================================================
github: arsenetar
================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. Windows 10 / OSX 10.15 / Ubuntu 20.04 / Arch Linux]
- Version [e.g. 4.1.0]
**Additional context**
Add any other context about the problem here. You may include the debug log although it is normally best to attach it as a file.
================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: feature
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
================================================
FILE: .github/workflows/codeql-analysis.yml
================================================
name: "CodeQL"
on:
push:
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: "24 20 * * 2"
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ["cpp", "python"]
steps:
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
- if: matrix.language == 'cpp'
name: Build Cpp
run: |
sudo apt-get update
sudo apt-get install python3-pyqt5
make modules
- if: matrix.language == 'python'
name: Autobuild
uses: github/codeql-action/autobuild@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
# Analysis
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
================================================
FILE: .github/workflows/default.yml
================================================
# Workflow lints, and checks format in parallel then runs tests on all platforms
name: Default CI/CD
on:
push:
pull_request:
branches: [master]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up Python 3.12
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: "3.12"
- uses: pre-commit/action@v3.0.1
test:
needs: [pre-commit]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12", "3.13", "3.14"]
include:
- os: windows-latest
python-version: "3.12"
- os: macos-latest
python-version: "3.12"
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools
pip install -r requirements.txt -r requirements-extra.txt
- name: Build python modules
run: |
python build.py --modules
- name: Run tests
run: |
pytest core hscommon
- name: Upload Artifacts
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: modules ${{ matrix.python-version }}
path: build/**/*.so
merge-artifacts:
needs: [test]
runs-on: ubuntu-latest
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: modules
pattern: modules*
delete-merged: true
================================================
FILE: .github/workflows/tx-push.yml
================================================
# Push translation source to Transifex
name: Transifex Sync
on:
push:
branches:
- master
paths:
- locale/*.pot
env:
TX_VERSION: "v1.6.10"
jobs:
push-source:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Get Transifex Client
run: |
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash -s -- $TX_VERSION
- name: Update & Push Translation Sources
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
run: |
./tx push -s --use-git-timestamps
================================================
FILE: .gitignore
================================================
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
#*.pot
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Environments
.env
.venv
env*/
venv/
ENV/
env.bak/
venv.bak/
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
# macOS
.DS_Store
# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
# Local History for Visual Studio Code
.history/
# Built Visual Studio Code Extensions
*.vsix
# dupeGuru Specific
/qt/*_rc.py
/help/*/conf.py
/help/*/changelog.rst
cocoa/autogen
/cocoa/*/Info.plist
/cocoa/*/build
*.waf*
.lock-waf*
/tags
================================================
FILE: .pre-commit-config.yaml
================================================
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-yaml
- id: check-toml
- id: end-of-file-fixer
exclude: ".*.json"
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 24.2.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
exclude: ^(.tox|env|build|dist|help|qt/dg_rc.py|pkg).*
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.11.0
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies: ["@commitlint/config-conventional"]
================================================
FILE: .sonarcloud.properties
================================================
sonar.python.version=3.7, 3.8, 3.9, 3.10, 3.11
================================================
FILE: .tx/config
================================================
[main]
host = https://www.transifex.com
[o:voltaicideas:p:dupeguru-1:r:columns]
file_filter = locale/<lang>/LC_MESSAGES/columns.po
source_file = locale/columns.pot
source_lang = en
type = PO
[o:voltaicideas:p:dupeguru-1:r:core]
file_filter = locale/<lang>/LC_MESSAGES/core.po
source_file = locale/core.pot
source_lang = en
type = PO
[o:voltaicideas:p:dupeguru-1:r:ui]
file_filter = locale/<lang>/LC_MESSAGES/ui.po
source_file = locale/ui.pot
source_lang = en
type = PO
================================================
FILE: .vscode/extensions.json
================================================
{
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"redhat.vscode-yaml",
"ms-python.vscode-pylance",
"ms-python.python",
"ms-python.black-formatter",
],
// List of extensions recommended by VS Code that should not be recommended for
// users of this workspace.
"unwantedRecommendations": []
}
================================================
FILE: .vscode/launch.json
================================================
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "DupuGuru",
"type": "debugpy",
"request": "launch",
"program": "run.py",
"console": "integratedTerminal",
"subProcess": true,
"justMyCode": false
},
]
}
================================================
FILE: .vscode/settings.json
================================================
{
"cSpell.words": [
"Dupras",
"hscommon"
],
"editor.rulers": [
88,
120
],
"python.languageServer": "Pylance",
"yaml.schemaStore.enable": true,
"[python]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "ms-python.black-formatter"
},
"python.testing.pytestEnabled": true
}
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing to dupeGuru
The following is a set of guidelines and information for contributing to dupeGuru.
#### Table of Contents
[Things to Know Before Starting](#things-to-know-before-starting)
[Ways to Contribute](#ways-to-contribute)
* [Reporting Bugs](#reporting-bugs)
* [Suggesting Enhancements](#suggesting-enhancements)
* [Localization](#localization)
* [Code Contribution](#code-contribution)
* [Pull Requests](#pull-requests)
[Style Guides](#style-guides)
* [Git Commit Messages](#git-commit-messages)
* [Python Style Guide](#python-style-guide)
* [Documentation Style Guide](#documentation-style-guide)
[Additional Notes](#additional-notes)
* [Issue and Pull Request Labels](#issue-and-pull-request-labels)
## Things to Know Before Starting
**TODO**
## Ways to contribute
### Reporting Bugs
**TODO**
### Suggesting Enhancements
**TODO**
### Localization
**TODO**
### Code Contribution
**TODO**
### Pull Requests
Please follow these steps to have your contribution considered by the maintainers:
1. Keep Pull Request specific to one feature or bug.
2. Follow the [style guides](#style-guides)
3. After you submit your pull request, verify that all [status checks](https://help.github.com/articles/about-status-checks/) are passing <details><summary>What if the status checks are failing?</summary>If a status check is failing, and you believe that the failure is unrelated to your change, please leave a comment on the pull request explaining why you believe the failure is unrelated. A maintainer will re-run the status check for you. If we conclude that the failure was a false positive, then we will open an issue to track that problem with our status check suite.</details>
While the prerequisites above must be satisfied prior to having your pull request reviewed, the reviewer(s) may ask you to complete additional design work, tests, or other changes before your pull request can be ultimately accepted.
## Style Guides
### Git Commit Messages
- Use the present tense ("Add feature" not "Added feature")
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit the first line to 72 characters or less
- Reference issues and pull requests liberally after the first line
### Python Style Guide
- All files are formatted with [Black](https://github.com/psf/black)
- Follow [PEP 8](https://peps.python.org/pep-0008/) as much as practical
- Pass [flake8](https://flake8.pycqa.org/en/latest/) linting
- Include [PEP 484](https://peps.python.org/pep-0484/) type hints (new code)
### Documentation Style Guide
**TODO**
## Additional Notes
### Issue and Pull Request Labels
This section lists and describes the various labels used with issues and pull requests. Each of the labels is listed with a search link as well.
#### Issue Type and Status
| Label name | Search | Description |
|------------|--------|-------------|
| `enhancement` | [search](https://github.com/arsenetar/dupeguru/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement) | Feature requests and enhancements. |
| `bug` | [search](https://github.com/arsenetar/dupeguru/issues?q=is%3Aopen+is%3Aissue+label%3Abug) | Bug reports. |
| `duplicate` | [search](https://github.com/arsenetar/dupeguru/issues?q=is%3Aopen+is%3Aissue+label%3Aduplicate) | Issue is a duplicate of existing issue. |
| `needs-reproduction` | [search](https://github.com/arsenetar/dupeguru/issues?q=is%3Aopen+is%3Aissue+label%3Aneeds-reproduction) | A bug that has not been able to be reproduced. |
| `needs-information` | [search](https://github.com/arsenetar/dupeguru/issues?q=is%3Aopen+is%3Aissue+label%3Aneeds-information) | More information needs to be collected about these problems or feature requests (e.g. steps to reproduce). |
| `blocked` | [search](https://github.com/arsenetar/dupeguru/issues?q=is%3Aopen+is%3Aissue+label%3Ablocked) | Issue blocked by other issues. |
| `beginner` | [search](https://github.com/arsenetar/dupeguru/issues?q=is%3Aopen+is%3Aissue+label%3Abeginner) | Less complex issues for users who want to start contributing. |
#### Category Labels
| Label name | Search | Description |
|------------|--------|-------------|
| `3rd party` | [search](https://github.com/arsenetar/dupeguru/issues?q=is%3Aopen+is%3Aissue+label%3A%223rd%20party%22) | Related to a 3rd party dependency. |
| `crash` | [search](https://github.com/arsenetar/dupeguru/issues?q=is%3Aopen+is%3Aissue+label%3Acrash) | Related to crashes (complete, or unhandled). |
| `documentation` | [search](https://github.com/arsenetar/dupeguru/issues?q=is%3Aopen+is%3Aissue+label%3Adocumentation) | Related to any documentation. |
| `linux` | [search](https://github.com/arsenetar/dupeguru/issues?q=is%3Aopen+is%3Aissue+label%3linux) | Related to running on Linux. |
| `mac` | [search](https://github.com/arsenetar/dupeguru/issues?q=is%3Aopen+is%3Aissue+label%3Amac) | Related to running on macOS. |
| `performance` | [search](https://github.com/arsenetar/dupeguru/issues?q=is%3Aopen+is%3Aissue+label%3Aperformance) | Related to the performance. |
| `ui` | [search](https://github.com/arsenetar/dupeguru/issues?q=is%3Aopen+is%3Aissue+label%3Aui)| Related to the visual design. |
| `windows` | [search](https://github.com/arsenetar/dupeguru/issues?q=is%3Aopen+is%3Aissue+label%3Awindows) | Related to running on Windows. |
#### Pull Request Labels
None at this time, if the volume of Pull Requests increase labels may be added to manage.
================================================
FILE: CREDITS
================================================
To know who contributed to dupeGuru, you can look at the commit log, but not all contributions
result in a commit. This file lists contributors who don't necessarily appear in the commit log.
* Jason Cho, Exchange icon
* schollidesign (https://findicons.com/pack/1035/human_o2), Zoom-in, Zoom-out, Zoom-best-fit, Zoom-original icons
* Jérôme Cantin, Main icon
* Gregor Tätzner, German localization
* Frank Weber, German localization
* Eric Dee, Chinese localization
* Aleš Nehyba, Czech localization
* Paolo Rossi, Italian localization
* Hrant Ohanyan, Armenian localization
* Igor Pavlov, Russian localization
* Kyrill Detinov, Russian localization
* Yuri Petrashko, Ukrainian localization
* Nickolas Pohilets, Ukrainian localization
* Victor Figueiredo, Brazilian localization
* Phan Anh, Vietnamese localization
* Gabriel Koutilellis, Greek localization
Thanks!
================================================
FILE: LICENSE
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
================================================
FILE: MANIFEST.in
================================================
recursive-include core *.h
recursive-include core *.m
include run.py
graft locale
graft help
================================================
FILE: Makefile
================================================
PYTHON ?= python3
PYTHON_VERSION_MINOR := $(shell ${PYTHON} -c "import sys; print(sys.version_info.minor)")
PYRCC5 ?= pyrcc5
REQ_MINOR_VERSION = 7
PREFIX ?= /usr/local
# Window compatability via Msys2
# - venv creates Scripts instead of bin
# - compile generates .pyd instead of .so
# - venv with --sytem-site-packages has issues on windows as well...
ifeq ($(shell ${PYTHON} -c "import platform; print(platform.system())"), Windows)
BIN = Scripts
SO = *.pyd
VENV_OPTIONS =
else
BIN = bin
SO = *.so
VENV_OPTIONS = --system-site-packages
endif
# Set this variable if all dependencies are already met on the system. We will then avoid the
# whole vitualenv creation and pip install dance.
NO_VENV ?=
ifdef NO_VENV
VENV_PYTHON = $(PYTHON)
else
VENV_PYTHON = ./env/$(BIN)/python
endif
# If you're installing into a path that is not going to be the final path prefix (such as a
# sandbox), set DESTDIR to that path.
# Our build scripts are not very "make like" yet and perform their task in a bundle. For now, we
# use one of each file to act as a representative, a target, of these groups.
packages = hscommon core qt
localedirs = $(wildcard locale/*/LC_MESSAGES)
pofiles = $(wildcard locale/*/LC_MESSAGES/*.po)
mofiles = $(patsubst %.po,%.mo,$(pofiles))
vpath %.po $(localedirs)
vpath %.mo $(localedirs)
all: | env i18n modules qt/dg_rc.py
@echo "Build complete! You can run dupeGuru with 'make run'"
run:
$(VENV_PYTHON) run.py
pyc: | env
${VENV_PYTHON} -m compileall ${packages}
reqs:
ifneq ($(shell test $(PYTHON_VERSION_MINOR) -ge $(REQ_MINOR_VERSION); echo $$?),0)
$(error "Python 3.${REQ_MINOR_VERSION}+ required. Aborting.")
endif
ifndef NO_VENV
@${PYTHON} -m venv -h > /dev/null || \
echo "Creation of our virtualenv failed. If you're on Ubuntu, you probably need python3-venv."
endif
@${PYTHON} -c 'import PyQt5' >/dev/null 2>&1 || \
{ echo "PyQt 5.4+ required. Install it and try again. Aborting"; exit 1; }
env: | reqs
ifndef NO_VENV
@echo "Creating our virtualenv"
${PYTHON} -m venv env
$(VENV_PYTHON) -m pip install -r requirements.txt
# We can't use the "--system-site-packages" flag on creation because otherwise we end up with
# the system's pip and that messes up things in some cases (notably in Gentoo).
${PYTHON} -m venv --upgrade ${VENV_OPTIONS} env
endif
build/help: | env
$(VENV_PYTHON) build.py --doc
qt/dg_rc.py: qt/dg.qrc
$(PYRCC5) qt/dg.qrc > qt/dg_rc.py
i18n: $(mofiles)
%.mo: %.po
msgfmt -o $@ $<
modules: | env
$(VENV_PYTHON) build.py --modules
mergepot: | env
$(VENV_PYTHON) build.py --mergepot
normpo: | env
$(VENV_PYTHON) build.py --normpo
install: all pyc
mkdir -p ${DESTDIR}${PREFIX}/share/dupeguru
cp -rf ${packages} locale ${DESTDIR}${PREFIX}/share/dupeguru
cp -f run.py ${DESTDIR}${PREFIX}/share/dupeguru/run.py
chmod 755 ${DESTDIR}${PREFIX}/share/dupeguru/run.py
mkdir -p ${DESTDIR}${PREFIX}/bin
ln -sf ${PREFIX}/share/dupeguru/run.py ${DESTDIR}${PREFIX}/bin/dupeguru
mkdir -p ${DESTDIR}${PREFIX}/share/applications
cp -f pkg/dupeguru.desktop ${DESTDIR}${PREFIX}/share/applications
mkdir -p ${DESTDIR}${PREFIX}/share/pixmaps
cp -f images/dgse_logo_128.png ${DESTDIR}${PREFIX}/share/pixmaps/dupeguru.png
installdocs: build/help
mkdir -p ${DESTDIR}${PREFIX}/share/dupeguru
cp -rf build/help ${DESTDIR}${PREFIX}/share/dupeguru
uninstall:
rm -rf "${DESTDIR}${PREFIX}/share/dupeguru"
rm -f "${DESTDIR}${PREFIX}/bin/dupeguru"
rm -f "${DESTDIR}${PREFIX}/share/applications/dupeguru.desktop"
rm -f "${DESTDIR}${PREFIX}/share/pixmaps/dupeguru.png"
clean:
-rm -rf build
-rm locale/*/LC_MESSAGES/*.mo
-rm core/pe/*.$(SO) qt/pe/*.$(SO)
.PHONY: clean normpo mergepot modules i18n reqs run pyc install uninstall all
================================================
FILE: README.md
================================================
# dupeGuru
[dupeGuru][dupeguru] is a cross-platform (Linux, OS X, Windows) GUI tool to find duplicate files in
a system. It is written mostly in Python 3 and uses [qt](https://www.qt.io/) for the UI.
## Current status
Still looking for additional help especially with regards to:
* OSX maintenance: reproducing bugs, packaging verification.
* Linux maintenance: reproducing bugs, maintaining PPA repository, Debian package, rpm package.
* Translations: updating missing strings, transifex project at https://www.transifex.com/voltaicideas/dupeguru-1
* Documentation: keeping it up-to-date.
## Contents of this folder
This folder contains the source for dupeGuru. Its documentation is in `help`, but is also
[available online][documentation] in its built form. Here's how this source tree is organized:
* core: Contains the core logic code for dupeGuru. It's Python code.
* qt: UI code for the Qt toolkit. It's written in Python and uses PyQt.
* images: Images used by the different UI codebases.
* pkg: Skeleton files required to create different packages
* help: Help document, written for Sphinx.
* locale: .po files for localization.
* hscommon: A collection of helpers used across HS applications.
## How to build dupeGuru from source
### Windows & macOS specific additional instructions
For windows instructions see the [Windows Instructions](Windows.md).
For macos instructions (qt version) see the [macOS Instructions](macos.md).
### Prerequisites
* [Python 3.7+][python]
* PyQt5
### System Setup
When running in a linux based environment the following system packages or equivalents are needed to build:
* python3-pyqt5
* pyqt5-dev-tools (on some systems, see note)
* python3-venv (only if using a virtual environment)
* python3-dev
* build-essential
Note: On some linux systems pyrcc5 is not put on the path when installing python3-pyqt5, this will cause some issues with the resource files (and icons). These systems should have a respective pyqt5-dev-tools package, which should also be installed. The presence of pyrcc5 can be checked with `which pyrcc5`. Debian based systems need the extra package, and Arch does not.
To create packages the following are also needed:
* python3-setuptools
* debhelper
### Building with Make
dupeGuru comes with a makefile that can be used to build and run:
$ make && make run
### Building without Make
$ cd <dupeGuru directory>
$ python3 -m venv --system-site-packages ./env
$ source ./env/bin/activate
$ pip install -r requirements.txt
$ python build.py
$ python run.py
### Generating Debian/Ubuntu package
To generate packages the extra requirements in requirements-extra.txt must be installed, the
steps are as follows:
$ cd <dupeGuru directory>
$ python3 -m venv --system-site-packages ./env
$ source ./env/bin/activate
$ pip install -r requirements.txt -r requirements-extra.txt
$ python build.py --clean
$ python package.py
This can be made a one-liner (once in the directory) as:
$ bash -c "python3 -m venv --system-site-packages env && source env/bin/activate && pip install -r requirements.txt -r requirements-extra.txt && python build.py --clean && python package.py"
## Running tests
The complete test suite is run with [Tox 1.7+][tox]. If you have it installed system-wide, you
don't even need to set up a virtualenv. Just `cd` into the root project folder and run `tox`.
If you don't have Tox system-wide, install it in your virtualenv with `pip install tox` and then
run `tox`.
You can also run automated tests without Tox. Extra requirements for running tests are in
`requirements-extra.txt`. So, you can do `pip install -r requirements-extra.txt` inside your
virtualenv and then `py.test core hscommon`
[dupeguru]: https://dupeguru.voltaicideas.net/
[cross-toolkit]: http://www.hardcoded.net/articles/cross-toolkit-software
[documentation]: http://dupeguru.voltaicideas.net/help/en/
[python]: http://www.python.org/
[pyqt]: http://www.riverbankcomputing.com
[tox]: https://tox.readthedocs.org/en/latest/
================================================
FILE: Windows.md
================================================
## How to build dupeGuru for Windows
### Prerequisites
- [Python 3.7+][python]
- [Visual Studio 2019][vs] or [Visual Studio Build Tools 2019][vsBuildTools] with the Windows 10 SDK
- [nsis][nsis] (for installer creation)
- [msys2][msys2] (for using makefile method)
NOTE: When installing Visual Studio or the Visual Studio Build Tools with the Windows 10 SDK on versions of Windows below 10 be sure to make sure that the Universal CRT is installed before installing Visual studio as noted in the [Windows 10 SDK Notes][win10sdk] and found at [KB2999226][KB2999226].
After installing python it is recommended to update setuptools before compiling packages. To update run (example is for python launcher and 3.8):
$ py -3.8 -m pip install --upgrade setuptools
More details on setting up python for compiling packages on windows can be found on the [python wiki][pythonWindowsCompilers] Take note of the required vc++ versions.
### With build.py (preferred)
To build with a different python version 3.7 vs 3.8 or 32 bit vs 64 bit specify that version instead of -3.8 to the `py` command below. If you want to build additional versions while keeping all virtual environments setup use a different location for each virtual environment.
$ cd <dupeGuru directory>
$ py -3.8 -m venv .\env
$ .\env\Scripts\activate
$ pip install -r requirements.txt
$ python build.py
$ python run.py
### With makefile
It is possible to build dupeGuru with the makefile on windows using a compatable POSIX environment. The following steps have been tested using [msys2][msys2]. Before running make:
1. Install msys2 or other POSIX environment
2. Install PyQt5 globally via pip
3. Use the respective console for msys2 it is `msys2 msys`
Then the following execution of the makefile should work. Pass the correct value for PYTHON to the makefile if not on the path as python3.
$ cd <dupeGuru directory>
$ make PYTHON='py -3.8'
$ make run
### Generate Windows Installer Packages
You need to use the respective x86 or x64 version of python to build the 32 bit and 64 bit versions. The build scripts will automatically detect the python architecture for you. When using build.py make sure the resulting python works before continuing to package.py. NOTE: package.py looks for the 'makensis' executable in the default location for a 64 bit windows system. The extra requirements need to be installed to run packaging: `pip install -r requirements-extra.txt`. Run the following in the respective virtual environment.
$ python package.py
### Running tests
The complete test suite can be run with tox just like on linux. NOTE: The extra requirements need to be installed to run unit tests: `pip install -r requirements-extra.txt`.
[python]: http://www.python.org/
[nsis]: http://nsis.sourceforge.net/Main_Page
[vs]: https://www.visualstudio.com/downloads/#visual-studio-community-2019
[vsBuildTools]: https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2019
[win10sdk]: https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk
[KB2999226]: https://support.microsoft.com/en-us/help/2999226/update-for-universal-c-runtime-in-windows
[pythonWindowsCompilers]: https://wiki.python.org/moin/WindowsCompilers
[msys2]: http://www.msys2.org/
================================================
FILE: build.py
================================================
# Copyright 2017 Virgil Dupras
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
from pathlib import Path
import sys
from optparse import OptionParser
import shutil
from multiprocessing import Pool
from hscommon import sphinxgen
from hscommon.build import (
add_to_pythonpath,
print_and_do,
fix_qt_resource_file,
)
from hscommon import loc
import subprocess
def parse_args():
usage = "usage: %prog [options]"
parser = OptionParser(usage=usage)
parser.add_option(
"--clean",
action="store_true",
dest="clean",
help="Clean build folder before building",
)
parser.add_option("--doc", action="store_true", dest="doc", help="Build only the help file (en)")
parser.add_option("--alldoc", action="store_true", dest="all_doc", help="Build only the help file in all languages")
parser.add_option("--loc", action="store_true", dest="loc", help="Build only localization")
parser.add_option(
"--updatepot",
action="store_true",
dest="updatepot",
help="Generate .pot files from source code.",
)
parser.add_option(
"--mergepot",
action="store_true",
dest="mergepot",
help="Update all .po files based on .pot files.",
)
parser.add_option(
"--normpo",
action="store_true",
dest="normpo",
help="Normalize all PO files (do this before commit).",
)
parser.add_option(
"--modules",
action="store_true",
dest="modules",
help="Build the python modules.",
)
(options, args) = parser.parse_args()
return options
def build_one_help(language):
print(f"Generating Help in {language}")
current_path = Path(".").absolute()
changelog_path = current_path.joinpath("help", "changelog")
tixurl = "https://github.com/arsenetar/dupeguru/issues/{}"
changelogtmpl = current_path.joinpath("help", "changelog.tmpl")
conftmpl = current_path.joinpath("help", "conf.tmpl")
help_basepath = current_path.joinpath("help", language)
help_destpath = current_path.joinpath("build", "help", language)
confrepl = {"language": language}
sphinxgen.gen(
help_basepath,
help_destpath,
changelog_path,
tixurl,
confrepl,
conftmpl,
changelogtmpl,
)
def build_help():
languages = ["en", "de", "fr", "hy", "ru", "uk"]
# Running with Pools as for some reason sphinx seems to cross contaminate the output otherwise
with Pool(len(languages)) as p:
p.map(build_one_help, languages)
def build_localizations():
loc.compile_all_po("locale")
locale_dest = Path("build", "locale")
if locale_dest.exists():
shutil.rmtree(locale_dest)
shutil.copytree("locale", locale_dest, ignore=shutil.ignore_patterns("*.po", "*.pot"))
def build_updatepot():
print("Building .pot files from source files")
print("Building core.pot")
loc.generate_pot(["core"], Path("locale", "core.pot"), ["tr"])
print("Building columns.pot")
loc.generate_pot(["core"], Path("locale", "columns.pot"), ["coltr"])
print("Building ui.pot")
loc.generate_pot(["qt"], Path("locale", "ui.pot"), ["tr"], merge=True)
def build_mergepot():
print("Updating .po files using .pot files")
loc.merge_pots_into_pos("locale")
def build_normpo():
loc.normalize_all_pos("locale")
def build_pe_modules():
print("Building PE Modules")
# Leverage setup.py to build modules
subprocess.check_call([sys.executable, "setup.py", "build_ext", "--inplace"])
def build_normal():
print("Building dupeGuru with UI qt")
add_to_pythonpath(".")
print("Building dupeGuru")
build_pe_modules()
print("Building localizations")
build_localizations()
print("Building Qt stuff")
Path("qt", "dg_rc.py").unlink(missing_ok=True)
print_and_do("pyrcc5 {} > {}".format(Path("qt", "dg.qrc"), Path("qt", "dg_rc.py")))
fix_qt_resource_file(Path("qt", "dg_rc.py"))
build_help()
def main():
if sys.version_info < (3, 7):
sys.exit("Python < 3.7 is unsupported.")
options = parse_args()
if options.clean and Path("build").exists():
shutil.rmtree("build")
if not Path("build").exists():
Path("build").mkdir()
if options.doc:
build_one_help("en")
elif options.all_doc:
build_help()
elif options.loc:
build_localizations()
elif options.updatepot:
build_updatepot()
elif options.mergepot:
build_mergepot()
elif options.normpo:
build_normpo()
elif options.modules:
build_pe_modules()
else:
build_normal()
if __name__ == "__main__":
main()
================================================
FILE: commitlint.config.js
================================================
const Configuration = {
/*
* Resolve and load @commitlint/config-conventional from node_modules.
* Referenced packages must be installed
*/
extends: ['@commitlint/config-conventional'],
/*
* Any rules defined here will override rules from @commitlint/config-conventional
*/
rules: {
'header-max-length': [2, 'always', 72],
'subject-case': [2, 'always', 'sentence-case'],
'scope-enum': [2, 'always'],
},
};
module.exports = Configuration;
================================================
FILE: core/__init__.py
================================================
__version__ = "4.3.1"
__appname__ = "dupeGuru"
================================================
FILE: core/app.py
================================================
# Copyright 2016 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
import cProfile
import datetime
import os
import os.path as op
import logging
import subprocess
import re
import shutil
from pathlib import Path
from send2trash import send2trash
from hscommon.jobprogress import job
from hscommon.notify import Broadcaster
from hscommon.conflict import smart_move, smart_copy
from hscommon.gui.progress_window import ProgressWindow
from hscommon.util import delete_if_empty, first, escape, nonone, allsame
from hscommon.trans import tr
from hscommon import desktop
from core import se, me, pe
from core.pe.photo import get_delta_dimensions
from core.util import cmp_value, fix_surrogate_encoding
from core import directories, results, export, fs, prioritize
from core.ignore import IgnoreList
from core.exclude import ExcludeDict as ExcludeList
from core.scanner import ScanType
from core.gui.deletion_options import DeletionOptions
from core.gui.details_panel import DetailsPanel
from core.gui.directory_tree import DirectoryTree
from core.gui.ignore_list_dialog import IgnoreListDialog
from core.gui.exclude_list_dialog import ExcludeListDialogCore
from core.gui.problem_dialog import ProblemDialog
from core.gui.stats_label import StatsLabel
HAD_FIRST_LAUNCH_PREFERENCE = "HadFirstLaunch"
DEBUG_MODE_PREFERENCE = "DebugMode"
MSG_NO_MARKED_DUPES = tr("There are no marked duplicates. Nothing has been done.")
MSG_NO_SELECTED_DUPES = tr("There are no selected duplicates. Nothing has been done.")
MSG_MANY_FILES_TO_OPEN = tr(
"You're about to open many files at once. Depending on what those "
"files are opened with, doing so can create quite a mess. Continue?"
)
class DestType:
DIRECT = 0
RELATIVE = 1
ABSOLUTE = 2
class JobType:
SCAN = "job_scan"
LOAD = "job_load"
MOVE = "job_move"
COPY = "job_copy"
DELETE = "job_delete"
class AppMode:
STANDARD = 0
MUSIC = 1
PICTURE = 2
JOBID2TITLE = {
JobType.SCAN: tr("Scanning for duplicates"),
JobType.LOAD: tr("Loading"),
JobType.MOVE: tr("Moving"),
JobType.COPY: tr("Copying"),
JobType.DELETE: tr("Sending to Trash"),
}
class DupeGuru(Broadcaster):
"""Holds everything together.
Instantiated once per running application, it holds a reference to every high-level object
whose reference needs to be held: :class:`~core.results.Results`,
:class:`~core.directories.Directories`, :mod:`core.gui` instances, etc..
It also hosts high level methods and acts as a coordinator for all those elements. This is why
some of its methods seem a bit shallow, like for example :meth:`mark_all` and
:meth:`remove_duplicates`. These methos are just proxies for a method in :attr:`results`, but
they are also followed by a notification call which is very important if we want GUI elements
to be correctly notified of a change in the data they're presenting.
.. attribute:: directories
Instance of :class:`~core.directories.Directories`. It holds the current folder selection.
.. attribute:: results
Instance of :class:`core.results.Results`. Holds the results of the latest scan.
.. attribute:: selected_dupes
List of currently selected dupes from our :attr:`results`. Whenever the user changes its
selection at the UI level, :attr:`result_table` takes care of updating this attribute, so
you can trust that it's always up-to-date.
.. attribute:: result_table
Instance of :mod:`meta-gui <core.gui>` table listing the results from :attr:`results`
"""
# --- View interface
# get_default(key_name)
# set_default(key_name, value)
# show_message(msg)
# open_url(url)
# open_path(path)
# reveal_path(path)
# ask_yes_no(prompt) --> bool
# create_results_window()
# show_results_window()
# show_problem_dialog()
# select_dest_folder(prompt: str) --> str
# select_dest_file(prompt: str, ext: str) --> str
NAME = PROMPT_NAME = "dupeGuru"
def __init__(self, view, portable=False):
if view.get_default(DEBUG_MODE_PREFERENCE):
logging.getLogger().setLevel(logging.DEBUG)
logging.debug("Debug mode enabled")
Broadcaster.__init__(self)
self.view = view
self.appdata = desktop.special_folder_path(desktop.SpecialFolder.APPDATA, portable=portable)
if not op.exists(self.appdata):
os.makedirs(self.appdata)
self.app_mode = AppMode.STANDARD
self.discarded_file_count = 0
self.exclude_list = ExcludeList()
hash_cache_file = op.join(self.appdata, "hash_cache.db")
fs.filesdb.connect(hash_cache_file)
self.directories = directories.Directories(self.exclude_list)
self.results = results.Results(self)
self.ignore_list = IgnoreList()
# In addition to "app-level" options, this dictionary also holds options that will be
# sent to the scanner. They don't have default values because those defaults values are
# defined in the scanner class.
self.options = {
"escape_filter_regexp": True,
"clean_empty_dirs": False,
"ignore_hardlink_matches": False,
"copymove_dest_type": DestType.RELATIVE,
"include_exists_check": True,
"rehash_ignore_mtime": False,
}
self.selected_dupes = []
self.details_panel = DetailsPanel(self)
self.directory_tree = DirectoryTree(self)
self.problem_dialog = ProblemDialog(self)
self.ignore_list_dialog = IgnoreListDialog(self)
self.exclude_list_dialog = ExcludeListDialogCore(self)
self.stats_label = StatsLabel(self)
self.result_table = None
self.deletion_options = DeletionOptions()
self.progress_window = ProgressWindow(self._job_completed, self._job_error)
children = [self.directory_tree, self.stats_label, self.details_panel]
for child in children:
child.connect()
# --- Private
def _recreate_result_table(self):
if self.result_table is not None:
self.result_table.disconnect()
if self.app_mode == AppMode.PICTURE:
self.result_table = pe.result_table.ResultTable(self)
elif self.app_mode == AppMode.MUSIC:
self.result_table = me.result_table.ResultTable(self)
else:
self.result_table = se.result_table.ResultTable(self)
self.result_table.connect()
self.view.create_results_window()
def _get_picture_cache_path(self):
cache_name = "cached_pictures.db"
return op.join(self.appdata, cache_name)
def _get_dupe_sort_key(self, dupe, get_group, key, delta):
if self.app_mode in (AppMode.MUSIC, AppMode.PICTURE) and key == "folder_path":
dupe_folder_path = getattr(dupe, "display_folder_path", dupe.folder_path)
return str(dupe_folder_path).lower()
if self.app_mode == AppMode.PICTURE and delta and key == "dimensions":
r = cmp_value(dupe, key)
ref_value = cmp_value(get_group().ref, key)
return get_delta_dimensions(r, ref_value)
if key == "marked":
return self.results.is_marked(dupe)
if key == "percentage":
m = get_group().get_match_of(dupe)
return m.percentage
elif key == "dupe_count":
return 0
else:
result = cmp_value(dupe, key)
if delta:
refval = cmp_value(get_group().ref, key)
if key in self.result_table.DELTA_COLUMNS:
result -= refval
else:
same = cmp_value(dupe, key) == refval
result = (same, result)
return result
def _get_group_sort_key(self, group, key):
if self.app_mode in (AppMode.MUSIC, AppMode.PICTURE) and key == "folder_path":
dupe_folder_path = getattr(group.ref, "display_folder_path", group.ref.folder_path)
return str(dupe_folder_path).lower()
if key == "percentage":
return group.percentage
if key == "dupe_count":
return len(group)
if key == "marked":
return len([dupe for dupe in group.dupes if self.results.is_marked(dupe)])
return cmp_value(group.ref, key)
def _do_delete(self, j, link_deleted, use_hardlinks, direct_deletion):
def op(dupe):
j.add_progress()
return self._do_delete_dupe(dupe, link_deleted, use_hardlinks, direct_deletion)
j.start_job(self.results.mark_count)
self.results.perform_on_marked(op, True)
def _do_delete_dupe(self, dupe, link_deleted, use_hardlinks, direct_deletion):
if not dupe.path.exists():
return
logging.debug("Sending '%s' to trash", dupe.path)
str_path = str(dupe.path)
if direct_deletion:
if op.isdir(str_path):
shutil.rmtree(str_path)
else:
os.remove(str_path)
else:
send2trash(str_path) # Raises OSError when there's a problem
if link_deleted:
group = self.results.get_group_of_duplicate(dupe)
ref = group.ref
linkfunc = os.link if use_hardlinks else os.symlink
linkfunc(str(ref.path), str_path)
self.clean_empty_dirs(dupe.path.parent)
def _create_file(self, path):
# We add fs.Folder to fileclasses in case the file we're loading contains folder paths.
return fs.get_file(path, self.fileclasses + [se.fs.Folder])
def _get_file(self, str_path):
path = Path(str_path)
f = self._create_file(path)
if f is None:
return None
try:
f._read_all_info(attrnames=self.METADATA_TO_READ)
return f
except OSError:
return None
def _get_export_data(self):
columns = [col for col in self.result_table._columns.ordered_columns if col.visible and col.name != "marked"]
colnames = [col.display for col in columns]
rows = []
for group_id, group in enumerate(self.results.groups):
for dupe in group:
data = self.get_display_info(dupe, group)
row = [fix_surrogate_encoding(data[col.name]) for col in columns]
row.insert(0, group_id)
rows.append(row)
return colnames, rows
def _results_changed(self):
self.selected_dupes = [d for d in self.selected_dupes if self.results.get_group_of_duplicate(d) is not None]
self.notify("results_changed")
def _start_job(self, jobid, func, args=()):
title = JOBID2TITLE[jobid]
try:
self.progress_window.run(jobid, title, func, args=args)
except job.JobInProgressError:
msg = tr(
"A previous action is still hanging in there. You can't start a new one yet. Wait "
"a few seconds, then try again."
)
self.view.show_message(msg)
def _job_completed(self, jobid):
if jobid == JobType.SCAN:
self._results_changed()
fs.filesdb.commit()
if not self.results.groups:
self.view.show_message(tr("No duplicates found."))
else:
self.view.show_results_window()
if jobid in {JobType.MOVE, JobType.DELETE}:
self._results_changed()
if jobid == JobType.LOAD:
self._recreate_result_table()
self._results_changed()
self.view.show_results_window()
if jobid in {JobType.COPY, JobType.MOVE, JobType.DELETE}:
if self.results.problems:
self.problem_dialog.refresh()
self.view.show_problem_dialog()
else:
if jobid == JobType.COPY:
msg = tr("All marked files were copied successfully.")
elif jobid == JobType.MOVE:
msg = tr("All marked files were moved successfully.")
elif jobid == JobType.DELETE and self.deletion_options.direct:
msg = tr("All marked files were deleted successfully.")
else:
msg = tr("All marked files were successfully sent to Trash.")
self.view.show_message(msg)
def _job_error(self, jobid, err):
if jobid == JobType.LOAD:
msg = tr("Could not load file: {}").format(err)
self.view.show_message(msg)
return False
else:
raise err
@staticmethod
def _remove_hardlink_dupes(files):
seen_inodes = set()
result = []
for file in files:
try:
inode = file.path.stat().st_ino
except OSError:
# The file was probably deleted or something
continue
if inode not in seen_inodes:
seen_inodes.add(inode)
result.append(file)
return result
def _select_dupes(self, dupes):
if dupes == self.selected_dupes:
return
self.selected_dupes = dupes
self.notify("dupes_selected")
# --- Protected
def _get_fileclasses(self):
if self.app_mode == AppMode.PICTURE:
return [pe.photo.PLAT_SPECIFIC_PHOTO_CLASS]
elif self.app_mode == AppMode.MUSIC:
return [me.fs.MusicFile]
else:
return [se.fs.File]
def _prioritization_categories(self):
if self.app_mode == AppMode.PICTURE:
return pe.prioritize.all_categories()
elif self.app_mode == AppMode.MUSIC:
return me.prioritize.all_categories()
else:
return prioritize.all_categories()
# --- Public
def add_directory(self, d):
"""Adds folder ``d`` to :attr:`directories`.
Shows an error message dialog if something bad happens.
:param str d: path of folder to add
"""
try:
self.directories.add_path(Path(d))
self.notify("directories_changed")
except directories.AlreadyThereError:
self.view.show_message(tr("'{}' already is in the list.").format(d))
except directories.InvalidPathError:
self.view.show_message(tr("'{}' does not exist.").format(d))
def add_selected_to_ignore_list(self):
"""Adds :attr:`selected_dupes` to :attr:`ignore_list`."""
dupes = self.without_ref(self.selected_dupes)
if not dupes:
self.view.show_message(MSG_NO_SELECTED_DUPES)
return
msg = tr("All selected %d matches are going to be ignored in all subsequent scans. Continue?")
if not self.view.ask_yes_no(msg % len(dupes)):
return
for dupe in dupes:
g = self.results.get_group_of_duplicate(dupe)
for other in g:
if other is not dupe:
self.ignore_list.ignore(str(other.path), str(dupe.path))
self.remove_duplicates(dupes)
self.ignore_list_dialog.refresh()
def apply_filter(self, result_filter):
"""Apply a filter ``filter`` to the results so that it shows only dupe groups that match it.
:param str filter: filter to apply
"""
self.results.apply_filter(None)
if self.options["escape_filter_regexp"]:
result_filter = escape(result_filter, set("()[]\\.|+?^"))
result_filter = escape(result_filter, "*", ".")
self.results.apply_filter(result_filter)
self._results_changed()
def clean_empty_dirs(self, path):
if self.options["clean_empty_dirs"]:
while delete_if_empty(path, [".DS_Store"]):
path = path.parent
def clear_picture_cache(self):
try:
os.remove(self._get_picture_cache_path())
except FileNotFoundError:
pass # we don't care
def clear_hash_cache(self):
fs.filesdb.clear()
def copy_or_move(self, dupe, copy: bool, destination: str, dest_type: DestType):
source_path = dupe.path
location_path = first(p for p in self.directories if p in dupe.path.parents)
dest_path = Path(destination)
if dest_type in {DestType.RELATIVE, DestType.ABSOLUTE}:
# no filename, no windows drive letter
source_base = source_path.relative_to(source_path.anchor).parent
if dest_type == DestType.RELATIVE:
source_base = source_base.relative_to(location_path.relative_to(location_path.anchor))
dest_path = dest_path.joinpath(source_base)
if not dest_path.exists():
dest_path.mkdir(parents=True)
# Add filename to dest_path. For file move/copy, it's not required, but for folders, yes.
dest_path = dest_path.joinpath(source_path.name)
logging.debug("Copy/Move operation from '%s' to '%s'", source_path, dest_path)
# Raises an EnvironmentError if there's a problem
if copy:
smart_copy(source_path, dest_path)
else:
smart_move(source_path, dest_path)
self.clean_empty_dirs(source_path.parent)
def copy_or_move_marked(self, copy):
"""Start an async move (or copy) job on marked duplicates.
:param bool copy: If True, duplicates will be copied instead of moved
"""
def do(j):
def op(dupe):
j.add_progress()
self.copy_or_move(dupe, copy, destination, desttype)
j.start_job(self.results.mark_count)
self.results.perform_on_marked(op, not copy)
if not self.results.mark_count:
self.view.show_message(MSG_NO_MARKED_DUPES)
return
destination = self.view.select_dest_folder(
tr("Select a directory to copy marked files to")
if copy
else tr("Select a directory to move marked files to")
)
if destination:
desttype = self.options["copymove_dest_type"]
jobid = JobType.COPY if copy else JobType.MOVE
self._start_job(jobid, do)
def delete_marked(self):
"""Start an async job to send marked duplicates to the trash."""
if not self.results.mark_count:
self.view.show_message(MSG_NO_MARKED_DUPES)
return
if not self.deletion_options.show(self.results.mark_count):
return
args = [
self.deletion_options.link_deleted,
self.deletion_options.use_hardlinks,
self.deletion_options.direct,
]
logging.debug("Starting deletion job with args %r", args)
self._start_job(JobType.DELETE, self._do_delete, args=args)
def export_to_xhtml(self):
"""Export current results to XHTML.
The configuration of the :attr:`result_table` (columns order and visibility) is used to
determine how the data is presented in the export. In other words, the exported table in
the resulting XHTML will look just like the results table.
"""
colnames, rows = self._get_export_data()
export_path = export.export_to_xhtml(colnames, rows)
desktop.open_path(export_path)
def export_to_csv(self):
"""Export current results to CSV.
The columns and their order in the resulting CSV file is determined in the same way as in
:meth:`export_to_xhtml`.
"""
dest_file = self.view.select_dest_file(tr("Select a destination for your exported CSV"), "csv")
if dest_file:
colnames, rows = self._get_export_data()
try:
export.export_to_csv(dest_file, colnames, rows)
except OSError as e:
self.view.show_message(tr("Couldn't write to file: {}").format(str(e)))
def get_display_info(self, dupe, group, delta=False):
def empty_data():
return {c.name: "---" for c in self.result_table.COLUMNS[1:]}
if (dupe is None) or (group is None):
return empty_data()
try:
return dupe.get_display_info(group, delta)
except Exception as e:
logging.warning("Exception (type: %s) on GetDisplayInfo for %s: %s", type(e), str(dupe.path), str(e))
return empty_data()
def invoke_custom_command(self):
"""Calls command in ``CustomCommand`` pref with ``%d`` and ``%r`` placeholders replaced.
Using the current selection, ``%d`` is replaced with the currently selected dupe and ``%r``
is replaced with that dupe's ref file. If there's no selection, the command is not invoked.
If the dupe is a ref, ``%d`` and ``%r`` will be the same.
"""
cmd = self.view.get_default("CustomCommand")
if not cmd:
msg = tr("You have no custom command set up. Set it up in your preferences.")
self.view.show_message(msg)
return
if not self.selected_dupes:
return
dupes = self.selected_dupes
refs = [self.results.get_group_of_duplicate(dupe).ref for dupe in dupes]
for dupe, ref in zip(dupes, refs):
dupe_cmd = cmd.replace("%d", str(dupe.path))
dupe_cmd = dupe_cmd.replace("%r", str(ref.path))
match = re.match(r'"([^"]+)"(.*)', dupe_cmd)
if match is not None:
# This code here is because subprocess. Popen doesn't seem to accept, under Windows,
# executable paths with spaces in it, *even* when they're enclosed in "". So this is
# a workaround to make the damn thing work.
exepath, args = match.groups()
path, exename = op.split(exepath)
p = subprocess.Popen(
exename + args, shell=True, cwd=path, stdout=subprocess.PIPE, stderr=subprocess.STDOUT
)
output = p.stdout.read()
logging.info("Custom command %s %s: %s", exename, args, output)
else:
p = subprocess.Popen(dupe_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
output = p.stdout.read()
logging.info("Custom command %s: %s", dupe_cmd, output)
def load(self):
"""Load directory selection and ignore list from files in appdata.
This method is called during startup so that directory selection and ignore list, which
is persistent data, is the same as when the last session was closed (when :meth:`save` was
called).
"""
self.directories.load_from_file(op.join(self.appdata, "last_directories.xml"))
self.notify("directories_changed")
p = op.join(self.appdata, "ignore_list.xml")
self.ignore_list.load_from_xml(p)
self.ignore_list_dialog.refresh()
p = op.join(self.appdata, "exclude_list.xml")
self.exclude_list.load_from_xml(p)
self.exclude_list_dialog.refresh()
def load_directories(self, filepath):
# Clear out previous entries
self.directories.__init__()
self.directories.load_from_file(filepath)
self.notify("directories_changed")
def load_from(self, filename):
"""Start an async job to load results from ``filename``.
:param str filename: path of the XML file (created with :meth:`save_as`) to load
"""
def do(j):
self.results.load_from_xml(filename, self._get_file, j)
self._start_job(JobType.LOAD, do)
def make_selected_reference(self):
"""Promote :attr:`selected_dupes` to reference position within their respective groups.
Each selected dupe will become the :attr:`~core.engine.Group.ref` of its group. If there's
more than one dupe selected for the same group, only the first (in the order currently shown
in :attr:`result_table`) dupe will be promoted.
"""
dupes = self.without_ref(self.selected_dupes)
changed_groups = set()
for dupe in dupes:
g = self.results.get_group_of_duplicate(dupe)
if g not in changed_groups and self.results.make_ref(dupe):
changed_groups.add(g)
# It's not always obvious to users what this action does, so to make it a bit clearer,
# we change our selection to the ref of all changed groups. However, we also want to keep
# the files that were ref before and weren't changed by the action. In effect, what this
# does is that we keep our old selection, but remove all non-ref dupes from it.
# If no group was changed, however, we don't touch the selection.
if not self.result_table.power_marker:
if changed_groups:
self.selected_dupes = [
d for d in self.selected_dupes if self.results.get_group_of_duplicate(d).ref is d
]
self.notify("results_changed")
else:
# If we're in "Dupes Only" mode (previously called Power Marker), things are a bit
# different. The refs are not shown in the table, and if our operation is successful,
# this means that there's no way to follow our dupe selection. Then, the best thing to
# do is to keep our selection index-wise (different dupe selection, but same index
# selection).
self.notify("results_changed_but_keep_selection")
def mark_all(self):
"""Set all dupes in the results as marked."""
self.results.mark_all()
self.notify("marking_changed")
def mark_none(self):
"""Set all dupes in the results as unmarked."""
self.results.mark_none()
self.notify("marking_changed")
def mark_invert(self):
"""Invert the marked state of all dupes in the results."""
self.results.mark_invert()
self.notify("marking_changed")
def mark_dupe(self, dupe, marked):
"""Change marked status of ``dupe``.
:param dupe: dupe to mark/unmark
:type dupe: :class:`~core.fs.File`
:param bool marked: True = mark, False = unmark
"""
if marked:
self.results.mark(dupe)
else:
self.results.unmark(dupe)
self.notify("marking_changed")
def open_selected(self):
"""Open :attr:`selected_dupes` with their associated application."""
if len(self.selected_dupes) > 10 and not self.view.ask_yes_no(MSG_MANY_FILES_TO_OPEN):
return
for dupe in self.selected_dupes:
desktop.open_path(dupe.path)
def purge_ignore_list(self):
"""Remove files that don't exist from :attr:`ignore_list`."""
self.ignore_list.filter(lambda f, s: op.exists(f) and op.exists(s))
self.ignore_list_dialog.refresh()
def remove_directories(self, indexes):
"""Remove root directories at ``indexes`` from :attr:`directories`.
:param indexes: Indexes of the directories to remove.
:type indexes: list of int
"""
try:
indexes = sorted(indexes, reverse=True)
for index in indexes:
del self.directories[index]
self.notify("directories_changed")
except IndexError:
pass
def remove_duplicates(self, duplicates):
"""Remove ``duplicates`` from :attr:`results`.
Calls :meth:`~core.results.Results.remove_duplicates` and send appropriate notifications.
:param duplicates: duplicates to remove.
:type duplicates: list of :class:`~core.fs.File`
"""
self.results.remove_duplicates(self.without_ref(duplicates))
self.notify("results_changed_but_keep_selection")
def remove_marked(self):
"""Removed marked duplicates from the results (without touching the files themselves)."""
if not self.results.mark_count:
self.view.show_message(MSG_NO_MARKED_DUPES)
return
msg = tr("You are about to remove %d files from results. Continue?")
if not self.view.ask_yes_no(msg % self.results.mark_count):
return
self.results.perform_on_marked(lambda x: None, True)
self._results_changed()
def remove_selected(self):
"""Removed :attr:`selected_dupes` from the results (without touching the files themselves)."""
dupes = self.without_ref(self.selected_dupes)
if not dupes:
self.view.show_message(MSG_NO_SELECTED_DUPES)
return
msg = tr("You are about to remove %d files from results. Continue?")
if not self.view.ask_yes_no(msg % len(dupes)):
return
self.remove_duplicates(dupes)
def rename_selected(self, newname):
"""Renames the selected dupes's file to ``newname``.
If there's more than one selected dupes, the first one is used.
:param str newname: The filename to rename the dupe's file to.
"""
try:
d = self.selected_dupes[0]
d.rename(newname)
return True
except (IndexError, fs.FSError) as e:
logging.warning("dupeGuru Warning: %s" % str(e))
return False
def reprioritize_groups(self, sort_key):
"""Sort dupes in each group (in :attr:`results`) according to ``sort_key``.
Called by the re-prioritize dialog. Calls :meth:`~core.engine.Group.prioritize` and, once
the sorting is done, show a message that confirms the action.
:param sort_key: The key being sent to :meth:`~core.engine.Group.prioritize`
:type sort_key: f(dupe)
"""
count = 0
for group in self.results.groups:
if group.prioritize(key_func=sort_key):
count += 1
if count:
self.results.refresh_required = True
self._results_changed()
msg = tr("{} duplicate groups were changed by the re-prioritization.").format(count)
self.view.show_message(msg)
def reveal_selected(self):
if self.selected_dupes:
desktop.reveal_path(self.selected_dupes[0].path)
def save(self):
if not op.exists(self.appdata):
os.makedirs(self.appdata)
self.directories.save_to_file(op.join(self.appdata, "last_directories.xml"))
p = op.join(self.appdata, "ignore_list.xml")
self.ignore_list.save_to_xml(p)
p = op.join(self.appdata, "exclude_list.xml")
self.exclude_list.save_to_xml(p)
self.notify("save_session")
def close(self):
fs.filesdb.close()
def save_as(self, filename):
"""Save results in ``filename``.
:param str filename: path of the file to save results (as XML) to.
"""
try:
self.results.save_to_xml(filename)
except OSError as e:
self.view.show_message(tr("Couldn't write to file: {}").format(str(e)))
def save_directories_as(self, filename):
"""Save directories in ``filename``.
:param str filename: path of the file to save directories (as XML) to.
"""
try:
self.directories.save_to_file(filename)
except OSError as e:
self.view.show_message(tr("Couldn't write to file: {}").format(str(e)))
def start_scanning(self, profile_scan=False):
"""Starts an async job to scan for duplicates.
Scans folders selected in :attr:`directories` and put the results in :attr:`results`
"""
scanner = self.SCANNER_CLASS()
fs.filesdb.ignore_mtime = self.options["rehash_ignore_mtime"] is True
if not self.directories.has_any_file():
self.view.show_message(tr("The selected directories contain no scannable file."))
return
# Send relevant options down to the scanner instance
for k, v in self.options.items():
if hasattr(scanner, k):
setattr(scanner, k, v)
if self.app_mode == AppMode.PICTURE:
scanner.cache_path = self._get_picture_cache_path()
self.results.groups = []
self._recreate_result_table()
self._results_changed()
def do(j):
if profile_scan:
pr = cProfile.Profile()
pr.enable()
j.set_progress(0, tr("Collecting files to scan"))
if scanner.scan_type == ScanType.FOLDERS:
files = list(self.directories.get_folders(folderclass=se.fs.Folder, j=j))
else:
files = list(self.directories.get_files(fileclasses=self.fileclasses, j=j))
if self.options["ignore_hardlink_matches"]:
files = self._remove_hardlink_dupes(files)
logging.info("Scanning %d files" % len(files))
self.results.groups = scanner.get_dupe_groups(files, self.ignore_list, j)
self.discarded_file_count = scanner.discarded_file_count
if profile_scan:
pr.disable()
pr.dump_stats(op.join(self.appdata, f"{datetime.datetime.now():%Y-%m-%d_%H-%M-%S}.profile"))
self._start_job(JobType.SCAN, do)
def toggle_selected_mark_state(self):
selected = self.without_ref(self.selected_dupes)
if not selected:
return
if allsame(self.results.is_marked(d) for d in selected):
markfunc = self.results.mark_toggle
else:
markfunc = self.results.mark
for dupe in selected:
markfunc(dupe)
self.notify("marking_changed")
def without_ref(self, dupes):
"""Returns ``dupes`` with all reference elements removed."""
return [dupe for dupe in dupes if self.results.get_group_of_duplicate(dupe).ref is not dupe]
def get_default(self, key, fallback_value=None):
result = nonone(self.view.get_default(key), fallback_value)
if fallback_value is not None and not isinstance(result, type(fallback_value)):
# we don't want to end up with garbage values from the prefs
try:
result = type(fallback_value)(result)
except Exception:
result = fallback_value
return result
def set_default(self, key, value):
self.view.set_default(key, value)
# --- Properties
@property
def stat_line(self):
result = self.results.stat_line
if self.discarded_file_count:
result = tr("%s (%d discarded)") % (result, self.discarded_file_count)
return result
@property
def fileclasses(self):
return self._get_fileclasses()
@property
def SCANNER_CLASS(self):
if self.app_mode == AppMode.PICTURE:
return pe.scanner.ScannerPE
elif self.app_mode == AppMode.MUSIC:
return me.scanner.ScannerME
else:
return se.scanner.ScannerSE
@property
def METADATA_TO_READ(self):
if self.app_mode == AppMode.PICTURE:
return ["size", "mtime", "dimensions", "exif_timestamp"]
elif self.app_mode == AppMode.MUSIC:
return [
"size",
"mtime",
"duration",
"bitrate",
"samplerate",
"title",
"artist",
"album",
"genre",
"year",
"track",
"comment",
]
else:
return ["size", "mtime"]
================================================
FILE: core/directories.py
================================================
# Copyright 2017 Virgil Dupras
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
import os
from xml.etree import ElementTree as ET
import logging
from pathlib import Path
from hscommon.jobprogress import job
from hscommon.util import FileOrPath
from hscommon.trans import tr
from core import fs
__all__ = [
"Directories",
"DirectoryState",
"AlreadyThereError",
"InvalidPathError",
]
class DirectoryState:
"""Enum describing how a folder should be considered.
* DirectoryState.Normal: Scan all files normally
* DirectoryState.Reference: Scan files, but make sure never to delete any of them
* DirectoryState.Excluded: Don't scan this folder
"""
NORMAL = 0
REFERENCE = 1
EXCLUDED = 2
class AlreadyThereError(Exception):
"""The path being added is already in the directory list"""
class InvalidPathError(Exception):
"""The path being added is invalid"""
class Directories:
"""Holds user folder selection.
Manages the selection that the user make through the folder selection dialog. It also manages
folder states, and how recursion applies to them.
Then, when the user starts the scan, :meth:`get_files` is called to retrieve all files (wrapped
in :mod:`core.fs`) that have to be scanned according to the chosen folders/states.
"""
# ---Override
def __init__(self, exclude_list=None):
self._dirs = []
# {path: state}
self.states = {}
self._exclude_list = exclude_list
def __contains__(self, path):
for p in self._dirs:
if path == p or p in path.parents:
return True
return False
def __delitem__(self, key):
self._dirs.__delitem__(key)
def __getitem__(self, key):
return self._dirs.__getitem__(key)
def __len__(self):
return len(self._dirs)
# ---Private
def _default_state_for_path(self, path):
# New logic with regex filters
if self._exclude_list is not None and self._exclude_list.mark_count > 0:
# We iterate even if we only have one item here
for denied_path_re in self._exclude_list.compiled:
if denied_path_re.match(str(path.name)):
return DirectoryState.EXCLUDED
return DirectoryState.NORMAL
# Override this in subclasses to specify the state of some special folders.
if path.name.startswith("."):
return DirectoryState.EXCLUDED
return DirectoryState.NORMAL
def _get_files(self, from_path, fileclasses, j):
try:
with os.scandir(from_path) as iter:
root_path = Path(from_path)
state = self.get_state(root_path)
# if we have no un-excluded dirs under this directory skip going deeper
skip_dirs = state == DirectoryState.EXCLUDED and not any(
p.parts[: len(root_path.parts)] == root_path.parts for p in self.states
)
count = 0
for item in iter:
j.check_if_cancelled()
try:
if item.is_dir():
if skip_dirs:
continue
yield from self._get_files(item.path, fileclasses, j)
continue
elif state == DirectoryState.EXCLUDED:
continue
# File excluding or not
if (
self._exclude_list is None
or not self._exclude_list.mark_count
or not self._exclude_list.is_excluded(str(from_path), item.name)
):
file = fs.get_file(item, fileclasses=fileclasses)
if file:
file.is_ref = state == DirectoryState.REFERENCE
count += 1
yield file
except (OSError, fs.InvalidPath):
pass
logging.debug(
"Collected %d files in folder %s",
count,
str(root_path),
)
except OSError:
pass
def _get_folders(self, from_folder, j):
j.check_if_cancelled()
try:
for subfolder in from_folder.subfolders:
yield from self._get_folders(subfolder, j)
state = self.get_state(from_folder.path)
if state != DirectoryState.EXCLUDED:
from_folder.is_ref = state == DirectoryState.REFERENCE
logging.debug("Yielding Folder %r state: %d", from_folder, state)
yield from_folder
except (OSError, fs.InvalidPath):
pass
# ---Public
def add_path(self, path):
"""Adds ``path`` to self, if not already there.
Raises :exc:`AlreadyThereError` if ``path`` is already in self. If path is a directory
containing some of the directories already present in self, ``path`` will be added, but all
directories under it will be removed. Can also raise :exc:`InvalidPathError` if ``path``
does not exist.
:param Path path: path to add
"""
if path in self:
raise AlreadyThereError()
if not path.exists():
raise InvalidPathError()
self._dirs = [p for p in self._dirs if path not in p.parents]
self._dirs.append(path)
@staticmethod
def get_subfolders(path):
"""Returns a sorted list of paths corresponding to subfolders in ``path``.
:param Path path: get subfolders from there
:rtype: list of Path
"""
try:
subpaths = [p for p in path.glob("*") if p.is_dir()]
subpaths.sort(key=lambda x: x.name.lower())
return subpaths
except OSError:
return []
def get_files(self, fileclasses=None, j=job.nulljob):
"""Returns a list of all files that are not excluded.
Returned files also have their ``is_ref`` attr set if applicable.
"""
if fileclasses is None:
fileclasses = [fs.File]
file_count = 0
for path in self._dirs:
for file in self._get_files(path, fileclasses=fileclasses, j=j):
file_count += 1
if not isinstance(j, job.NullJob):
j.set_progress(-1, tr("Collected {} files to scan").format(file_count))
yield file
def get_folders(self, folderclass=None, j=job.nulljob):
"""Returns a list of all folders that are not excluded.
Returned folders also have their ``is_ref`` attr set if applicable.
"""
if folderclass is None:
folderclass = fs.Folder
folder_count = 0
for path in self._dirs:
from_folder = folderclass(path)
for folder in self._get_folders(from_folder, j):
folder_count += 1
if not isinstance(j, job.NullJob):
j.set_progress(-1, tr("Collected {} folders to scan").format(folder_count))
yield folder
def get_state(self, path):
"""Returns the state of ``path``.
:rtype: :class:`DirectoryState`
"""
# direct match? easy result.
if path in self.states:
return self.states[path]
state = self._default_state_for_path(path)
# Save non-default states in cache, necessary for _get_files()
if state != DirectoryState.NORMAL:
self.states[path] = state
return state
# find the longest parent path that is in states and return that state if found
# NOTE: path.parents is ordered longest to shortest
for parent_path in path.parents:
if parent_path in self.states:
return self.states[parent_path]
return state
def has_any_file(self):
"""Returns whether selected folders contain any file.
Because it stops at the first file it finds, it's much faster than get_files().
:rtype: bool
"""
try:
next(self.get_files())
return True
except StopIteration:
return False
def load_from_file(self, infile):
"""Load folder selection from ``infile``.
:param file infile: path or file pointer to XML generated through :meth:`save_to_file`
"""
try:
root = ET.parse(infile).getroot()
except Exception:
return
for rdn in root.iter("root_directory"):
attrib = rdn.attrib
if "path" not in attrib:
continue
path = attrib["path"]
try:
self.add_path(Path(path))
except (AlreadyThereError, InvalidPathError):
pass
for sn in root.iter("state"):
attrib = sn.attrib
if not ("path" in attrib and "value" in attrib):
continue
path = attrib["path"]
state = attrib["value"]
self.states[Path(path)] = int(state)
def save_to_file(self, outfile):
"""Save folder selection as XML to ``outfile``.
:param file outfile: path or file pointer to XML file to save to.
"""
with FileOrPath(outfile, "wb") as fp:
root = ET.Element("directories")
for root_path in self:
root_path_node = ET.SubElement(root, "root_directory")
root_path_node.set("path", str(root_path))
for path, state in self.states.items():
state_node = ET.SubElement(root, "state")
state_node.set("path", str(path))
state_node.set("value", str(state))
tree = ET.ElementTree(root)
tree.write(fp, encoding="utf-8")
def set_state(self, path, state):
"""Set the state of folder at ``path``.
:param Path path: path of the target folder
:param state: state to set folder to
:type state: :class:`DirectoryState`
"""
if self.get_state(path) == state:
return
for iter_path in list(self.states.keys()):
if path in iter_path.parents:
del self.states[iter_path]
self.states[path] = state
================================================
FILE: core/engine.py
================================================
# Created By: Virgil Dupras
# Created On: 2006/01/29
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
import difflib
import itertools
import logging
import string
from collections import defaultdict, namedtuple
from unicodedata import normalize
from hscommon.util import flatten, multi_replace
from hscommon.trans import tr
from hscommon.jobprogress import job
(
WEIGHT_WORDS,
MATCH_SIMILAR_WORDS,
NO_FIELD_ORDER,
) = range(3)
JOB_REFRESH_RATE = 100
PROGRESS_MESSAGE = tr("%d matches found from %d groups")
def getwords(s):
# We decompose the string so that ascii letters with accents can be part of the word.
s = normalize("NFD", s)
s = multi_replace(s, "-_&+():;\\[]{}.,<>/?~!@#$*", " ").lower()
# logging.debug(f"DEBUG chars for: {s}\n"
# f"{[c for c in s if ord(c) != 32]}\n"
# f"{[ord(c) for c in s if ord(c) != 32]}")
# HACK We shouldn't ignore non-ascii characters altogether. Any Unicode char
# above common european characters that cannot be "sanitized" (ie. stripped
# of their accents, etc.) are preserved as is. The arbitrary limit is
# obtained from this one: ord("\u037e") GREEK QUESTION MARK
s = "".join(
c
for c in s
if (ord(c) <= 894 and c in string.ascii_letters + string.digits + string.whitespace) or ord(c) > 894
)
return [_f for _f in s.split(" ") if _f] # remove empty elements
def getfields(s):
fields = [getwords(field) for field in s.split(" - ")]
return [_f for _f in fields if _f]
def unpack_fields(fields):
result = []
for field in fields:
if isinstance(field, list):
result += field
else:
result.append(field)
return result
def compare(first, second, flags=()):
"""Returns the % of words that match between ``first`` and ``second``
The result is a ``int`` in the range 0..100.
``first`` and ``second`` can be either a string or a list (of words).
"""
if not (first and second):
return 0
if any(isinstance(element, list) for element in first):
return compare_fields(first, second, flags)
second = second[:] # We must use a copy of second because we remove items from it
match_similar = MATCH_SIMILAR_WORDS in flags
weight_words = WEIGHT_WORDS in flags
joined = first + second
total_count = sum(len(word) for word in joined) if weight_words else len(joined)
match_count = 0
in_order = True
for word in first:
if match_similar and (word not in second):
similar = difflib.get_close_matches(word, second, 1, 0.8)
if similar:
word = similar[0]
if word in second:
if second[0] != word:
in_order = False
second.remove(word)
match_count += len(word) if weight_words else 1
result = round(((match_count * 2) / total_count) * 100)
if (result == 100) and (not in_order):
result = 99 # We cannot consider a match exact unless the ordering is the same
return result
def compare_fields(first, second, flags=()):
"""Returns the score for the lowest matching :ref:`fields`.
``first`` and ``second`` must be lists of lists of string. Each sub-list is then compared with
:func:`compare`.
"""
if len(first) != len(second):
return 0
if NO_FIELD_ORDER in flags:
results = []
# We don't want to remove field directly in the list. We must work on a copy.
second = second[:]
for field1 in first:
max_score = 0
matched_field = None
for field2 in second:
r = compare(field1, field2, flags)
if r > max_score:
max_score = r
matched_field = field2
results.append(max_score)
if matched_field:
second.remove(matched_field)
else:
results = [compare(field1, field2, flags) for field1, field2 in zip(first, second)]
return min(results) if results else 0
def build_word_dict(objects, j=job.nulljob):
"""Returns a dict of objects mapped by their words.
objects must have a ``words`` attribute being a list of strings or a list of lists of strings
(:ref:`fields`).
The result will be a dict with words as keys, lists of objects as values.
"""
result = defaultdict(set)
for object in j.iter_with_progress(objects, "Prepared %d/%d files", JOB_REFRESH_RATE):
for word in unpack_fields(object.words):
result[word].add(object)
return result
def merge_similar_words(word_dict):
"""Take all keys in ``word_dict`` that are similar, and merge them together.
``word_dict`` has been built with :func:`build_word_dict`. Similarity is computed with Python's
``difflib.get_close_matches()``, which computes the number of edits that are necessary to make
a word equal to the other.
"""
keys = list(word_dict.keys())
keys.sort(key=len) # we want the shortest word to stay
while keys:
key = keys.pop(0)
similars = difflib.get_close_matches(key, keys, 100, 0.8)
if not similars:
continue
objects = word_dict[key]
for similar in similars:
objects |= word_dict[similar]
del word_dict[similar]
keys.remove(similar)
def reduce_common_words(word_dict, threshold):
"""Remove all objects from ``word_dict`` values where the object count >= ``threshold``
``word_dict`` has been built with :func:`build_word_dict`.
The exception to this removal are the objects where all the words of the object are common.
Because if we remove them, we will miss some duplicates!
"""
uncommon_words = {word for word, objects in word_dict.items() if len(objects) < threshold}
for word, objects in list(word_dict.items()):
if len(objects) < threshold:
continue
reduced = set()
for o in objects:
if not any(w in uncommon_words for w in unpack_fields(o.words)):
reduced.add(o)
if reduced:
word_dict[word] = reduced
else:
del word_dict[word]
# Writing docstrings in a namedtuple is tricky. From Python 3.3, it's possible to set __doc__, but
# some research allowed me to find a more elegant solution, which is what is done here. See
# http://stackoverflow.com/questions/1606436/adding-docstrings-to-namedtuples-in-python
class Match(namedtuple("Match", "first second percentage")):
"""Represents a match between two :class:`~core.fs.File`.
Regarless of the matching method, when two files are determined to match, a Match pair is created,
which holds, of course, the two matched files, but also their match "level".
.. attribute:: first
first file of the pair.
.. attribute:: second
second file of the pair.
.. attribute:: percentage
their match level according to the scan method which found the match. int from 1 to 100. For
exact scan methods, such as Contents scans, this will always be 100.
"""
__slots__ = ()
def get_match(first, second, flags=()):
# it is assumed here that first and second both have a "words" attribute
percentage = compare(first.words, second.words, flags)
return Match(first, second, percentage)
def getmatches(
objects,
min_match_percentage=0,
match_similar_words=False,
weight_words=False,
no_field_order=False,
j=job.nulljob,
):
"""Returns a list of :class:`Match` within ``objects`` after fuzzily matching their words.
:param objects: List of :class:`~core.fs.File` to match.
:param int min_match_percentage: minimum % of words that have to match.
:param bool match_similar_words: make similar words (see :func:`merge_similar_words`) match.
:param bool weight_words: longer words are worth more in match % computations.
:param bool no_field_order: match :ref:`fields` regardless of their order.
:param j: A :ref:`job progress instance <jobs>`.
"""
COMMON_WORD_THRESHOLD = 50
LIMIT = 5000000
j = j.start_subjob(2)
sj = j.start_subjob(2)
for o in objects:
if not hasattr(o, "words"):
o.words = getwords(o.name)
word_dict = build_word_dict(objects, sj)
reduce_common_words(word_dict, COMMON_WORD_THRESHOLD)
if match_similar_words:
merge_similar_words(word_dict)
match_flags = []
if weight_words:
match_flags.append(WEIGHT_WORDS)
if match_similar_words:
match_flags.append(MATCH_SIMILAR_WORDS)
if no_field_order:
match_flags.append(NO_FIELD_ORDER)
j.start_job(len(word_dict), PROGRESS_MESSAGE % (0, 0))
compared = defaultdict(set)
result = []
try:
word_count = 0
# This whole 'popping' thing is there to avoid taking too much memory at the same time.
while word_dict:
items = word_dict.popitem()[1]
while items:
ref = items.pop()
compared_already = compared[ref]
to_compare = items - compared_already
compared_already |= to_compare
for other in to_compare:
m = get_match(ref, other, match_flags)
if m.percentage >= min_match_percentage:
result.append(m)
if len(result) >= LIMIT:
return result
word_count += 1
j.add_progress(desc=PROGRESS_MESSAGE % (len(result), word_count))
except MemoryError:
# This is the place where the memory usage is at its peak during the scan.
# Just continue the process with an incomplete list of matches.
del compared # This should give us enough room to call logging.
logging.warning("Memory Overflow. Matches: %d. Word dict: %d" % (len(result), len(word_dict)))
return result
return result
def getmatches_by_contents(files, bigsize=0, j=job.nulljob):
"""Returns a list of :class:`Match` within ``files`` if their contents is the same.
:param bigsize: The size in bytes over which we consider files big enough to
justify taking samples of the file for hashing. If 0, compute digest as usual.
:param j: A :ref:`job progress instance <jobs>`.
"""
size2files = defaultdict(set)
for f in files:
size2files[f.size].add(f)
del files
possible_matches = [files for files in size2files.values() if len(files) > 1]
del size2files
result = []
j.start_job(len(possible_matches), PROGRESS_MESSAGE % (0, 0))
group_count = 0
for group in possible_matches:
for first, second in itertools.combinations(group, 2):
if first.is_ref and second.is_ref:
continue # Don't spend time comparing two ref pics together.
if first.size == 0 and second.size == 0:
# skip hashing for zero length files
result.append(Match(first, second, 100))
continue
# if digests are the same (and not None) then files match
if first.digest_partial is not None and first.digest_partial == second.digest_partial:
if bigsize > 0 and first.size > bigsize:
if first.digest_samples is not None and first.digest_samples == second.digest_samples:
result.append(Match(first, second, 100))
else:
if first.digest is not None and first.digest == second.digest:
result.append(Match(first, second, 100))
group_count += 1
j.add_progress(desc=PROGRESS_MESSAGE % (len(result), group_count))
return result
class Group:
"""A group of :class:`~core.fs.File` that match together.
This manages match pairs into groups and ensures that all files in the group match to each
other.
.. attribute:: ref
The "reference" file, which is the file among the group that isn't going to be deleted.
.. attribute:: ordered
Ordered list of duplicates in the group (including the :attr:`ref`).
.. attribute:: unordered
Set duplicates in the group (including the :attr:`ref`).
.. attribute:: dupes
An ordered list of the group's duplicate, without :attr:`ref`. Equivalent to
``ordered[1:]``
.. attribute:: percentage
Average match percentage of match pairs containing :attr:`ref`.
"""
# ---Override
def __init__(self):
self._clear()
def __contains__(self, item):
return item in self.unordered
def __getitem__(self, key):
return self.ordered.__getitem__(key)
def __iter__(self):
return iter(self.ordered)
def __len__(self):
return len(self.ordered)
# ---Private
def _clear(self):
self._percentage = None
self._matches_for_ref = None
self.matches = set()
self.candidates = defaultdict(set)
self.ordered = []
self.unordered = set()
def _get_matches_for_ref(self):
if self._matches_for_ref is None:
ref = self.ref
self._matches_for_ref = [match for match in self.matches if ref in match]
return self._matches_for_ref
# ---Public
def add_match(self, match):
"""Adds ``match`` to internal match list and possibly add duplicates to the group.
A duplicate can only be considered as such if it matches all other duplicates in the group.
This method registers that pair (A, B) represented in ``match`` as possible candidates and,
if A and/or B end up matching every other duplicates in the group, add these duplicates to
the group.
:param tuple match: pair of :class:`~core.fs.File` to add
"""
def add_candidate(item, match):
matches = self.candidates[item]
matches.add(match)
if self.unordered <= matches:
self.ordered.append(item)
self.unordered.add(item)
if match in self.matches:
return
self.matches.add(match)
first, second, _ = match
if first not in self.unordered:
add_candidate(first, second)
if second not in self.unordered:
add_candidate(second, first)
self._percentage = None
self._matches_for_ref = None
def discard_matches(self):
"""Remove all recorded matches that didn't result in a duplicate being added to the group.
You can call this after the duplicate scanning process to free a bit of memory.
"""
discarded = {m for m in self.matches if not all(obj in self.unordered for obj in [m.first, m.second])}
self.matches -= discarded
self.candidates = defaultdict(set)
return discarded
def get_match_of(self, item):
"""Returns the match pair between ``item`` and :attr:`ref`."""
if item is self.ref:
return
for m in self._get_matches_for_ref():
if item in m:
return m
def prioritize(self, key_func, tie_breaker=None):
"""Reorders :attr:`ordered` according to ``key_func``.
:param key_func: Key (f(x)) to be used for sorting
:param tie_breaker: function to be used to select the reference position in case the top
duplicates have the same key_func() result.
"""
# tie_breaker(ref, dupe) --> True if dupe should be ref
# Returns True if anything changed during prioritization.
new_order = sorted(self.ordered, key=lambda x: (-x.is_ref, key_func(x)))
changed = new_order != self.ordered
self.ordered = new_order
if tie_breaker is None:
return changed
ref = self.ref
key_value = key_func(ref)
for dupe in self.dupes:
if key_func(dupe) != key_value:
break
if tie_breaker(ref, dupe):
ref = dupe
if ref is not self.ref:
self.switch_ref(ref)
return True
return changed
def remove_dupe(self, item, discard_matches=True):
try:
self.ordered.remove(item)
self.unordered.remove(item)
self._percentage = None
self._matches_for_ref = None
if (len(self) > 1) and any(not getattr(item, "is_ref", False) for item in self):
if discard_matches:
self.matches = {m for m in self.matches if item not in m}
else:
self._clear()
except ValueError:
pass
def switch_ref(self, with_dupe):
"""Make the :attr:`ref` dupe of the group switch position with ``with_dupe``."""
if self.ref.is_ref:
return False
try:
self.ordered.remove(with_dupe)
self.ordered.insert(0, with_dupe)
self._percentage = None
self._matches_for_ref = None
return True
except ValueError:
return False
dupes = property(lambda self: self[1:])
@property
def percentage(self):
if self._percentage is None:
if self.dupes:
matches = self._get_matches_for_ref()
self._percentage = sum(match.percentage for match in matches) // len(matches)
else:
self._percentage = 0
return self._percentage
@property
def ref(self):
if self:
return self[0]
def get_groups(matches):
"""Returns a list of :class:`Group` from ``matches``.
Create groups out of match pairs in the smartest way possible.
"""
matches.sort(key=lambda match: -match.percentage)
dupe2group = {}
groups = []
try:
for match in matches:
first, second, _ = match
first_group = dupe2group.get(first)
second_group = dupe2group.get(second)
if first_group:
if second_group:
if first_group is second_group:
target_group = first_group
else:
continue
else:
target_group = first_group
dupe2group[second] = target_group
else:
if second_group:
target_group = second_group
dupe2group[first] = target_group
else:
target_group = Group()
groups.append(target_group)
dupe2group[first] = target_group
dupe2group[second] = target_group
target_group.add_match(match)
except MemoryError:
del dupe2group
del matches
# should free enough memory to continue
logging.warning(f"Memory Overflow. Groups: {len(groups)}")
# Now that we have a group, we have to discard groups' matches and see if there're any "orphan"
# matches, that is, matches that were candidate in a group but that none of their 2 files were
# accepted in the group. With these orphan groups, it's safe to build additional groups
matched_files = set(flatten(groups))
orphan_matches = []
for group in groups:
orphan_matches += {
m for m in group.discard_matches() if not any(obj in matched_files for obj in [m.first, m.second])
}
if groups and orphan_matches:
groups += get_groups(orphan_matches) # no job, as it isn't supposed to take a long time
return groups
================================================
FILE: core/exclude.py
================================================
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
from core.markable import Markable
from xml.etree import ElementTree as ET
# TODO: perhaps use regex module for better Unicode support? https://pypi.org/project/regex/
# also https://pypi.org/project/re2/
# TODO update the Result list with newly added regexes if possible
import re
from os import sep
import logging
import functools
from hscommon.util import FileOrPath
from hscommon.plat import ISWINDOWS
import time
default_regexes = [
r"^thumbs\.db$", # Obsolete after WindowsXP
r"^desktop\.ini$", # Windows metadata
r"^\.DS_Store$", # MacOS metadata
r"^\.Trash\-.*", # Linux trash directories
r"^\$Recycle\.Bin$", # Windows
r"^\..*", # Hidden files on Unix-like
]
# These are too broad
forbidden_regexes = [r".*", r"\/.*", r".*\/.*", r".*\\\\.*", r".*\..*"]
def timer(func):
@functools.wraps(func)
def wrapper_timer(*args):
start = time.perf_counter_ns()
value = func(*args)
end = time.perf_counter_ns()
print(f"DEBUG: func {func.__name__!r} took {end - start} ns.")
return value
return wrapper_timer
def memoize(func):
func.cache = dict()
@functools.wraps(func)
def _memoize(*args):
if args not in func.cache:
func.cache[args] = func(*args)
return func.cache[args]
return _memoize
class AlreadyThereException(Exception):
"""Expression already in the list"""
def __init__(self, arg="Expression is already in excluded list."):
super().__init__(arg)
class ExcludeList(Markable):
"""A list of lists holding regular expression strings and the compiled re.Pattern"""
# Used to filter out directories and files that we would rather avoid scanning.
# The list() class allows us to preserve item order without too much hassle.
# The downside is we have to compare strings every time we look for an item in the list
# since we use regex strings as keys.
# If _use_union is True, the compiled regexes will be combined into one single
# Pattern instead of separate Patterns which may or may not give better
# performance compared to looping through each Pattern individually.
# ---Override
def __init__(self, union_regex=True):
Markable.__init__(self)
self._use_union = union_regex
# list([str regex, bool iscompilable, re.error exception, Pattern compiled], ...)
self._excluded = []
self._excluded_compiled = set()
self._dirty = True
def __iter__(self):
"""Iterate in order."""
for item in self._excluded:
regex = item[0]
yield self.is_marked(regex), regex
def __contains__(self, item):
return self.has_entry(item)
def __len__(self):
"""Returns the total number of regexes regardless of mark status."""
return len(self._excluded)
def __getitem__(self, key):
"""Returns the list item corresponding to key."""
for item in self._excluded:
if item[0] == key:
return item
raise KeyError(f"Key {key} is not in exclusion list.")
def __setitem__(self, key, value):
# TODO if necessary
pass
def __delitem__(self, key):
# TODO if necessary
pass
def get_compiled(self, key):
"""Returns the (precompiled) Pattern for key"""
return self.__getitem__(key)[3]
def is_markable(self, regex):
return self._is_markable(regex)
def _is_markable(self, regex):
"""Return the cached result of "compilable" property"""
for item in self._excluded:
if item[0] == regex:
return item[1]
return False # should not be necessary, the regex SHOULD be in there
def _did_mark(self, regex):
self._add_compiled(regex)
def _did_unmark(self, regex):
self._remove_compiled(regex)
def _add_compiled(self, regex):
self._dirty = True
if self._use_union:
return
for item in self._excluded:
# FIXME probably faster to just rebuild the set from the compiled instead of comparing strings
if item[0] == regex:
# no need to test if already present since it's a set()
self._excluded_compiled.add(item[3])
break
def _remove_compiled(self, regex):
self._dirty = True
if self._use_union:
return
for item in self._excluded_compiled:
if regex in item.pattern:
self._excluded_compiled.remove(item)
break
# @timer
@memoize
def _do_compile(self, expr):
return re.compile(expr)
# @timer
# @memoize # probably not worth memoizing this one if we memoize the above
def compile_re(self, regex):
compiled = None
try:
compiled = self._do_compile(regex)
except Exception as e:
return False, e, compiled
return True, None, compiled
def error(self, regex):
"""Return the compilation error Exception for regex.
It should have a "msg" attr."""
for item in self._excluded:
if item[0] == regex:
return item[2]
def build_compiled_caches(self, union=False):
if not union:
self._cached_compiled_files = [x for x in self._excluded_compiled if not has_sep(x.pattern)]
self._cached_compiled_paths = [x for x in self._excluded_compiled if has_sep(x.pattern)]
self._dirty = False
return
marked_count = [x for marked, x in self if marked]
# If there is no item, the compiled Pattern will be '' and match everything!
if not marked_count:
self._cached_compiled_union_all = []
self._cached_compiled_union_files = []
self._cached_compiled_union_paths = []
else:
# HACK returned as a tuple to get a free iterator and keep interface
# the same regardless of whether the client asked for union or not
self._cached_compiled_union_all = (re.compile("|".join(marked_count)),)
files_marked = [x for x in marked_count if not has_sep(x)]
if not files_marked:
self._cached_compiled_union_files = tuple()
else:
self._cached_compiled_union_files = (re.compile("|".join(files_marked)),)
paths_marked = [x for x in marked_count if has_sep(x)]
if not paths_marked:
self._cached_compiled_union_paths = tuple()
else:
self._cached_compiled_union_paths = (re.compile("|".join(paths_marked)),)
self._dirty = False
@property
def compiled(self):
"""Should be used by other classes to retrieve the up-to-date list of patterns."""
if self._use_union:
if self._dirty:
self.build_compiled_caches(self._use_union)
return self._cached_compiled_union_all
return self._excluded_compiled
@property
def compiled_files(self):
"""When matching against filenames only, we probably won't be seeing any
directory separator, so we filter out regexes with os.sep in them.
The interface should be expected to be a generator, even if it returns only
one item (one Pattern in the union case)."""
if self._dirty:
self.build_compiled_caches(self._use_union)
return self._cached_compiled_union_files if self._use_union else self._cached_compiled_files
@property
def compiled_paths(self):
"""Returns patterns with only separators in them, for more precise filtering."""
if self._dirty:
self.build_compiled_caches(self._use_union)
return self._cached_compiled_union_paths if self._use_union else self._cached_compiled_paths
# ---Public
def add(self, regex, forced=False):
"""This interface should throw exceptions if there is an error during
regex compilation"""
if self.has_entry(regex):
# This exception should never be ignored
raise AlreadyThereException()
if regex in forbidden_regexes:
raise ValueError("Forbidden (dangerous) expression.")
iscompilable, exception, compiled = self.compile_re(regex)
if not iscompilable and not forced:
# This exception can be ignored, but taken into account
# to avoid adding to compiled set
raise exception
else:
self._do_add(regex, iscompilable, exception, compiled)
def _do_add(self, regex, iscompilable, exception, compiled):
# We need to insert at the top
self._excluded.insert(0, [regex, iscompilable, exception, compiled])
@property
def marked_count(self):
"""Returns the number of marked regexes only."""
return len([x for marked, x in self if marked])
def has_entry(self, regex):
for item in self._excluded:
if regex == item[0]:
return True
return False
def is_excluded(self, dirname, filename):
"""Return True if the file or the absolute path to file is supposed to be
filtered out, False otherwise."""
matched = False
for expr in self.compiled_files:
if expr.fullmatch(filename):
matched = True
break
if not matched:
for expr in self.compiled_paths:
if expr.fullmatch(dirname + sep + filename):
matched = True
break
return matched
def remove(self, regex):
for item in self._excluded:
if item[0] == regex:
self._excluded.remove(item)
self._remove_compiled(regex)
def rename(self, regex, newregex):
if regex == newregex:
return
found = False
was_marked = False
is_compilable = False
for item in self._excluded:
if item[0] == regex:
found = True
was_marked = self.is_marked(regex)
is_compilable, exception, compiled = self.compile_re(newregex)
# We overwrite the found entry
self._excluded[self._excluded.index(item)] = [newregex, is_compilable, exception, compiled]
self._remove_compiled(regex)
break
if not found:
return
if is_compilable:
self._add_compiled(newregex)
if was_marked:
# Not marked by default when added, add it back
self.mark(newregex)
# def change_index(self, regex, new_index):
# """Internal list must be a list, not dict."""
# item = self._excluded.pop(regex)
# self._excluded.insert(new_index, item)
def restore_defaults(self):
for _, regex in self:
if regex not in default_regexes:
self.unmark(regex)
for default_regex in default_regexes:
if not self.has_entry(default_regex):
self.add(default_regex)
self.mark(default_regex)
def load_from_xml(self, infile):
"""Loads the ignore list from a XML created with save_to_xml.
infile can be a file object or a filename.
"""
try:
root = ET.parse(infile).getroot()
except Exception as e:
logging.warning(f"Error while loading {infile}: {e}")
self.restore_defaults()
return e
marked = set()
exclude_elems = (e for e in root if e.tag == "exclude")
for exclude_item in exclude_elems:
regex_string = exclude_item.get("regex")
if not regex_string:
continue
try:
# "forced" avoids compilation exceptions and adds anyway
self.add(regex_string, forced=True)
except AlreadyThereException:
logging.error(
f'Regex "{regex_string}" \
loaded from XML was already present in the list.'
)
continue
if exclude_item.get("marked") == "y":
marked.add(regex_string)
for item in marked:
self.mark(item)
def save_to_xml(self, outfile):
"""Create a XML file that can be used by load_from_xml.
outfile can be a file object or a filename."""
root = ET.Element("exclude_list")
# reversed in order to keep order of entries when reloading from xml later
for item in reversed(self._excluded):
exclude_node = ET.SubElement(root, "exclude")
exclude_node.set("regex", str(item[0]))
exclude_node.set("marked", ("y" if self.is_marked(item[0]) else "n"))
tree = ET.ElementTree(root)
with FileOrPath(outfile, "wb") as fp:
tree.write(fp, encoding="utf-8")
class ExcludeDict(ExcludeList):
"""Exclusion list holding a set of regular expressions as keys, the compiled
Pattern, compilation error and compilable boolean as values."""
# Implemntation around a dictionary instead of a list, which implies
# to keep the index of each string-key as its sub-element and keep it updated
# whenever insert/remove is done.
def __init__(self, union_regex=False):
Markable.__init__(self)
self._use_union = union_regex
# { "regex string":
# {
# "index": int,
# "compilable": bool,
# "error": str,
# "compiled": Pattern or None
# }
# }
self._excluded = {}
self._excluded_compiled = set()
self._dirty = True
def __iter__(self):
"""Iterate in order."""
for regex in ordered_keys(self._excluded):
yield self.is_marked(regex), regex
def __getitem__(self, key):
"""Returns the dict item correponding to key"""
return self._excluded.__getitem__(key)
def get_compiled(self, key):
"""Returns the compiled item for key"""
return self.__getitem__(key).get("compiled")
def is_markable(self, regex):
return self._is_markable(regex)
def _is_markable(self, regex):
"""Return the cached result of "compilable" property"""
exists = self._excluded.get(regex)
if exists:
return exists.get("compilable")
return False
def _add_compiled(self, regex):
self._dirty = True
if self._use_union:
return
try:
self._excluded_compiled.add(self._excluded.get(regex).get("compiled"))
except Exception as e:
logging.error(f"Exception while adding regex {regex} to compiled set: {e}")
return
def is_compilable(self, regex):
"""Returns the cached "compilable" value"""
return self._excluded[regex]["compilable"]
def error(self, regex):
"""Return the compilation error message for regex string"""
return self._excluded.get(regex).get("error")
# ---Public
def _do_add(self, regex, iscompilable, exception, compiled):
# We always insert at the top, so index should be 0
# and other indices should be pushed by one
for value in self._excluded.values():
value["index"] += 1
self._excluded[regex] = {"index": 0, "compilable": iscompilable, "error": exception, "compiled": compiled}
def has_entry(self, regex):
if regex in self._excluded.keys():
return True
return False
def remove(self, regex):
old_value = self._excluded.pop(regex)
# Bring down all indices which where above it
index = old_value["index"]
if index == len(self._excluded) - 1: # we start at 0...
# Old index was at the end, no need to update other indices
self._remove_compiled(regex)
return
for value in self._excluded.values():
if value.get("index") > old_value["index"]:
value["index"] -= 1
self._remove_compiled(regex)
def rename(self, regex, newregex):
if regex == newregex or regex not in self._excluded.keys():
return
was_marked = self.is_marked(regex)
previous = self._excluded.pop(regex)
iscompilable, error, compiled = self.compile_re(newregex)
self._excluded[newregex] = {
"index": previous.get("index"),
"compilable": iscompilable,
"error": error,
"compiled": compiled,
}
self._remove_compiled(regex)
if iscompilable:
self._add_compiled(newregex)
if was_marked:
self.mark(newregex)
def save_to_xml(self, outfile):
"""Create a XML file that can be used by load_from_xml.
outfile can be a file object or a filename.
"""
root = ET.Element("exclude_list")
# reversed in order to keep order of entries when reloading from xml later
reversed_list = []
for key in ordered_keys(self._excluded):
reversed_list.append(key)
for item in reversed(reversed_list):
exclude_node = ET.SubElement(root, "exclude")
exclude_node.set("regex", str(item))
exclude_node.set("marked", ("y" if self.is_marked(item) else "n"))
tree = ET.ElementTree(root)
with FileOrPath(outfile, "wb") as fp:
tree.write(fp, encoding="utf-8")
def ordered_keys(_dict):
"""Returns an iterator over the keys of dictionary sorted by "index" key"""
if not len(_dict):
return
list_of_items = []
for item in _dict.items():
list_of_items.append(item)
list_of_items.sort(key=lambda x: x[1].get("index"))
for item in list_of_items:
yield item[0]
if ISWINDOWS:
def has_sep(regexp):
return "\\" + sep in regexp
else:
def has_sep(regexp):
return sep in regexp
================================================
FILE: core/export.py
================================================
# Created By: Virgil Dupras
# Created On: 2006/09/16
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
import os.path as op
from tempfile import mkdtemp
import csv
# Yes, this is a very low-tech solution, but at least it doesn't have all these annoying dependency
# and resource problems.
MAIN_TEMPLATE = """
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<title>dupeGuru Results</title>
<style type="text/css">
BODY
{
background-color:white;
}
BODY,A,P,UL,TABLE,TR,TD
{
font-family:Tahoma,Arial,sans-serif;
font-size:10pt;
color: #4477AA;
}
TABLE
{
background-color: #225588;
margin-left: auto;
margin-right: auto;
width: 90%;
}
TR
{
background-color: white;
}
TH
{
font-weight: bold;
color: black;
background-color: #C8D6E5;
}
TH TD
{
color:black;
}
TD
{
padding-left: 2pt;
}
TD.rightelem
{
text-align:right;
/*padding-left:0pt;*/
padding-right: 2pt;
width: 17%;
}
TD.indented
{
padding-left: 12pt;
}
H1
{
font-family:"Courier New",monospace;
color:#6699CC;
font-size:18pt;
color:#6da500;
border-color: #70A0CF;
border-width: 1pt;
border-style: solid;
margin-top: 16pt;
margin-left: 5%;
margin-right: 5%;
padding-top: 2pt;
padding-bottom:2pt;
text-align: center;
}
</style>
</head>
<body>
<h1>dupeGuru Results</h1>
<table>
<tr>$colheaders</tr>
$rows
</table>
</body>
</html>
"""
COLHEADERS_TEMPLATE = "<th>{name}</th>"
ROW_TEMPLATE = """
<tr>
<td class="{indented}">{filename}</td>{cells}
</tr>
"""
CELL_TEMPLATE = """<td>{value}</td>"""
def export_to_xhtml(colnames, rows):
# a row is a list of values with the first value being a flag indicating if the row should be indented
if rows:
assert len(rows[0]) == len(colnames) + 1 # + 1 is for the "indented" flag
colheaders = "".join(COLHEADERS_TEMPLATE.format(name=name) for name in colnames)
rendered_rows = []
previous_group_id = None
for row in rows:
# [2:] is to remove the indented flag + filename
if row[0] != previous_group_id:
# We've just changed dupe group, which means that this dupe is a ref. We don't indent it.
indented = ""
else:
indented = "indented"
filename = row[1]
cells = "".join(CELL_TEMPLATE.format(value=value) for value in row[2:])
rendered_rows.append(ROW_TEMPLATE.format(indented=indented, filename=filename, cells=cells))
previous_group_id = row[0]
rendered_rows = "".join(rendered_rows)
# The main template can't use format because the css code uses {}
content = MAIN_TEMPLATE.replace("$colheaders", colheaders).replace("$rows", rendered_rows)
folder = mkdtemp()
destpath = op.join(folder, "export.htm")
fp = open(destpath, "wt", encoding="utf-8")
fp.write(content)
fp.close()
return destpath
def export_to_csv(dest, colnames, rows):
writer = csv.writer(open(dest, "wt", encoding="utf-8"))
writer.writerow(["Group ID"] + colnames)
for row in rows:
writer.writerow(row)
================================================
FILE: core/fs.py
================================================
# Created By: Virgil Dupras
# Created On: 2009-10-22
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
# This is a fork from hsfs. The reason for this fork is that hsfs has been designed for musicGuru
# and was re-used for dupeGuru. The problem is that hsfs is way over-engineered for dupeGuru,
# resulting needless complexity and memory usage. It's been a while since I wanted to do that fork,
# and I'm doing it now.
import os
from math import floor
import logging
import sqlite3
from sys import platform
from threading import Lock
from typing import Any, AnyStr, Union, Callable
from pathlib import Path
from hscommon.util import nonone, get_file_ext
hasher: Callable
try:
import xxhash
hasher = xxhash.xxh128
except ImportError:
import hashlib
hasher = hashlib.md5
__all__ = [
"File",
"Folder",
"get_file",
"get_files",
"FSError",
"AlreadyExistsError",
"InvalidPath",
"InvalidDestinationError",
"OperationError",
]
NOT_SET = object()
# The goal here is to not run out of memory on really big files. However, the chunk
# size has to be large enough so that the python loop isn't too costly in terms of
# CPU.
CHUNK_SIZE = 1024 * 1024 # 1 MiB
# Minimum size below which partial hashing is not used
MIN_FILE_SIZE = 3 * CHUNK_SIZE # 3MiB, because we take 3 samples
# Partial hashing offset and size
PARTIAL_OFFSET_SIZE = (0x4000, 0x4000)
class FSError(Exception):
cls_message = "An error has occured on '{name}' in '{parent}'"
def __init__(self, fsobject, parent=None):
message = self.cls_message
if isinstance(fsobject, str):
name = fsobject
elif isinstance(fsobject, File):
name = fsobject.name
else:
name = ""
parentname = str(parent) if parent is not None else ""
Exception.__init__(self, message.format(name=name, parent=parentname))
class AlreadyExistsError(FSError):
"The directory or file name we're trying to add already exists"
cls_message = "'{name}' already exists in '{parent}'"
class InvalidPath(FSError):
"The path of self is invalid, and cannot be worked with."
cls_message = "'{name}' is invalid."
class InvalidDestinationError(FSError):
"""A copy/move operation has been called, but the destination is invalid."""
cls_message = "'{name}' is an invalid destination for this operation."
class OperationError(FSError):
"""A copy/move/delete operation has been called, but the checkup after the
operation shows that it didn't work."""
cls_message = "Operation on '{name}' failed."
class FilesDB:
schema_version = 1
schema_version_description = "Changed from md5 to xxhash if available."
create_table_query = """CREATE TABLE IF NOT EXISTS files (path TEXT PRIMARY KEY, size INTEGER, mtime_ns INTEGER,
entry_dt DATETIME, digest BLOB, digest_partial BLOB, digest_samples BLOB)"""
drop_table_query = "DROP TABLE IF EXISTS files;"
select_query = "SELECT {key} FROM files WHERE path=:path AND size=:size and mtime_ns=:mtime_ns"
select_query_ignore_mtime = "SELECT {key} FROM files WHERE path=:path AND size=:size"
insert_query = """
INSERT INTO files (path, size, mtime_ns, entry_dt, {key})
VALUES (:path, :size, :mtime_ns, datetime('now'), :value)
ON CONFLICT(path) DO UPDATE SET size=:size, mtime_ns=:mtime_ns, entry_dt=datetime('now'), {key}=:value;
"""
ignore_mtime = False
def __init__(self):
self.conn = None
self.lock = None
def connect(self, path: Union[AnyStr, os.PathLike]) -> None:
if platform.startswith("gnu0"):
self.conn = sqlite3.connect(path, check_same_thread=False, isolation_level=None)
else:
self.conn = sqlite3.connect(path, check_same_thread=False)
self.lock = Lock()
self._check_upgrade()
def _check_upgrade(self) -> None:
with self.lock, self.conn as conn:
has_schema = conn.execute(
"SELECT NAME FROM sqlite_master WHERE type='table' AND name='schema_version'"
).fetchall()
version = None
if has_schema:
version = conn.execute("SELECT version FROM schema_version ORDER BY version DESC").fetchone()[0]
else:
conn.execute("CREATE TABLE schema_version (version int PRIMARY KEY, description TEXT)")
if version != self.schema_version:
conn.execute(self.drop_table_query)
conn.execute(
"INSERT OR REPLACE INTO schema_version VALUES (:version, :description)",
{"version": self.schema_version, "description": self.schema_version_description},
)
conn.execute(self.create_table_query)
def clear(self) -> None:
with self.lock, self.conn as conn:
conn.execute(self.drop_table_query)
conn.execute(self.create_table_query)
def get(self, path: Path, key: str) -> Union[bytes, None]:
stat = path.stat()
size = stat.st_size
mtime_ns = stat.st_mtime_ns
try:
with self.conn as conn:
if self.ignore_mtime:
cursor = conn.execute(
self.select_query_ignore_mtime.format(key=key), {"path": str(path), "size": size}
)
else:
cursor = conn.execute(
self.select_query.format(key=key),
{"path": str(path), "size": size, "mtime_ns": mtime_ns},
)
result = cursor.fetchone()
cursor.close()
if result:
return result[0]
except Exception as ex:
logging.warning(f"Couldn't get {key} for {path} w/{size}, {mtime_ns}: {ex}")
return None
def put(self, path: Path, key: str, value: Any) -> None:
stat = path.stat()
size = stat.st_size
mtime_ns = stat.st_mtime_ns
try:
with self.lock, self.conn as conn:
conn.execute(
self.insert_query.format(key=key),
{"path": str(path), "size": size, "mtime_ns": mtime_ns, "value": value},
)
except Exception as ex:
logging.warning(f"Couldn't put {key} for {path} w/{size}, {mtime_ns}: {ex}")
def commit(self) -> None:
with self.lock:
self.conn.commit()
def close(self) -> None:
with self.lock:
self.conn.close()
filesdb = FilesDB() # Singleton
class File:
"""Represents a file and holds metadata to be used for scanning."""
INITIAL_INFO = {"size": 0, "mtime": 0, "digest": b"", "digest_partial": b"", "digest_samples": b""}
# Slots for File make us save quite a bit of memory. In a memory test I've made with a lot of
# files, I saved 35% memory usage with "unread" files (no _read_info() call) and gains become
# even greater when we take into account read attributes (70%!). Yeah, it's worth it.
__slots__ = ("path", "unicode_path", "is_ref", "words") + tuple(INITIAL_INFO.keys())
def __init__(self, path):
for attrname in self.INITIAL_INFO:
setattr(self, attrname, NOT_SET)
if type(path) is os.DirEntry:
self.path = Path(path.path)
self.size = nonone(path.stat().st_size, 0)
self.mtime = nonone(path.stat().st_mtime, 0)
else:
self.path = path
if self.path:
self.unicode_path = str(self.path)
def __repr__(self):
return f"<{self.__class__.__name__} {str(self.path)}>"
def __getattribute__(self, attrname):
result = object.__getattribute__(self, attrname)
if result is NOT_SET:
try:
self._read_info(attrname)
except Exception as e:
logging.warning("An error '%s' was raised while decoding '%s'", e, repr(self.path))
result = object.__getattribute__(self, attrname)
if result is NOT_SET:
result = self.INITIAL_INFO[attrname]
return result
def _calc_digest(self):
# type: () -> bytes
with self.path.open("rb") as fp:
file_hash = hasher()
# The goal here is to not run out of memory on really big files. However, the chunk
# size has to be large enough so that the python loop isn't too costly in terms of
# CPU.
CHUNK_SIZE = 1024 * 1024 # 1 mb
filedata = fp.read(CHUNK_SIZE)
while filedata:
file_hash.update(filedata)
filedata = fp.read(CHUNK_SIZE)
return file_hash.digest()
def _calc_digest_partial(self):
# type: () -> bytes
with self.path.open("rb") as fp:
fp.seek(PARTIAL_OFFSET_SIZE[0])
partial_data = fp.read(PARTIAL_OFFSET_SIZE[1])
return hasher(partial_data).digest()
def _calc_digest_samples(self) -> bytes:
size = self.size
with self.path.open("rb") as fp:
# Chunk at 25% of the file
fp.seek(floor(size * 25 / 100), 0)
file_data = fp.read(CHUNK_SIZE)
file_hash = hasher(file_data)
# Chunk at 60% of the file
fp.seek(floor(size * 60 / 100), 0)
file_data = fp.read(CHUNK_SIZE)
file_hash.update(file_data)
# Last chunk of the file
fp.seek(-CHUNK_SIZE, 2)
file_data = fp.read(CHUNK_SIZE)
file_hash.update(file_data)
return file_hash.digest()
def _read_info(self, field):
# print(f"_read_info({field}) for {self}")
if field in ("size", "mtime"):
stats = self.path.stat()
self.size = nonone(stats.st_size, 0)
self.mtime = nonone(stats.st_mtime, 0)
elif field == "digest_partial":
self.digest_partial = filesdb.get(self.path, "digest_partial")
if self.digest_partial is None:
# If file is smaller than partial requirements just use the full digest
if self.size < PARTIAL_OFFSET_SIZE[0] + PARTIAL_OFFSET_SIZE[1]:
self.digest_partial = self.digest
else:
self.digest_partial = self._calc_digest_partial()
filesdb.put(self.path, "digest_partial", self.digest_partial)
elif field == "digest":
self.digest = filesdb.get(self.path, "digest")
if self.digest is None:
self.digest = self._calc_digest()
filesdb.put(self.path, "digest", self.digest)
elif field == "digest_samples":
size = self.size
# Might as well hash such small files entirely.
if size <= MIN_FILE_SIZE:
self.digest_samples = self.digest
return
self.digest_samples = filesdb.get(self.path, "digest_samples")
if self.digest_samples is None:
self.digest_samples = self._calc_digest_samples()
filesdb.put(self.path, "digest_samples", self.digest_samples)
def _read_all_info(self, attrnames=None):
"""Cache all possible info.
If `attrnames` is not None, caches only attrnames.
"""
if attrnames is None:
attrnames = self.INITIAL_INFO.keys()
for attrname in attrnames:
getattr(self, attrname)
# --- Public
@classmethod
def can_handle(cls, path):
"""Returns whether this file wrapper class can handle ``path``."""
return not path.is_symlink() and path.is_file()
def exists(self) -> bool:
"""Safely check if the underlying file exists, treat error as non-existent"""
try:
return self.path.exists()
except OSError as ex:
logging.warning(f"Checking {self.path} raised: {ex}")
return False
def rename(self, newname):
if newname == self.name:
return
destpath = self.path.parent.joinpath(newname)
if destpath.exists():
raise AlreadyExistsError(newname, self.path.parent)
try:
self.path.rename(destpath)
except OSError:
raise OperationError(self)
if not destpath.exists():
raise OperationError(self)
self.path = destpath
def get_display_info(self, group, delta):
"""Returns a display-ready dict of dupe's data."""
raise NotImplementedError()
# --- Properties
@property
def extension(self):
return get_file_ext(self.name)
@property
def name(self):
return self.path.name
@property
def folder_path(self):
return self.path.parent
class Folder(File):
"""A wrapper around a folder path.
It has the size/digest info of a File, but its value is the sum of its subitems.
"""
__slots__ = File.__slots__ + ("_subfolders",)
def __init__(self, path):
File.__init__(self, path)
self.size = NOT_SET
self._subfolders = None
def _all_items(self):
folders = self.subfolders
files = get_files(self.path)
return folders + files
def _read_info(self, field):
# print(f"_read_info({field}) for Folder {self}")
if field in {"size", "mtime"}:
size = sum((f.size for f in self._all_items()), 0)
self.size = size
stats = self.path.stat()
self.mtime = nonone(stats.st_mtime, 0)
elif field in {"digest", "digest_partial", "digest_samples"}:
# What's sensitive here is that we must make sure that subfiles'
# digest are always added up in the same order, but we also want a
# different digest if a file gets moved in a different subdirectory.
def get_dir_digest_concat():
items = self._all_items()
items.sort(key=lambda f: f.path)
digests = [getattr(f, field) for f in items]
return b"".join(digests)
digest = hasher(get_dir_digest_concat()).digest()
setattr(self, field, digest)
@property
def subfolders(self):
if self._subfolders is None:
with os.scandir(self.path) as iter:
subfolders = [p for p in iter if not p.is_symlink() and p.is_dir()]
self._subfolders = [self.__class__(p) for p in subfolders]
return self._subfolders
@classmethod
def can_handle(cls, path):
return not path.is_symlink() and path.is_dir()
def get_file(path, fileclasses=[File]):
"""Wraps ``path`` around its appropriate :class:`File` class.
Whether a class is "appropriate" is decided by :meth:`File.can_handle`
:param Path path: path to wrap
:param fileclasses: List of candidate :class:`File` classes
"""
for fileclass in fileclasses:
if fileclass.can_handle(path):
return fileclass(path)
def get_files(path, fileclasses=[File]):
"""Returns a list of :class:`File` for each file contained in ``path``.
:param Path path: path to scan
:param fileclasses: List of candidate :class:`File` classes
"""
assert all(issubclass(fileclass, File) for fileclass in fileclasses)
try:
result = []
with os.scandir(path) as iter:
for item in iter:
file = get_file(item, fileclasses=fileclasses)
if file is not None:
result.append(file)
return result
except OSError:
raise InvalidPath(path)
================================================
FILE: core/gui/__init__.py
================================================
"""
Meta GUI elements in dupeGuru
-----------------------------
dupeGuru is designed with a `cross-toolkit`_ approach in mind. It means that its core code
(which doesn't depend on any GUI toolkit) has elements which preformat core information in a way
that makes it easy for a UI layer to consume.
For example, we have :class:`~core.gui.ResultTable` which takes information from
:class:`~core.results.Results` and mashes it in rows and columns which are ready to be fetched by
either Cocoa's ``NSTableView`` or Qt's ``QTableView``. It tells them which cell is supposed to be
blue, which is supposed to be orange, does the sorting logic, holds selection, etc..
.. _cross-toolkit: http://www.hardcoded.net/articles/cross-toolkit-software
"""
================================================
FILE: core/gui/base.py
================================================
# Created By: Virgil Dupras
# Created On: 2010-02-06
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
from hscommon.notify import Listener
class DupeGuruGUIObject(Listener):
def __init__(self, app):
Listener.__init__(self, app)
self.app = app
def directories_changed(self):
# Implemented in child classes
pass
def dupes_selected(self):
# Implemented in child classes
pass
def marking_changed(self):
# Implemented in child classes
pass
def results_changed(self):
# Implemented in child classes
pass
def results_changed_but_keep_selection(self):
# Implemented in child classes
pass
================================================
FILE: core/gui/deletion_options.py
================================================
# Created On: 2012-05-30
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
import os
from hscommon.gui.base import GUIObject
from hscommon.trans import tr
class DeletionOptionsView:
"""Expected interface for :class:`DeletionOptions`'s view.
*Not actually used in the code. For documentation purposes only.*
Our view presents the user with an appropriate way (probably a mix of checkboxes and radio
buttons) to set the different flags in :class:`DeletionOptions`. Note that
:attr:`DeletionOptions.use_hardlinks` is only relevant if :attr:`DeletionOptions.link_deleted`
is true. This is why we toggle the "enabled" state of that flag.
We expect the view to set :attr:`DeletionOptions.link_deleted` immediately as the user changes
its value because it will toggle :meth:`set_hardlink_option_enabled`
Other than the flags, there's also a prompt message which has a dynamic content, defined by
:meth:`update_msg`.
"""
def update_msg(self, msg: str):
"""Update the dialog's prompt with ``str``."""
def show(self):
"""Show the dialog in a modal fashion.
Returns whether the dialog was "accepted" (the user pressed OK).
"""
def set_hardlink_option_enabled(self, is_enabled: bool):
"""Enable or disable the widget controlling :attr:`DeletionOptions.use_hardlinks`."""
class DeletionOptions(GUIObject):
"""Present the user with deletion options before proceeding.
When the user activates "Send to trash", we present him with a couple of options that changes
the behavior of that deletion operation.
"""
def __init__(self):
GUIObject.__init__(self)
#: Whether symlinks or hardlinks are used when doing :attr:`link_deleted`.
#: *bool*. *get/set*
self.use_hardlinks = False
#: Delete dupes directly and don't send to trash.
#: *bool*. *get/set*
self.direct = False
def show(self, mark_count):
"""Prompt the user with a modal dialog offering our deletion options.
:param int mark_count: Number of dupes marked for deletion.
:rtype: bool
:returns: Whether the user accepted the dialog (we cancel deletion if false).
"""
self._link_deleted = False
self.view.set_hardlink_option_enabled(False)
self.use_hardlinks = False
self.direct = False
msg = tr("You are sending {} file(s) to the Trash.").format(mark_count)
self.view.update_msg(msg)
return self.view.show()
def supports_links(self):
"""Returns whether our platform supports symlinks."""
# When on a platform that doesn't implement it, calling os.symlink() (with the wrong number
# of arguments) raises NotImplementedError, which allows us to gracefully check for the
# feature.
try:
os.symlink()
except NotImplementedError:
# Windows XP, not supported
return False
except OSError:
# Vista+, symbolic link privilege not held
return False
except TypeError:
# wrong number of arguments
return True
@property
def link_deleted(self):
"""Replace deleted dupes with symlinks (or hardlinks) to the dupe group reference.
*bool*. *get/set*
Whether the link is a symlink or hardlink is decided by :attr:`use_hardlinks`.
"""
return self._link_deleted
@link_deleted.setter
def link_deleted(self, value):
self._link_deleted = value
hardlinks_enabled = value and self.supports_links()
self.view.set_hardlink_option_enabled(hardlinks_enabled)
================================================
FILE: core/gui/details_panel.py
================================================
# Created By: Virgil Dupras
# Created On: 2010-02-05
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
from hscommon.gui.base import GUIObject
from core.gui.base import DupeGuruGUIObject
class DetailsPanel(GUIObject, DupeGuruGUIObject):
def __init__(self, app):
GUIObject.__init__(self, multibind=True)
DupeGuruGUIObject.__init__(self, app)
self._table = []
def _view_updated(self):
self._refresh()
self.view.refresh()
# --- Private
def _refresh(self):
if self.app.selected_dupes:
dupe = self.app.selected_dupes[0]
group = self.app.results.get_group_of_duplicate(dupe)
else:
dupe = None
group = None
data1 = self.app.get_display_info(dupe, group, False)
# we don't want the two sides of the table to display the stats for the same file
ref = group.ref if group is not None and group.ref is not dupe else None
data2 = self.app.get_display_info(ref, group, False)
columns = self.app.result_table.COLUMNS[1:] # first column is the 'marked' column
self._table = [(c.display, data1[c.name], data2[c.name]) for c in columns]
# --- Public
def row_count(self):
return len(self._table)
def row(self, row_index):
return self._table[row_index]
# --- Event Handlers
def dupes_selected(self):
self._view_updated()
================================================
FILE: core/gui/directory_tree.py
================================================
# Created By: Virgil Dupras
# Created On: 2010-02-06
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
from hscommon.gui.tree import Tree, Node
from core.directories import DirectoryState
from core.gui.base import DupeGuruGUIObject
STATE_ORDER = [DirectoryState.NORMAL, DirectoryState.REFERENCE, DirectoryState.EXCLUDED]
# Lazily loads children
class DirectoryNode(Node):
def __init__(self, tree, path, name):
Node.__init__(self, name)
self._tree = tree
self._directory_path = path
self._loaded = False
self._state = STATE_ORDER.index(self._tree.app.directories.get_state(path))
def __len__(self):
if not self._loaded:
self._load()
return Node.__len__(self)
def _load(self):
self.clear()
subpaths = self._tree.app.directories.get_subfolders(self._directory_path)
for path in subpaths:
self.append(DirectoryNode(self._tree, path, path.name))
self._loaded = True
def update_all_states(self):
self._state = STATE_ORDER.index(self._tree.app.directories.get_state(self._directory_path))
for node in self:
node.update_all_states()
# The state propery is an index to the combobox
@property
def state(self):
return self._state
@state.setter
def state(self, value):
if value == self._state:
return
self._state = value
state = STATE_ORDER[value]
self._tree.app.directories.set_state(self._directory_path, state)
self._tree.update_all_states()
class DirectoryTree(Tree, DupeGuruGUIObject):
# --- model -> view calls:
# refresh()
# refresh_states() # when only states label need to be refreshed
#
def __init__(self, app):
Tree.__init__(self)
DupeGuruGUIObject.__init__(self, app)
def _view_updated(self):
self._refresh()
self.view.refresh()
def _refresh(self):
self.clear()
for path in self.app.directories:
self.append(DirectoryNode(self, path, str(path)))
def add_directory(self, path):
self.app.add_directory(path)
def remove_selected(self):
selected_paths = self.selected_paths
if not selected_paths:
return
to_delete = [path[0] for path in selected_paths if len(path) == 1]
if to_delete:
self.app.remove_directories(to_delete)
else:
# All selected nodes or on second-or-more level, exclude them.
nodes = self.selected_nodes
newstate = DirectoryState.EXCLUDED
if all(node.state == DirectoryState.EXCLUDED for node in nodes):
newstate = DirectoryState.NORMAL
for node in nodes:
node.state = newstate
def select_all(self):
self.selected_nodes = list(self)
self.view.refresh()
def update_all_states(self):
for node in self:
node.update_all_states()
self.view.refresh_states()
# --- Event Handlers
def directories_changed(self):
self._view_updated()
================================================
FILE: core/gui/exclude_list_dialog.py
================================================
# Created On: 2012/03/13
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
from core.gui.exclude_list_table import ExcludeListTable
from core.exclude import has_sep
from os import sep
import logging
class ExcludeListDialogCore:
def __init__(self, app):
self.app = app
self.exclude_list = self.app.exclude_list # Markable from exclude.py
self.exclude_list_table = ExcludeListTable(self, app) # GUITable, this is the "model"
def restore_defaults(self):
self.exclude_list.restore_defaults()
self.refresh()
def refresh(self):
self.exclude_list_table.refresh()
def remove_selected(self):
for row in self.exclude_list_table.selected_rows:
self.exclude_list_table.remove(row)
self.exclude_list.remove(row.regex)
self.refresh()
def rename_selected(self, newregex):
"""Rename the selected regex to ``newregex``.
If there is more than one selected row, the first one is used.
:param str newregex: The regex to rename the row's regex to.
:return bool: true if success, false if error.
"""
try:
r = self.exclude_list_table.selected_rows[0]
self.exclude_list.rename(r.regex, newregex)
self.refresh()
return True
except Exception as e:
logging.warning(f"Error while renaming regex to {newregex}: {e}")
return False
def add(self, regex):
self.exclude_list.add(regex)
self.exclude_list.mark(regex)
self.exclude_list_table.add(regex)
def test_string(self, test_string):
"""Set the highlight property on each row when its regex matches the
test_string supplied. Return True if any row matched."""
matched = False
for row in self.exclude_list_table.rows:
compiled_regex = self.exclude_list.get_compiled(row.regex)
if self.is_match(test_string, compiled_regex):
row.highlight = True
matched = True
else:
row.highlight = False
return matched
def is_match(self, test_string, compiled_regex):
# This method is like an inverted version of ExcludeList.is_excluded()
if not compiled_regex:
return False
matched = False
# Test only the filename portion of the path
if not has_sep(compiled_regex.pattern) and sep in test_string:
filename = test_string.rsplit(sep, 1)[1]
if compiled_regex.fullmatch(filename):
matched = True
return matched
# Test the entire path + filename
if compiled_regex.fullmatch(test_string):
matched = True
return matched
def reset_rows_highlight(self):
for row in self.exclude_list_table.rows:
row.highlight = False
def show(self):
self.view.show()
================================================
FILE: core/gui/exclude_list_table.py
================================================
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
from core.gui.base import DupeGuruGUIObject
from hscommon.gui.table import GUITable, Row
from hscommon.gui.column import Column, Columns
from hscommon.trans import trget
tr = trget("ui")
class ExcludeListTable(GUITable, DupeGuruGUIObject):
COLUMNS = [Column("marked", ""), Column("regex", tr("Regular Expressions"))]
def __init__(self, exclude_list_dialog, app):
GUITable.__init__(self)
DupeGuruGUIObject.__init__(self, app)
self._columns = Columns(self)
self.dialog = exclude_list_dialog
def rename_selected(self, newname):
row = self.selected_row
if row is None:
return False
row._data = None
return self.dialog.rename_selected(newname)
# --- Virtual
def _do_add(self, regex):
"""(Virtual) Creates a new row, adds it in the table.
Returns ``(row, insert_index)``."""
# Return index 0 to insert at the top
return ExcludeListRow(self, self.dialog.exclude_list.is_marked(regex), regex), 0
def _do_delete(self):
self.dialog.exclude_list.remove(self.selected_row.regex)
# --- Override
def add(self, regex):
row, insert_index = self._do_add(regex)
self.insert(insert_index, row)
self.view.refresh()
def _fill(self):
for enabled, regex in self.dialog.exclude_list:
self.append(ExcludeListRow(self, enabled, regex))
def refresh(self, refresh_view=True):
"""Override to avoid keeping previous selection in case of multiple rows
selected previously."""
self.cancel_edits()
del self[:]
self._fill()
if refresh_view:
self.view.refresh()
class ExcludeListRow(Row):
def __init__(self, table, enabled, regex):
Row.__init__(self, table)
self._app = table.app
self._data = None
self.enabled = str(enabled)
self.regex = str(regex)
self.highlight = False
@property
def data(self):
if self._data is None:
self._data = {"marked": self.enabled, "regex": self.regex}
return self._data
@property
def markable(self):
return self._app.exclude_list.is_markable(self.regex)
@property
def marked(self):
return self._app.exclude_list.is_marked(self.regex)
@marked.setter
def marked(self, value):
if value:
self._app.exclude_list.mark(self.regex)
else:
self._app.exclude_list.unmark(self.regex)
@property
def error(self):
# This assumes error() returns an Exception()
message = self._app.exclude_list.error(self.regex)
if hasattr(message, "msg"):
return self._app.exclude_list.error(self.regex).msg
else:
return message # Exception object
================================================
FILE: core/gui/ignore_list_dialog.py
================================================
# Created On: 2012/03/13
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
from hscommon.trans import tr
from core.gui.ignore_list_table import IgnoreListTable
class IgnoreListDialog:
# --- View interface
# show()
#
def __init__(self, app):
self.app = app
self.ignore_list = self.app.ignore_list
self.ignore_list_table = IgnoreListTable(self) # GUITable
def clear(self):
if not self.ignore_list:
return
msg = tr("Do you really want to remove all %d items from the ignore list?") % len(self.ignore_list)
if self.app.view.ask_yes_no(msg):
self.ignore_list.clear()
self.refresh()
def refresh(self):
self.ignore_list_table.refresh()
def remove_selected(self):
for row in self.ignore_list_table.selected_rows:
self.ignore_list.remove(row.path1_original, row.path2_original)
self.refresh()
def show(self):
self.view.show()
================================================
FILE: core/gui/ignore_list_table.py
================================================
# Created By: Virgil Dupras
# Created On: 2012-03-13
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
from hscommon.gui.table import GUITable, Row
from hscommon.gui.column import Column, Columns
from hscommon.trans import trget
coltr = trget("columns")
class IgnoreListTable(GUITable):
COLUMNS = [
# the str concat below saves us needless localization.
Column("path1", coltr("File Path") + " 1"),
Column("path2", coltr("File Path") + " 2"),
]
def __init__(self, ignore_list_dialog):
GUITable.__init__(self)
self._columns = Columns(self)
self.view = None
self.dialog = ignore_list_dialog
# --- Override
def _fill(self):
for path1, path2 in self.dialog.ignore_list:
self.append(IgnoreListRow(self, path1, path2))
class IgnoreListRow(Row):
def __init__(self, table, path1, path2):
Row.__init__(self, table)
self.path1_original = path1
self.path2_original = path2
self.path1 = str(path1)
self.path2 = str(path2)
================================================
FILE: core/gui/prioritize_dialog.py
================================================
# Created By: Virgil Dupras
# Created On: 2011-09-06
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
from hscommon.gui.base import GUIObject
from hscommon.gui.selectable_list import GUISelectableList
class CriterionCategoryList(GUISelectableList):
def __init__(self, dialog):
self.dialog = dialog
GUISelectableList.__init__(self, [c.NAME for c in dialog.categories])
def _update_selection(self):
self.dialog.select_category(self.dialog.categories[self.selected_index])
GUISelectableList._update_selection(self)
class PrioritizationList(GUISelectableList):
def __init__(self, dialog):
self.dialog = dialog
GUISelectableList.__init__(self)
def _refresh_contents(self):
self[:] = [crit.display for crit in self.dialog.prioritizations]
def move_indexes(self, indexes, dest_index):
indexes.sort()
prilist = self.dialog.prioritizations
selected = [prilist[i] for i in indexes]
for i in reversed(indexes):
del prilist[i]
prilist[dest_index:dest_index] = selected
self._refresh_contents()
def remove_selected(self):
prilist = self.dialog.prioritizations
for i in sorted(self.selected_indexes, reverse=True):
del prilist[i]
self._refresh_contents()
class PrioritizeDialog(GUIObject):
def __init__(self, app):
GUIObject.__init__(self)
self.app = app
self.categories = [cat(app.results) for cat in app._prioritization_categories()]
self.category_list = CriterionCategoryList(self)
self.criteria = []
self.criteria_list = GUISelectableList()
self.prioritizations = []
self.prioritization_list = PrioritizationList(self)
# --- Override
def _view_updated(self):
self.category_list.select(0)
# --- Private
def _sort_key(self, dupe):
return tuple(crit.sort_key(dupe) for crit in self.prioritizations)
# --- Public
def select_category(self, category):
self.criteria = category.criteria_list()
self.criteria_list[:] = [c.display_value for c in self.criteria]
def add_selected(self):
# Add selected criteria in criteria_list to prioritization_list.
if self.criteria_list.selected_index is None:
return
for i in self.criteria_list.selected_indexes:
crit = self.criteria[i]
self.prioritizations.append(crit)
del crit
self.prioritization_list[:] = [crit.display for crit in self.prioritizations]
def remove_selected(self):
self.prioritization_list.remove_selected()
self.prioritization_list.select([])
def perform_reprioritization(self):
self.app.reprioritize_groups(self._sort_key)
================================================
FILE: core/gui/problem_dialog.py
================================================
# Created By: Virgil Dupras
# Created On: 2010-04-12
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
from hscommon import desktop
from core.gui.problem_table import ProblemTable
class ProblemDialog:
def __init__(self, app):
self.app = app
self._selected_dupe = None
self.problem_table = ProblemTable(self)
def refresh(self):
self._selected_dupe = None
self.problem_table.refresh()
def reveal_selected_dupe(self):
if self._selected_dupe is not None:
desktop.reveal_path(self._selected_dupe.path)
def select_dupe(self, dupe):
self._selected_dupe = dupe
================================================
FILE: core/gui/problem_table.py
================================================
# Created By: Virgil Dupras
# Created On: 2010-04-12
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
from hscommon.gui.table import GUITable, Row
from hscommon.gui.column import Column, Columns
from hscommon.trans import trget
coltr = trget("columns")
class ProblemTable(GUITable):
COLUMNS = [
Column("path", coltr("File Path")),
Column("msg", coltr("Error Message")),
]
def __init__(self, problem_dialog):
GUITable.__init__(self)
self._columns = Columns(self)
self.dialog = problem_dialog
# --- Override
def _update_selection(self):
row = self.selected_row
dupe = row.dupe if row is not None else None
self.dialog.select_dupe(dupe)
def _fill(self):
problems = self.dialog.app.results.problems
for dupe, msg in problems:
self.append(ProblemRow(self, dupe, msg))
class ProblemRow(Row):
def __init__(self, table, dupe, msg):
Row.__init__(self, table)
self.dupe = dupe
self.msg = msg
self.path = str(dupe.path)
================================================
FILE: core/gui/result_table.py
================================================
# Created By: Virgil Dupras
# Created On: 2010-02-11
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
from operator import attrgetter
from hscommon.gui.table import GUITable, Row
from hscommon.gui.column import Columns
from core.gui.base import DupeGuruGUIObject
class DupeRow(Row):
def __init__(self, table, group, dupe):
Row.__init__(self, table)
self._app = table.app
self._group = group
self._dupe = dupe
self._data = None
self._data_delta = None
self._delta_columns = None
def is_cell_delta(self, column_name):
"""Returns whether a cell is in delta mode (orange color).
If the result table is in delta mode, returns True if the column is one of the "delta
gitextract_zc64qp50/ ├── .ctags ├── .github/ │ ├── FUNDING.yml │ ├── ISSUE_TEMPLATE/ │ │ ├── bug_report.md │ │ └── feature_request.md │ └── workflows/ │ ├── codeql-analysis.yml │ ├── default.yml │ └── tx-push.yml ├── .gitignore ├── .pre-commit-config.yaml ├── .sonarcloud.properties ├── .tx/ │ └── config ├── .vscode/ │ ├── extensions.json │ ├── launch.json │ └── settings.json ├── CONTRIBUTING.md ├── CREDITS ├── LICENSE ├── MANIFEST.in ├── Makefile ├── README.md ├── Windows.md ├── build.py ├── commitlint.config.js ├── core/ │ ├── __init__.py │ ├── app.py │ ├── directories.py │ ├── engine.py │ ├── exclude.py │ ├── export.py │ ├── fs.py │ ├── gui/ │ │ ├── __init__.py │ │ ├── base.py │ │ ├── deletion_options.py │ │ ├── details_panel.py │ │ ├── directory_tree.py │ │ ├── exclude_list_dialog.py │ │ ├── exclude_list_table.py │ │ ├── ignore_list_dialog.py │ │ ├── ignore_list_table.py │ │ ├── prioritize_dialog.py │ │ ├── problem_dialog.py │ │ ├── problem_table.py │ │ ├── result_table.py │ │ └── stats_label.py │ ├── ignore.py │ ├── markable.py │ ├── me/ │ │ ├── __init__.py │ │ ├── fs.py │ │ ├── prioritize.py │ │ ├── result_table.py │ │ └── scanner.py │ ├── pe/ │ │ ├── __init__.py │ │ ├── block.py │ │ ├── block.pyi │ │ ├── cache.py │ │ ├── cache.pyi │ │ ├── cache_sqlite.py │ │ ├── exif.py │ │ ├── matchblock.py │ │ ├── matchexif.py │ │ ├── modules/ │ │ │ ├── block.c │ │ │ ├── block_osx.m │ │ │ ├── cache.c │ │ │ ├── common.c │ │ │ └── common.h │ │ ├── photo.py │ │ ├── prioritize.py │ │ ├── result_table.py │ │ └── scanner.py │ ├── prioritize.py │ ├── results.py │ ├── scanner.py │ ├── se/ │ │ ├── __init__.py │ │ ├── fs.py │ │ ├── result_table.py │ │ └── scanner.py │ ├── tests/ │ │ ├── __init__.py │ │ ├── app_test.py │ │ ├── base.py │ │ ├── block_test.py │ │ ├── cache_test.py │ │ ├── conftest.py │ │ ├── directories_test.py │ │ ├── engine_test.py │ │ ├── exclude_test.py │ │ ├── fs_test.py │ │ ├── ignore_test.py │ │ ├── markable_test.py │ │ ├── prioritize_test.py │ │ ├── result_table_test.py │ │ ├── results_test.py │ │ └── scanner_test.py │ └── util.py ├── help/ │ ├── changelog │ ├── changelog.tmpl │ ├── conf.tmpl │ ├── de/ │ │ ├── faq.rst │ │ ├── folders.rst │ │ ├── index.rst │ │ ├── preferences.rst │ │ ├── quick_start.rst │ │ ├── reprioritize.rst │ │ └── results.rst │ ├── en/ │ │ ├── contribute.rst │ │ ├── developer/ │ │ │ ├── core/ │ │ │ │ ├── app.rst │ │ │ │ ├── directories.rst │ │ │ │ ├── engine.rst │ │ │ │ ├── fs.rst │ │ │ │ ├── gui/ │ │ │ │ │ ├── deletion_options.rst │ │ │ │ │ └── index.rst │ │ │ │ ├── index.rst │ │ │ │ └── results.rst │ │ │ ├── hscommon/ │ │ │ │ ├── build.rst │ │ │ │ ├── conflict.rst │ │ │ │ ├── desktop.rst │ │ │ │ ├── gui/ │ │ │ │ │ ├── base.rst │ │ │ │ │ ├── column.rst │ │ │ │ │ ├── progress_window.rst │ │ │ │ │ ├── selectable_list.rst │ │ │ │ │ ├── table.rst │ │ │ │ │ ├── text_field.rst │ │ │ │ │ └── tree.rst │ │ │ │ ├── index.rst │ │ │ │ ├── jobprogress/ │ │ │ │ │ ├── job.rst │ │ │ │ │ └── performer.rst │ │ │ │ ├── notify.rst │ │ │ │ ├── path.rst │ │ │ │ └── util.rst │ │ │ └── index.rst │ │ ├── faq.rst │ │ ├── folders.rst │ │ ├── index.rst │ │ ├── preferences.rst │ │ ├── quick_start.rst │ │ ├── reprioritize.rst │ │ ├── results.rst │ │ └── scan.rst │ ├── fr/ │ │ ├── faq.rst │ │ ├── folders.rst │ │ ├── index.rst │ │ ├── preferences.rst │ │ ├── quick_start.rst │ │ ├── reprioritize.rst │ │ └── results.rst │ ├── hy/ │ │ ├── faq.rst │ │ ├── folders.rst │ │ ├── index.rst │ │ ├── preferences.rst │ │ ├── quick_start.rst │ │ ├── reprioritize.rst │ │ └── results.rst │ ├── ru/ │ │ ├── faq.rst │ │ ├── folders.rst │ │ ├── index.rst │ │ ├── preferences.rst │ │ ├── quick_start.rst │ │ ├── reprioritize.rst │ │ └── results.rst │ └── uk/ │ ├── faq.rst │ ├── folders.rst │ ├── index.rst │ ├── preferences.rst │ ├── quick_start.rst │ ├── reprioritize.rst │ └── results.rst ├── hscommon/ │ ├── LICENSE │ ├── README │ ├── __init__.py │ ├── build.py │ ├── conflict.py │ ├── desktop.py │ ├── gui/ │ │ ├── __init__.py │ │ ├── base.py │ │ ├── column.py │ │ ├── progress_window.py │ │ ├── selectable_list.py │ │ ├── table.py │ │ ├── text_field.py │ │ └── tree.py │ ├── jobprogress/ │ │ ├── __init__.py │ │ ├── job.py │ │ └── performer.py │ ├── loc.py │ ├── notify.py │ ├── path.py │ ├── plat.py │ ├── pygettext.py │ ├── sphinxgen.py │ ├── tests/ │ │ ├── __init__.py │ │ ├── conflict_test.py │ │ ├── notify_test.py │ │ ├── path_test.py │ │ ├── selectable_list_test.py │ │ ├── table_test.py │ │ ├── tree_test.py │ │ └── util_test.py │ ├── testutil.py │ ├── trans.py │ └── util.py ├── images/ │ ├── dupeguru.icns │ ├── exchange.icns │ └── exchange_purple_waifu_s4_tta8.xcf ├── locale/ │ ├── ar/ │ │ └── LC_MESSAGES/ │ │ ├── columns.po │ │ ├── core.po │ │ └── ui.po │ ├── columns.pot │ ├── core.pot │ ├── cs/ │ │ └── LC_MESSAGES/ │ │ ├── columns.po │ │ ├── core.po │ │ └── ui.po │ ├── de/ │ │ └── LC_MESSAGES/ │ │ ├── columns.po │ │ ├── core.po │ │ └── ui.po │ ├── el/ │ │ └── LC_MESSAGES/ │ │ ├── columns.po │ │ ├── core.po │ │ └── ui.po │ ├── en/ │ │ └── LC_MESSAGES/ │ │ ├── columns.po │ │ ├── core.po │ │ └── ui.po │ ├── es/ │ │ └── LC_MESSAGES/ │ │ ├── columns.po │ │ ├── core.po │ │ └── ui.po │ ├── fr/ │ │ └── LC_MESSAGES/ │ │ ├── columns.po │ │ ├── core.po │ │ └── ui.po │ ├── hy/ │ │ └── LC_MESSAGES/ │ │ ├── columns.po │ │ ├── core.po │ │ └── ui.po │ ├── it/ │ │ └── LC_MESSAGES/ │ │ ├── columns.po │ │ ├── core.po │ │ └── ui.po │ ├── ja/ │ │ └── LC_MESSAGES/ │ │ ├── columns.po │ │ ├── core.po │ │ └── ui.po │ ├── ko/ │ │ └── LC_MESSAGES/ │ │ ├── columns.po │ │ ├── core.po │ │ └── ui.po │ ├── ms/ │ │ └── LC_MESSAGES/ │ │ ├── columns.po │ │ ├── core.po │ │ └── ui.po │ ├── nl/ │ │ └── LC_MESSAGES/ │ │ ├── columns.po │ │ ├── core.po │ │ └── ui.po │ ├── pl_PL/ │ │ └── LC_MESSAGES/ │ │ ├── columns.po │ │ ├── core.po │ │ └── ui.po │ ├── pt_BR/ │ │ └── LC_MESSAGES/ │ │ ├── columns.po │ │ ├── core.po │ │ └── ui.po │ ├── ru/ │ │ └── LC_MESSAGES/ │ │ ├── columns.po │ │ ├── core.po │ │ └── ui.po │ ├── tr/ │ │ └── LC_MESSAGES/ │ │ ├── columns.po │ │ ├── core.po │ │ └── ui.po │ ├── ui.pot │ ├── uk/ │ │ └── LC_MESSAGES/ │ │ ├── columns.po │ │ ├── core.po │ │ └── ui.po │ ├── vi/ │ │ └── LC_MESSAGES/ │ │ ├── columns.po │ │ ├── core.po │ │ └── ui.po │ ├── zh_CN/ │ │ └── LC_MESSAGES/ │ │ ├── columns.po │ │ ├── core.po │ │ └── ui.po │ └── zh_TW/ │ └── LC_MESSAGES/ │ ├── columns.po │ ├── core.po │ └── ui.po ├── macos.md ├── package.py ├── pkg/ │ ├── arch/ │ │ ├── dupeguru.desktop │ │ └── dupeguru.json │ ├── debian/ │ │ ├── Makefile │ │ ├── build_pe_modules.py │ │ ├── changelog │ │ ├── compat │ │ ├── control │ │ ├── copyright │ │ ├── dirs │ │ ├── dupeguru.desktop │ │ ├── dupeguru.json │ │ ├── rules │ │ └── source/ │ │ ├── format │ │ └── options │ └── dupeguru.desktop ├── pyproject.toml ├── qt/ │ ├── __init__.py │ ├── about_box.py │ ├── app.py │ ├── column.py │ ├── deletion_options.py │ ├── details_dialog.py │ ├── details_table.py │ ├── dg.qrc │ ├── directories_dialog.py │ ├── directories_model.py │ ├── error_report_dialog.py │ ├── exclude_list_dialog.py │ ├── exclude_list_table.py │ ├── ignore_list_dialog.py │ ├── ignore_list_table.py │ ├── me/ │ │ ├── __init__.py │ │ ├── details_dialog.py │ │ ├── preferences_dialog.py │ │ └── results_model.py │ ├── pe/ │ │ ├── __init__.py │ │ ├── block.py │ │ ├── block.pyi │ │ ├── details_dialog.py │ │ ├── image_viewer.py │ │ ├── modules/ │ │ │ └── block.c │ │ ├── photo.py │ │ ├── preferences_dialog.py │ │ └── results_model.py │ ├── platform.py │ ├── preferences.py │ ├── preferences_dialog.py │ ├── prioritize_dialog.py │ ├── problem_dialog.py │ ├── problem_table.py │ ├── progress_window.py │ ├── radio_box.py │ ├── recent.py │ ├── result_window.py │ ├── results_model.py │ ├── se/ │ │ ├── __init__.py │ │ ├── details_dialog.py │ │ ├── preferences_dialog.py │ │ └── results_model.py │ ├── search_edit.py │ ├── selectable_list.py │ ├── stats_label.py │ ├── tabbed_window.py │ ├── table.py │ ├── tree_model.py │ └── util.py ├── requirements-extra.txt ├── requirements.txt ├── run.py ├── setup.cfg ├── setup.nsi ├── setup.py ├── tox.ini └── win_version_info.temp
SYMBOL INDEX (2144 symbols across 133 files)
FILE: build.py
function parse_args (line 23) | def parse_args():
function build_one_help (line 63) | def build_one_help(language):
function build_help (line 84) | def build_help():
function build_localizations (line 91) | def build_localizations():
function build_updatepot (line 99) | def build_updatepot():
function build_mergepot (line 109) | def build_mergepot():
function build_normpo (line 114) | def build_normpo():
function build_pe_modules (line 118) | def build_pe_modules():
function build_normal (line 124) | def build_normal():
function main (line 138) | def main():
FILE: core/app.py
class DestType (line 52) | class DestType:
class JobType (line 58) | class JobType:
class AppMode (line 66) | class AppMode:
class DupeGuru (line 81) | class DupeGuru(Broadcaster):
method __init__ (line 129) | def __init__(self, view, portable=False):
method _recreate_result_table (line 172) | def _recreate_result_table(self):
method _get_picture_cache_path (line 184) | def _get_picture_cache_path(self):
method _get_dupe_sort_key (line 188) | def _get_dupe_sort_key(self, dupe, get_group, key, delta):
method _get_group_sort_key (line 214) | def _get_group_sort_key(self, group, key):
method _do_delete (line 226) | def _do_delete(self, j, link_deleted, use_hardlinks, direct_deletion):
method _do_delete_dupe (line 234) | def _do_delete_dupe(self, dupe, link_deleted, use_hardlinks, direct_de...
method _create_file (line 253) | def _create_file(self, path):
method _get_file (line 257) | def _get_file(self, str_path):
method _get_export_data (line 268) | def _get_export_data(self):
method _results_changed (line 280) | def _results_changed(self):
method _start_job (line 284) | def _start_job(self, jobid, func, args=()):
method _job_completed (line 295) | def _job_completed(self, jobid):
method _job_error (line 324) | def _job_error(self, jobid, err):
method _remove_hardlink_dupes (line 333) | def _remove_hardlink_dupes(files):
method _select_dupes (line 347) | def _select_dupes(self, dupes):
method _get_fileclasses (line 354) | def _get_fileclasses(self):
method _prioritization_categories (line 362) | def _prioritization_categories(self):
method add_directory (line 371) | def add_directory(self, d):
method add_selected_to_ignore_list (line 386) | def add_selected_to_ignore_list(self):
method apply_filter (line 403) | def apply_filter(self, result_filter):
method clean_empty_dirs (line 415) | def clean_empty_dirs(self, path):
method clear_picture_cache (line 420) | def clear_picture_cache(self):
method clear_hash_cache (line 426) | def clear_hash_cache(self):
method copy_or_move (line 429) | def copy_or_move(self, dupe, copy: bool, destination: str, dest_type: ...
method copy_or_move_marked (line 451) | def copy_or_move_marked(self, copy):
method delete_marked (line 478) | def delete_marked(self):
method export_to_xhtml (line 493) | def export_to_xhtml(self):
method export_to_csv (line 504) | def export_to_csv(self):
method get_display_info (line 518) | def get_display_info(self, dupe, group, delta=False):
method invoke_custom_command (line 530) | def invoke_custom_command(self):
method load (line 566) | def load(self):
method load_directories (line 582) | def load_directories(self, filepath):
method load_from (line 588) | def load_from(self, filename):
method make_selected_reference (line 599) | def make_selected_reference(self):
method mark_all (line 631) | def mark_all(self):
method mark_none (line 636) | def mark_none(self):
method mark_invert (line 641) | def mark_invert(self):
method mark_dupe (line 646) | def mark_dupe(self, dupe, marked):
method open_selected (line 659) | def open_selected(self):
method purge_ignore_list (line 666) | def purge_ignore_list(self):
method remove_directories (line 671) | def remove_directories(self, indexes):
method remove_duplicates (line 685) | def remove_duplicates(self, duplicates):
method remove_marked (line 696) | def remove_marked(self):
method remove_selected (line 707) | def remove_selected(self):
method rename_selected (line 718) | def rename_selected(self, newname):
method reprioritize_groups (line 733) | def reprioritize_groups(self, sort_key):
method reveal_selected (line 752) | def reveal_selected(self):
method save (line 756) | def save(self):
method close (line 766) | def close(self):
method save_as (line 769) | def save_as(self, filename):
method save_directories_as (line 779) | def save_directories_as(self, filename):
method start_scanning (line 789) | def start_scanning(self, profile_scan=False):
method toggle_selected_mark_state (line 829) | def toggle_selected_mark_state(self):
method without_ref (line 841) | def without_ref(self, dupes):
method get_default (line 845) | def get_default(self, key, fallback_value=None):
method set_default (line 855) | def set_default(self, key, value):
method stat_line (line 860) | def stat_line(self):
method fileclasses (line 867) | def fileclasses(self):
method SCANNER_CLASS (line 871) | def SCANNER_CLASS(self):
method METADATA_TO_READ (line 880) | def METADATA_TO_READ(self):
FILE: core/directories.py
class DirectoryState (line 26) | class DirectoryState:
class AlreadyThereError (line 39) | class AlreadyThereError(Exception):
class InvalidPathError (line 43) | class InvalidPathError(Exception):
class Directories (line 47) | class Directories:
method __init__ (line 58) | def __init__(self, exclude_list=None):
method __contains__ (line 64) | def __contains__(self, path):
method __delitem__ (line 70) | def __delitem__(self, key):
method __getitem__ (line 73) | def __getitem__(self, key):
method __len__ (line 76) | def __len__(self):
method _default_state_for_path (line 80) | def _default_state_for_path(self, path):
method _get_files (line 93) | def _get_files(self, from_path, fileclasses, j):
method _get_folders (line 134) | def _get_folders(self, from_folder, j):
method add_path (line 148) | def add_path(self, path):
method get_subfolders (line 166) | def get_subfolders(path):
method get_files (line 179) | def get_files(self, fileclasses=None, j=job.nulljob):
method get_folders (line 194) | def get_folders(self, folderclass=None, j=job.nulljob):
method get_state (line 210) | def get_state(self, path):
method has_any_file (line 230) | def has_any_file(self):
method load_from_file (line 243) | def load_from_file(self, infile):
method save_to_file (line 269) | def save_to_file(self, outfile):
method set_state (line 286) | def set_state(self, path, state):
FILE: core/engine.py
function getwords (line 30) | def getwords(s):
function getfields (line 49) | def getfields(s):
function unpack_fields (line 54) | def unpack_fields(fields):
function compare (line 64) | def compare(first, second, flags=()):
function compare_fields (line 97) | def compare_fields(first, second, flags=()):
function build_word_dict (line 125) | def build_word_dict(objects, j=job.nulljob):
function merge_similar_words (line 140) | def merge_similar_words(word_dict):
function reduce_common_words (line 161) | def reduce_common_words(word_dict, threshold):
class Match (line 188) | class Match(namedtuple("Match", "first second percentage")):
function get_match (line 211) | def get_match(first, second, flags=()):
function getmatches (line 217) | def getmatches(
function getmatches_by_contents (line 282) | def getmatches_by_contents(files, bigsize=0, j=job.nulljob):
class Group (line 319) | class Group:
method __init__ (line 348) | def __init__(self):
method __contains__ (line 351) | def __contains__(self, item):
method __getitem__ (line 354) | def __getitem__(self, key):
method __iter__ (line 357) | def __iter__(self):
method __len__ (line 360) | def __len__(self):
method _clear (line 364) | def _clear(self):
method _get_matches_for_ref (line 372) | def _get_matches_for_ref(self):
method add_match (line 379) | def add_match(self, match):
method discard_matches (line 408) | def discard_matches(self):
method get_match_of (line 418) | def get_match_of(self, item):
method prioritize (line 426) | def prioritize(self, key_func, tie_breaker=None):
method remove_dupe (line 452) | def remove_dupe(self, item, discard_matches=True):
method switch_ref (line 466) | def switch_ref(self, with_dupe):
method percentage (line 482) | def percentage(self):
method ref (line 492) | def ref(self):
function get_groups (line 497) | def get_groups(matches):
FILE: core/exclude.py
function timer (line 31) | def timer(func):
function memoize (line 43) | def memoize(func):
class AlreadyThereException (line 55) | class AlreadyThereException(Exception):
method __init__ (line 58) | def __init__(self, arg="Expression is already in excluded list."):
class ExcludeList (line 62) | class ExcludeList(Markable):
method __init__ (line 74) | def __init__(self, union_regex=True):
method __iter__ (line 82) | def __iter__(self):
method __contains__ (line 88) | def __contains__(self, item):
method __len__ (line 91) | def __len__(self):
method __getitem__ (line 95) | def __getitem__(self, key):
method __setitem__ (line 102) | def __setitem__(self, key, value):
method __delitem__ (line 106) | def __delitem__(self, key):
method get_compiled (line 110) | def get_compiled(self, key):
method is_markable (line 114) | def is_markable(self, regex):
method _is_markable (line 117) | def _is_markable(self, regex):
method _did_mark (line 124) | def _did_mark(self, regex):
method _did_unmark (line 127) | def _did_unmark(self, regex):
method _add_compiled (line 130) | def _add_compiled(self, regex):
method _remove_compiled (line 141) | def _remove_compiled(self, regex):
method _do_compile (line 152) | def _do_compile(self, expr):
method compile_re (line 157) | def compile_re(self, regex):
method error (line 165) | def error(self, regex):
method build_compiled_caches (line 172) | def build_compiled_caches(self, union=False):
method compiled (line 202) | def compiled(self):
method compiled_files (line 211) | def compiled_files(self):
method compiled_paths (line 221) | def compiled_paths(self):
method add (line 228) | def add(self, regex, forced=False):
method _do_add (line 245) | def _do_add(self, regex, iscompilable, exception, compiled):
method marked_count (line 250) | def marked_count(self):
method has_entry (line 254) | def has_entry(self, regex):
method is_excluded (line 260) | def is_excluded(self, dirname, filename):
method remove (line 275) | def remove(self, regex):
method rename (line 281) | def rename(self, regex, newregex):
method restore_defaults (line 309) | def restore_defaults(self):
method load_from_xml (line 318) | def load_from_xml(self, infile):
method save_to_xml (line 351) | def save_to_xml(self, outfile):
class ExcludeDict (line 365) | class ExcludeDict(ExcludeList):
method __init__ (line 373) | def __init__(self, union_regex=False):
method __iter__ (line 388) | def __iter__(self):
method __getitem__ (line 393) | def __getitem__(self, key):
method get_compiled (line 397) | def get_compiled(self, key):
method is_markable (line 401) | def is_markable(self, regex):
method _is_markable (line 404) | def _is_markable(self, regex):
method _add_compiled (line 411) | def _add_compiled(self, regex):
method is_compilable (line 421) | def is_compilable(self, regex):
method error (line 425) | def error(self, regex):
method _do_add (line 430) | def _do_add(self, regex, iscompilable, exception, compiled):
method has_entry (line 437) | def has_entry(self, regex):
method remove (line 442) | def remove(self, regex):
method rename (line 456) | def rename(self, regex, newregex):
method save_to_xml (line 474) | def save_to_xml(self, outfile):
function ordered_keys (line 493) | def ordered_keys(_dict):
function has_sep (line 507) | def has_sep(regexp):
function has_sep (line 512) | def has_sep(regexp):
FILE: core/export.py
function export_to_xhtml (line 118) | def export_to_xhtml(colnames, rows):
function export_to_csv (line 147) | def export_to_csv(dest, colnames, rows):
FILE: core/fs.py
class FSError (line 62) | class FSError(Exception):
method __init__ (line 65) | def __init__(self, fsobject, parent=None):
class AlreadyExistsError (line 77) | class AlreadyExistsError(FSError):
class InvalidPath (line 82) | class InvalidPath(FSError):
class InvalidDestinationError (line 87) | class InvalidDestinationError(FSError):
class OperationError (line 93) | class OperationError(FSError):
class FilesDB (line 100) | class FilesDB:
method __init__ (line 117) | def __init__(self):
method connect (line 121) | def connect(self, path: Union[AnyStr, os.PathLike]) -> None:
method _check_upgrade (line 129) | def _check_upgrade(self) -> None:
method clear (line 147) | def clear(self) -> None:
method get (line 152) | def get(self, path: Path, key: str) -> Union[bytes, None]:
method put (line 177) | def put(self, path: Path, key: str, value: Any) -> None:
method commit (line 190) | def commit(self) -> None:
method close (line 194) | def close(self) -> None:
class File (line 202) | class File:
method __init__ (line 211) | def __init__(self, path):
method __repr__ (line 223) | def __repr__(self):
method __getattribute__ (line 226) | def __getattribute__(self, attrname):
method _calc_digest (line 238) | def _calc_digest(self):
method _calc_digest_partial (line 253) | def _calc_digest_partial(self):
method _calc_digest_samples (line 260) | def _calc_digest_samples(self) -> bytes:
method _read_info (line 279) | def _read_info(self, field):
method _read_all_info (line 310) | def _read_all_info(self, attrnames=None):
method can_handle (line 322) | def can_handle(cls, path):
method exists (line 326) | def exists(self) -> bool:
method rename (line 334) | def rename(self, newname):
method get_display_info (line 348) | def get_display_info(self, group, delta):
method extension (line 354) | def extension(self):
method name (line 358) | def name(self):
method folder_path (line 362) | def folder_path(self):
class Folder (line 366) | class Folder(File):
method __init__ (line 374) | def __init__(self, path):
method _all_items (line 379) | def _all_items(self):
method _read_info (line 384) | def _read_info(self, field):
method subfolders (line 406) | def subfolders(self):
method can_handle (line 414) | def can_handle(cls, path):
function get_file (line 418) | def get_file(path, fileclasses=[File]):
function get_files (line 431) | def get_files(path, fileclasses=[File]):
FILE: core/gui/base.py
class DupeGuruGUIObject (line 12) | class DupeGuruGUIObject(Listener):
method __init__ (line 13) | def __init__(self, app):
method directories_changed (line 17) | def directories_changed(self):
method dupes_selected (line 21) | def dupes_selected(self):
method marking_changed (line 25) | def marking_changed(self):
method results_changed (line 29) | def results_changed(self):
method results_changed_but_keep_selection (line 33) | def results_changed_but_keep_selection(self):
FILE: core/gui/deletion_options.py
class DeletionOptionsView (line 14) | class DeletionOptionsView:
method update_msg (line 31) | def update_msg(self, msg: str):
method show (line 34) | def show(self):
method set_hardlink_option_enabled (line 40) | def set_hardlink_option_enabled(self, is_enabled: bool):
class DeletionOptions (line 44) | class DeletionOptions(GUIObject):
method __init__ (line 51) | def __init__(self):
method show (line 60) | def show(self, mark_count):
method supports_links (line 75) | def supports_links(self):
method link_deleted (line 93) | def link_deleted(self):
method link_deleted (line 103) | def link_deleted(self, value):
FILE: core/gui/details_panel.py
class DetailsPanel (line 13) | class DetailsPanel(GUIObject, DupeGuruGUIObject):
method __init__ (line 14) | def __init__(self, app):
method _view_updated (line 19) | def _view_updated(self):
method _refresh (line 24) | def _refresh(self):
method row_count (line 39) | def row_count(self):
method row (line 42) | def row(self, row_index):
method dupes_selected (line 46) | def dupes_selected(self):
FILE: core/gui/directory_tree.py
class DirectoryNode (line 18) | class DirectoryNode(Node):
method __init__ (line 19) | def __init__(self, tree, path, name):
method __len__ (line 26) | def __len__(self):
method _load (line 31) | def _load(self):
method update_all_states (line 38) | def update_all_states(self):
method state (line 45) | def state(self):
method state (line 49) | def state(self, value):
class DirectoryTree (line 58) | class DirectoryTree(Tree, DupeGuruGUIObject):
method __init__ (line 63) | def __init__(self, app):
method _view_updated (line 67) | def _view_updated(self):
method _refresh (line 71) | def _refresh(self):
method add_directory (line 76) | def add_directory(self, path):
method remove_selected (line 79) | def remove_selected(self):
method select_all (line 95) | def select_all(self):
method update_all_states (line 99) | def update_all_states(self):
method directories_changed (line 105) | def directories_changed(self):
FILE: core/gui/exclude_list_dialog.py
class ExcludeListDialogCore (line 14) | class ExcludeListDialogCore:
method __init__ (line 15) | def __init__(self, app):
method restore_defaults (line 20) | def restore_defaults(self):
method refresh (line 24) | def refresh(self):
method remove_selected (line 27) | def remove_selected(self):
method rename_selected (line 33) | def rename_selected(self, newregex):
method add (line 48) | def add(self, regex):
method test_string (line 53) | def test_string(self, test_string):
method is_match (line 67) | def is_match(self, test_string, compiled_regex):
method reset_rows_highlight (line 85) | def reset_rows_highlight(self):
method show (line 89) | def show(self):
FILE: core/gui/exclude_list_table.py
class ExcludeListTable (line 13) | class ExcludeListTable(GUITable, DupeGuruGUIObject):
method __init__ (line 16) | def __init__(self, exclude_list_dialog, app):
method rename_selected (line 22) | def rename_selected(self, newname):
method _do_add (line 30) | def _do_add(self, regex):
method _do_delete (line 36) | def _do_delete(self):
method add (line 40) | def add(self, regex):
method _fill (line 45) | def _fill(self):
method refresh (line 49) | def refresh(self, refresh_view=True):
class ExcludeListRow (line 59) | class ExcludeListRow(Row):
method __init__ (line 60) | def __init__(self, table, enabled, regex):
method data (line 69) | def data(self):
method markable (line 75) | def markable(self):
method marked (line 79) | def marked(self):
method marked (line 83) | def marked(self, value):
method error (line 90) | def error(self):
FILE: core/gui/ignore_list_dialog.py
class IgnoreListDialog (line 12) | class IgnoreListDialog:
method __init__ (line 17) | def __init__(self, app):
method clear (line 22) | def clear(self):
method refresh (line 30) | def refresh(self):
method remove_selected (line 33) | def remove_selected(self):
method show (line 38) | def show(self):
FILE: core/gui/ignore_list_table.py
class IgnoreListTable (line 16) | class IgnoreListTable(GUITable):
method __init__ (line 23) | def __init__(self, ignore_list_dialog):
method _fill (line 30) | def _fill(self):
class IgnoreListRow (line 35) | class IgnoreListRow(Row):
method __init__ (line 36) | def __init__(self, table, path1, path2):
FILE: core/gui/prioritize_dialog.py
class CriterionCategoryList (line 13) | class CriterionCategoryList(GUISelectableList):
method __init__ (line 14) | def __init__(self, dialog):
method _update_selection (line 18) | def _update_selection(self):
class PrioritizationList (line 23) | class PrioritizationList(GUISelectableList):
method __init__ (line 24) | def __init__(self, dialog):
method _refresh_contents (line 28) | def _refresh_contents(self):
method move_indexes (line 31) | def move_indexes(self, indexes, dest_index):
method remove_selected (line 40) | def remove_selected(self):
class PrioritizeDialog (line 47) | class PrioritizeDialog(GUIObject):
method __init__ (line 48) | def __init__(self, app):
method _view_updated (line 59) | def _view_updated(self):
method _sort_key (line 63) | def _sort_key(self, dupe):
method select_category (line 67) | def select_category(self, category):
method add_selected (line 71) | def add_selected(self):
method remove_selected (line 81) | def remove_selected(self):
method perform_reprioritization (line 85) | def perform_reprioritization(self):
FILE: core/gui/problem_dialog.py
class ProblemDialog (line 14) | class ProblemDialog:
method __init__ (line 15) | def __init__(self, app):
method refresh (line 20) | def refresh(self):
method reveal_selected_dupe (line 24) | def reveal_selected_dupe(self):
method select_dupe (line 28) | def select_dupe(self, dupe):
FILE: core/gui/problem_table.py
class ProblemTable (line 16) | class ProblemTable(GUITable):
method __init__ (line 22) | def __init__(self, problem_dialog):
method _update_selection (line 28) | def _update_selection(self):
method _fill (line 33) | def _fill(self):
class ProblemRow (line 39) | class ProblemRow(Row):
method __init__ (line 40) | def __init__(self, table, dupe, msg):
FILE: core/gui/result_table.py
class DupeRow (line 17) | class DupeRow(Row):
method __init__ (line 18) | def __init__(self, table, group, dupe):
method is_cell_delta (line 27) | def is_cell_delta(self, column_name):
method data (line 53) | def data(self):
method data_delta (line 59) | def data_delta(self):
method isref (line 65) | def isref(self):
method markable (line 69) | def markable(self):
method marked (line 73) | def marked(self):
method marked (line 77) | def marked(self, value):
class ResultTable (line 81) | class ResultTable(GUITable, DupeGuruGUIObject):
method __init__ (line 82) | def __init__(self, app):
method _view_updated (line 91) | def _view_updated(self):
method _restore_selection (line 94) | def _restore_selection(self, previous_selection):
method _update_selection (line 100) | def _update_selection(self):
method _fill (line 104) | def _fill(self):
method _refresh_with_view (line 115) | def _refresh_with_view(self):
method get_row_value (line 120) | def get_row_value(self, index, column):
method rename_selected (line 130) | def rename_selected(self, newname):
method sort (line 140) | def sort(self, key, asc):
method power_marker (line 150) | def power_marker(self):
method power_marker (line 154) | def power_marker(self, value):
method delta_values (line 163) | def delta_values(self):
method delta_values (line 167) | def delta_values(self, value):
method selected_dupe_count (line 174) | def selected_dupe_count(self):
method marking_changed (line 178) | def marking_changed(self):
method results_changed (line 181) | def results_changed(self):
method results_changed_but_keep_selection (line 184) | def results_changed_but_keep_selection(self):
method save_session (line 192) | def save_session(self):
FILE: core/gui/stats_label.py
class StatsLabel (line 12) | class StatsLabel(DupeGuruGUIObject):
method _view_updated (line 13) | def _view_updated(self):
method display (line 17) | def display(self):
method results_changed (line 20) | def results_changed(self):
FILE: core/ignore.py
class IgnoreList (line 14) | class IgnoreList:
method __init__ (line 22) | def __init__(self):
method __iter__ (line 25) | def __iter__(self):
method __len__ (line 30) | def __len__(self):
method are_ignored (line 34) | def are_ignored(self, first, second):
method clear (line 44) | def clear(self):
method filter (line 48) | def filter(self, func):
method ignore (line 59) | def ignore(self, first, second):
method remove (line 75) | def remove(self, first, second):
method load_from_xml (line 93) | def load_from_xml(self, infile):
method save_to_xml (line 113) | def save_to_xml(self, outfile):
FILE: core/markable.py
class Markable (line 10) | class Markable:
method __init__ (line 11) | def __init__(self):
method _did_mark (line 19) | def _did_mark(self, o):
method _did_unmark (line 23) | def _did_unmark(self, o):
method _get_markable_count (line 27) | def _get_markable_count(self):
method _is_markable (line 30) | def _is_markable(self, o):
method _remove_mark_flag (line 34) | def _remove_mark_flag(self, o):
method is_marked (line 42) | def is_marked(self, o):
method mark (line 50) | def mark(self, o):
method mark_multiple (line 57) | def mark_multiple(self, objects):
method mark_all (line 61) | def mark_all(self):
method mark_invert (line 65) | def mark_invert(self):
method mark_none (line 68) | def mark_none(self):
method mark_toggle (line 74) | def mark_toggle(self, o):
method mark_toggle_multiple (line 85) | def mark_toggle_multiple(self, objects):
method unmark (line 89) | def unmark(self, o):
method unmark_multiple (line 94) | def unmark_multiple(self, objects):
method mark_count (line 100) | def mark_count(self):
method mark_inverted (line 107) | def mark_inverted(self):
class MarkableList (line 111) | class MarkableList(list, Markable):
method __init__ (line 112) | def __init__(self):
method _get_markable_count (line 116) | def _get_markable_count(self):
method _is_markable (line 119) | def _is_markable(self, o):
FILE: core/me/fs.py
class MusicFile (line 33) | class MusicFile(fs.File):
method can_handle (line 53) | def can_handle(cls, path):
method get_display_info (line 58) | def get_display_info(self, group, delta):
method _read_info (line 100) | def _read_info(self, field):
FILE: core/me/prioritize.py
class DurationCategory (line 22) | class DurationCategory(NumericalCategory):
method extract_value (line 25) | def extract_value(self, dupe):
class BitrateCategory (line 29) | class BitrateCategory(NumericalCategory):
method extract_value (line 32) | def extract_value(self, dupe):
class SamplerateCategory (line 36) | class SamplerateCategory(NumericalCategory):
method extract_value (line 39) | def extract_value(self, dupe):
function all_categories (line 43) | def all_categories():
FILE: core/me/result_table.py
class ResultTable (line 16) | class ResultTable(ResultTableBase):
FILE: core/me/scanner.py
class ScannerME (line 12) | class ScannerME(ScannerBase):
method _key_func (line 14) | def _key_func(dupe):
method get_scan_options (line 18) | def get_scan_options():
FILE: core/pe/block.pyi
class NoBlocksError (line 5) | class NoBlocksError(Exception): ... # noqa: E302, E701
class DifferentBlockCountError (line 6) | class DifferentBlockCountError(Exception): ... # noqa E701
function getblock (line 8) | def getblock(image: object) -> Union[_block, None]: ... # noqa: E302
function getblocks2 (line 9) | def getblocks2(image: object, block_count_per_side: int) -> Union[List[_...
function diff (line 10) | def diff(first: _block, second: _block) -> int: ...
function avgdiff (line 11) | def avgdiff( # noqa: E302
FILE: core/pe/cache.py
function colors_to_bytes (line 10) | def colors_to_bytes(colors):
FILE: core/pe/cache.pyi
function colors_to_bytes (line 5) | def colors_to_bytes(colors: List[_block]) -> bytes: ... # noqa: E302
function bytes_to_colors (line 6) | def bytes_to_colors(s: bytes) -> Union[List[_block], None]: ...
FILE: core/pe/cache_sqlite.py
class SqliteCache (line 15) | class SqliteCache:
method __init__ (line 30) | def __init__(self, db=":memory:", readonly=False):
method __contains__ (line 36) | def __contains__(self, key):
method __delitem__ (line 41) | def __delitem__(self, key):
method __getitem__ (line 48) | def __getitem__(self, key):
method __iter__ (line 68) | def __iter__(self):
method __len__ (line 73) | def __len__(self):
method __setitem__ (line 78) | def __setitem__(self, path_str, blocks):
method _create_con (line 102) | def _create_con(self, second_try=False):
method _check_upgrade (line 114) | def _check_upgrade(self) -> None:
method clear (line 133) | def clear(self):
method close (line 139) | def close(self):
method filter (line 144) | def filter(self, func):
method get_id (line 149) | def get_id(self, path):
method get_multiple (line 157) | def get_multiple(self, rowids):
method purge_outdated (line 181) | def purge_outdated(self):
FILE: core/pe/exif.py
function s2n_motorola (line 164) | def s2n_motorola(bytes):
function s2n_intel (line 171) | def s2n_intel(bytes):
class Fraction (line 180) | class Fraction:
method __init__ (line 181) | def __init__(self, num, den):
method __repr__ (line 185) | def __repr__(self):
class TIFF_file (line 189) | class TIFF_file:
method __init__ (line 190) | def __init__(self, data):
method s2n (line 195) | def s2n(self, offset, length, signed=0, debug=False):
method first_IFD (line 214) | def first_IFD(self):
method next_IFD (line 217) | def next_IFD(self, ifd):
method list_IFDs (line 221) | def list_IFDs(self):
method dump_IFD (line 229) | def dump_IFD(self, ifd):
function read_exif_header (line 270) | def read_exif_header(fp):
function get_fields (line 291) | def get_fields(fp):
FILE: core/pe/matchblock.py
function get_cache (line 53) | def get_cache(cache_path, readonly=False):
function prepare_pictures (line 57) | def prepare_pictures(pictures, cache_path, with_dimensions, match_rotate...
function get_chunks (line 105) | def get_chunks(pictures):
function get_match (line 121) | def get_match(first, second, percentage):
function async_compare (line 127) | def async_compare(ref_ids, other_ids, dbname, threshold, picinfo, match_...
function getmatches (line 171) | def getmatches(pictures, cache_path, threshold, match_scaled=False, matc...
FILE: core/pe/matchexif.py
function getmatches (line 17) | def getmatches(files, match_scaled, j):
FILE: core/pe/modules/block.c
function PyObject (line 20) | static PyObject *getblock(PyObject *image) {
function diff (line 67) | static int diff(PyObject *first, PyObject *second) {
function PyObject (line 102) | static PyObject *block_getblocks2(PyObject *self, PyObject *args) {
function PyObject (line 174) | static PyObject *block_avgdiff(PyObject *self, PyObject *args) {
type PyModuleDef (line 225) | struct PyModuleDef
function PyObject (line 235) | PyObject *PyInit__block(void) {
FILE: core/pe/modules/cache.c
function PyObject (line 12) | static PyObject *cache_bytes_to_colors(PyObject *self, PyObject *args) {
type PyModuleDef (line 53) | struct PyModuleDef
function PyObject (line 63) | PyObject *PyInit__cache(void) {
FILE: core/pe/modules/common.c
function max (line 13) | int max(int a, int b)
function min (line 18) | int min(int a, int b)
function PyObject (line 24) | PyObject* inttuple(int n, ...)
FILE: core/pe/photo.py
function format_dimensions (line 18) | def format_dimensions(dimensions):
function get_delta_dimensions (line 22) | def get_delta_dimensions(value, ref_value):
class Photo (line 26) | class Photo(fs.File):
method _plat_get_dimensions (line 34) | def _plat_get_dimensions(self):
method _plat_get_blocks (line 37) | def _plat_get_blocks(self, block_count_per_side, orientation):
method get_orientation (line 40) | def get_orientation(self):
method _get_exif_timestamp (line 52) | def _get_exif_timestamp(self):
method can_handle (line 62) | def can_handle(cls, path):
method get_display_info (line 65) | def get_display_info(self, group, delta):
method _read_info (line 94) | def _read_info(self, field):
method get_blocks (line 103) | def get_blocks(self, block_count_per_side, orientation: int = None):
FILE: core/pe/prioritize.py
class DimensionsCategory (line 22) | class DimensionsCategory(NumericalCategory):
method extract_value (line 25) | def extract_value(self, dupe):
method invert_numerical_value (line 28) | def invert_numerical_value(self, value):
function all_categories (line 33) | def all_categories():
FILE: core/pe/result_table.py
class ResultTable (line 16) | class ResultTable(ResultTableBase):
FILE: core/pe/scanner.py
class ScannerPE (line 14) | class ScannerPE(Scanner):
method get_scan_options (line 20) | def get_scan_options():
method _getmatches (line 26) | def _getmatches(self, files, j):
FILE: core/prioritize.py
class CriterionCategory (line 15) | class CriterionCategory:
method __init__ (line 18) | def __init__(self, results):
method extract_value (line 22) | def extract_value(self, dupe):
method format_criterion_value (line 25) | def format_criterion_value(self, value):
method sort_key (line 28) | def sort_key(self, dupe, crit_value):
method criteria_list (line 31) | def criteria_list(self):
class Criterion (line 35) | class Criterion:
method __init__ (line 36) | def __init__(self, category, value):
method sort_key (line 41) | def sort_key(self, dupe):
method display (line 45) | def display(self):
class ValueListCategory (line 49) | class ValueListCategory(CriterionCategory):
method sort_key (line 50) | def sort_key(self, dupe, crit_value):
method criteria_list (line 58) | def criteria_list(self):
class KindCategory (line 64) | class KindCategory(ValueListCategory):
method extract_value (line 67) | def extract_value(self, dupe):
class FolderCategory (line 74) | class FolderCategory(ValueListCategory):
method extract_value (line 77) | def extract_value(self, dupe):
method format_criterion_value (line 80) | def format_criterion_value(self, value):
method sort_key (line 83) | def sort_key(self, dupe, crit_value):
class FilenameCategory (line 93) | class FilenameCategory(CriterionCategory):
method format_criterion_value (line 102) | def format_criterion_value(self, value):
method extract_value (line 112) | def extract_value(self, dupe):
method sort_key (line 115) | def sort_key(self, dupe, crit_value):
method criteria_list (line 133) | def criteria_list(self):
class NumericalCategory (line 147) | class NumericalCategory(CriterionCategory):
method format_criterion_value (line 151) | def format_criterion_value(self, value):
method invert_numerical_value (line 154) | def invert_numerical_value(self, value): # Virtual
method sort_key (line 157) | def sort_key(self, dupe, crit_value):
method criteria_list (line 163) | def criteria_list(self):
class SizeCategory (line 167) | class SizeCategory(NumericalCategory):
method extract_value (line 170) | def extract_value(self, dupe):
class MtimeCategory (line 174) | class MtimeCategory(NumericalCategory):
method extract_value (line 177) | def extract_value(self, dupe):
method format_criterion_value (line 180) | def format_criterion_value(self, value):
function all_categories (line 184) | def all_categories():
FILE: core/results.py
class Results (line 25) | class Results(Markable):
method __init__ (line 41) | def __init__(self, app):
method _did_mark (line 58) | def _did_mark(self, dupe):
method _did_unmark (line 61) | def _did_unmark(self, dupe):
method _get_markable_count (line 64) | def _get_markable_count(self):
method _is_markable (line 67) | def _is_markable(self, dupe):
method mark_all (line 79) | def mark_all(self):
method mark_invert (line 85) | def mark_invert(self):
method mark_none (line 91) | def mark_none(self):
method __get_dupe_list (line 98) | def __get_dupe_list(self):
method __get_groups (line 116) | def __get_groups(self):
method __get_stat_line (line 122) | def __get_stat_line(self):
method __recalculate_stats (line 145) | def __recalculate_stats(self):
method __set_groups (line 153) | def __set_groups(self, new_groups):
method apply_filter (line 169) | def apply_filter(self, filter_str):
method get_group_of_duplicate (line 206) | def get_group_of_duplicate(self, dupe):
method load_from_xml (line 215) | def load_from_xml(self, infile, get_file, j=nulljob):
method make_ref (line 272) | def make_ref(self, dupe):
method perform_on_marked (line 289) | def perform_on_marked(self, func, remove_from_results):
method remove_duplicates (line 313) | def remove_duplicates(self, dupes):
method save_to_xml (line 341) | def save_to_xml(self, outfile):
method sort_dupes (line 391) | def sort_dupes(self, key, asc=True, delta=False):
method sort_groups (line 406) | def sort_groups(self, key, asc=True):
FILE: core/scanner.py
class ScanType (line 23) | class ScanType:
function is_same_with_digit (line 43) | def is_same_with_digit(name, refname):
function remove_dupe_paths (line 51) | def remove_dupe_paths(files):
class Scanner (line 75) | class Scanner:
method __init__ (line 76) | def __init__(self):
method _getmatches (line 79) | def _getmatches(self, files, j):
method _key_func (line 120) | def _key_func(dupe):
method _tie_breaker (line 124) | def _tie_breaker(ref, dupe):
method get_scan_options (line 138) | def get_scan_options():
method get_dupe_groups (line 145) | def get_dupe_groups(self, files, ignore_list=None, j=job.nulljob):
FILE: core/se/fs.py
function get_display_info (line 15) | def get_display_info(dupe, group, delta):
class File (line 41) | class File(fs.File):
method get_display_info (line 42) | def get_display_info(self, group, delta):
class Folder (line 46) | class Folder(fs.Folder):
method get_display_info (line 47) | def get_display_info(self, group, delta):
FILE: core/se/result_table.py
class ResultTable (line 16) | class ResultTable(ResultTableBase):
FILE: core/se/scanner.py
class ScannerSE (line 12) | class ScannerSE(ScannerBase):
method get_scan_options (line 14) | def get_scan_options():
FILE: core/tests/app_test.py
function add_fake_files_to_directories (line 25) | def add_fake_files_to_directories(directories, files):
class TestCaseDupeGuru (line 30) | class TestCaseDupeGuru:
method test_apply_filter_calls_results_apply_filter (line 31) | def test_apply_filter_calls_results_apply_filter(self, monkeypatch):
method test_apply_filter_escapes_regexp (line 41) | def test_apply_filter_escapes_regexp(self, monkeypatch):
method test_copy_or_move (line 55) | def test_copy_or_move(self, tmpdir, monkeypatch):
method test_copy_or_move_clean_empty_dirs (line 79) | def test_copy_or_move_clean_empty_dirs(self, tmpdir, monkeypatch):
method test_scan_with_objects_evaluating_to_false (line 93) | def test_scan_with_objects_evaluating_to_false(self):
method test_ignore_hardlink_matches (line 107) | def test_ignore_hardlink_matches(self, tmpdir):
method test_rename_when_nothing_is_selected (line 120) | def test_rename_when_nothing_is_selected(self):
class TestCaseDupeGuruCleanEmptyDirs (line 129) | class TestCaseDupeGuruCleanEmptyDirs:
method do_setup (line 131) | def do_setup(self, request):
method test_option_off (line 142) | def test_option_off(self, do_setup):
method test_option_on (line 146) | def test_option_on(self, do_setup):
method test_recurse_up (line 154) | def test_recurse_up(self, do_setup, monkeypatch):
class TestCaseDupeGuruWithResults (line 172) | class TestCaseDupeGuruWithResults:
method do_setup (line 174) | def do_setup(self, request):
method test_get_objects (line 189) | def test_get_objects(self, do_setup):
method test_get_objects_after_sort (line 202) | def test_get_objects_after_sort(self, do_setup):
method test_selected_result_node_paths_after_deletion (line 210) | def test_selected_result_node_paths_after_deletion(self, do_setup):
method test_select_result_node_paths (line 217) | def test_select_result_node_paths(self, do_setup):
method test_select_result_node_paths_with_ref (line 225) | def test_select_result_node_paths_with_ref(self, do_setup):
method test_select_result_node_paths_after_sort (line 234) | def test_select_result_node_paths_after_sort(self, do_setup):
method test_selected_powermarker_node_paths (line 246) | def test_selected_powermarker_node_paths(self, do_setup):
method test_selected_powermarker_node_paths_after_deletion (line 253) | def test_selected_powermarker_node_paths_after_deletion(self, do_setup):
method test_select_powermarker_rows_after_sort (line 261) | def test_select_powermarker_rows_after_sort(self, do_setup):
method test_toggle_selected_mark_state (line 272) | def test_toggle_selected_mark_state(self, do_setup):
method test_toggle_selected_mark_state_with_different_selected_state (line 286) | def test_toggle_selected_mark_state_with_different_selected_state(self...
method test_refresh_details_with_selected (line 300) | def test_refresh_details_with_selected(self, do_setup):
method test_make_selected_reference (line 308) | def test_make_selected_reference(self, do_setup):
method test_make_selected_reference_by_selecting_two_dupes_in_the_same_group (line 317) | def test_make_selected_reference_by_selecting_two_dupes_in_the_same_gr...
method test_remove_selected (line 327) | def test_remove_selected(self, do_setup):
method test_add_directory_simple (line 335) | def test_add_directory_simple(self, do_setup):
method test_add_directory_already_there (line 343) | def test_add_directory_already_there(self, do_setup):
method test_add_directory_does_not_exist (line 351) | def test_add_directory_does_not_exist(self, do_setup):
method test_ignore (line 357) | def test_ignore(self, do_setup):
method test_purge_ignorelist (line 367) | def test_purge_ignorelist(self, do_setup, tmpdir):
method test_only_unicode_is_added_to_ignore_list (line 382) | def test_only_unicode_is_added_to_ignore_list(self, do_setup):
method test_cancel_scan_with_previous_results (line 394) | def test_cancel_scan_with_previous_results(self, do_setup):
method test_selected_dupes_after_removal (line 403) | def test_selected_dupes_after_removal(self, do_setup):
method test_dont_crash_on_delta_powermarker_dupecount_sort (line 413) | def test_dont_crash_on_delta_powermarker_dupecount_sort(self, do_setup):
class TestCaseDupeGuruRenameSelected (line 424) | class TestCaseDupeGuruRenameSelected:
method do_setup (line 426) | def do_setup(self, request):
method test_simple (line 448) | def test_simple(self, do_setup):
method test_none_selected (line 458) | def test_none_selected(self, do_setup, monkeypatch):
method test_name_already_exists (line 471) | def test_name_already_exists(self, do_setup, monkeypatch):
class TestAppWithDirectoriesInTree (line 485) | class TestAppWithDirectoriesInTree:
method do_setup (line 487) | def do_setup(self, request):
method test_set_root_as_ref_makes_subfolders_ref_as_well (line 499) | def test_set_root_as_ref_makes_subfolders_ref_as_well(self, do_setup):
FILE: core/tests/base.py
class DupeGuruView (line 20) | class DupeGuruView:
method __init__ (line 23) | def __init__(self):
method start_job (line 26) | def start_job(self, jobid, func, args=()):
method get_default (line 32) | def get_default(self, key_name):
method set_default (line 35) | def set_default(self, key_name, value):
method show_message (line 38) | def show_message(self, msg):
method ask_yes_no (line 41) | def ask_yes_no(self, prompt):
method create_results_window (line 44) | def create_results_window(self):
class ResultTable (line 48) | class ResultTable(ResultTableBase):
class DupeGuru (line 61) | class DupeGuru(DupeGuruBase):
method __init__ (line 65) | def __init__(self):
method _prioritization_categories (line 70) | def _prioritization_categories(self):
method _recreate_result_table (line 73) | def _recreate_result_table(self):
class NamedObject (line 81) | class NamedObject:
method __init__ (line 82) | def __init__(self, name="foobar", with_words=False, size=1, folder=None):
method __bool__ (line 95) | def __bool__(self):
method get_display_info (line 98) | def get_display_info(self, group, delta):
method path (line 112) | def path(self):
method folder_path (line 116) | def folder_path(self):
method extension (line 120) | def extension(self):
function GetTestGroups (line 130) | def GetTestGroups():
class TestApp (line 147) | class TestApp(TestAppBase):
method __init__ (line 150) | def __init__(self):
method rtable (line 174) | def rtable(self):
method select_pri_criterion (line 179) | def select_pri_criterion(self, name):
method add_pri_criterion (line 185) | def add_pri_criterion(self, name, index):
FILE: core/tests/block_test.py
function my_avgdiff (line 17) | def my_avgdiff(first, second, limit=768, min_iter=3): # this is so I do...
class FakeImage (line 27) | class FakeImage:
method __init__ (line 28) | def __init__(self, size, data):
method getdata (line 32) | def getdata(self):
method crop (line 35) | def crop(self, box):
function empty (line 44) | def empty():
function single_pixel (line 48) | def single_pixel(): # one red pixel
function four_pixels (line 52) | def four_pixels():
class TestCasegetblock (line 57) | class TestCasegetblock:
method test_single_pixel (line 58) | def test_single_pixel(self):
method test_no_pixel (line 63) | def test_no_pixel(self):
method test_four_pixels (line 67) | def test_four_pixels(self):
class TestCasegetblocks2 (line 76) | class TestCasegetblocks2:
method test_empty_image (line 77) | def test_empty_image(self):
method test_one_block_image (line 82) | def test_one_block_image(self):
method test_four_blocks_all_black (line 92) | def test_four_blocks_all_black(self):
method test_two_pixels_image_horizontal (line 99) | def test_two_pixels_image_horizontal(self):
method test_two_pixels_image_vertical (line 109) | def test_two_pixels_image_vertical(self):
class TestCaseavgdiff (line 120) | class TestCaseavgdiff:
method test_empty (line 121) | def test_empty(self):
method test_two_blocks (line 125) | def test_two_blocks(self):
method test_blocks_not_the_same_size (line 137) | def test_blocks_not_the_same_size(self):
method test_first_arg_is_empty_but_not_second (line 142) | def test_first_arg_is_empty_but_not_second(self):
method test_limit (line 148) | def test_limit(self):
method test_min_iterations (line 157) | def test_min_iterations(self):
method test_return_at_least_1_at_the_slightest_difference (line 177) | def test_return_at_least_1_at_the_slightest_difference(self):
method test_return_0_if_there_is_no_difference (line 185) | def test_return_0_if_there_is_no_difference(self):
FILE: core/tests/cache_test.py
class TestCaseColorsToString (line 19) | class TestCaseColorsToString:
method test_no_color (line 20) | def test_no_color(self):
method test_single_color (line 23) | def test_single_color(self):
method test_two_colors (line 28) | def test_two_colors(self):
class TestCaseStringToColors (line 32) | class TestCaseStringToColors:
method test_empty (line 33) | def test_empty(self):
method test_single_color (line 36) | def test_single_color(self):
method test_two_colors (line 41) | def test_two_colors(self):
method test_incomplete_color (line 44) | def test_incomplete_color(self):
class BaseTestCaseCache (line 50) | class BaseTestCaseCache:
method get_cache (line 51) | def get_cache(self, dbname=None):
method test_empty (line 54) | def test_empty(self):
method test_set_then_retrieve_blocks (line 60) | def test_set_then_retrieve_blocks(self):
method test_delitem (line 66) | def test_delitem(self):
method test_persistance (line 74) | def test_persistance(self, tmpdir):
method test_filter (line 82) | def test_filter(self):
method test_clear (line 93) | def test_clear(self):
method test_by_id (line 104) | def test_by_id(self):
class TestCaseSqliteCache (line 113) | class TestCaseSqliteCache(BaseTestCaseCache):
method get_cache (line 114) | def get_cache(self, dbname=None):
method test_corrupted_db (line 120) | def test_corrupted_db(self, tmpdir, monkeypatch):
class TestCaseCacheSQLEscape (line 136) | class TestCaseCacheSQLEscape:
method get_cache (line 137) | def get_cache(self):
method test_contains (line 140) | def test_contains(self):
method test_getitem (line 144) | def test_getitem(self):
method test_setitem (line 149) | def test_setitem(self):
method test_delitem (line 153) | def test_delitem(self):
FILE: core/tests/directories_test.py
function create_fake_fs (line 27) | def create_fake_fs(rootpath):
function setup_module (line 52) | def setup_module(module):
function teardown_module (line 64) | def teardown_module(module):
function test_empty (line 68) | def test_empty():
function test_add_path (line 74) | def test_add_path():
function test_add_path_when_path_is_already_there (line 88) | def test_add_path_when_path_is_already_there():
function test_add_path_containing_paths_already_there (line 99) | def test_add_path_containing_paths_already_there():
function test_add_path_non_latin (line 108) | def test_add_path_non_latin(tmpdir):
function test_del (line 119) | def test_del():
function test_states (line 132) | def test_states():
function test_get_state_with_path_not_there (line 145) | def test_get_state_with_path_not_there():
function test_states_overwritten_when_larger_directory_eat_smaller_ones (line 152) | def test_states_overwritten_when_larger_directory_eat_smaller_ones():
function test_get_files (line 166) | def test_get_files():
function test_get_files_with_folders (line 181) | def test_get_files_with_folders():
function test_get_folders (line 196) | def test_get_folders():
function test_get_files_with_inherited_exclusion (line 212) | def test_get_files_with_inherited_exclusion():
function test_save_and_load (line 220) | def test_save_and_load(tmpdir):
function test_invalid_path (line 239) | def test_invalid_path():
function test_set_state_on_invalid_path (line 247) | def test_set_state_on_invalid_path():
function test_load_from_file_with_invalid_path (line 260) | def test_load_from_file_with_invalid_path(tmpdir):
function test_unicode_save (line 277) | def test_unicode_save(tmpdir):
function test_get_files_refreshes_its_directories (line 291) | def test_get_files_refreshes_its_directories():
function test_get_files_does_not_choke_on_non_existing_directories (line 303) | def test_get_files_does_not_choke_on_non_existing_directories(tmpdir):
function test_get_state_returns_excluded_by_default_for_hidden_directories (line 311) | def test_get_state_returns_excluded_by_default_for_hidden_directories(tm...
function test_default_path_state_override (line 323) | def test_default_path_state_override(tmpdir):
class TestExcludeList (line 347) | class TestExcludeList:
method setup_method (line 348) | def setup_method(self, method):
method get_files_and_expect_num_result (line 351) | def get_files_and_expect_num_result(self, num_result):
method test_exclude_recycle_bin_by_default (line 364) | def test_exclude_recycle_bin_by_default(self, tmpdir):
method test_exclude_refined (line 378) | def test_exclude_refined(self, tmpdir):
method test_japanese_unicode (line 500) | def test_japanese_unicode(self, tmpdir):
method test_get_state_returns_excluded_for_hidden_directories_and_files (line 530) | def test_get_state_returns_excluded_for_hidden_directories_and_files(s...
class TestExcludeDict (line 554) | class TestExcludeDict(TestExcludeList):
method setup_method (line 555) | def setup_method(self, method):
class TestExcludeListunion (line 559) | class TestExcludeListunion(TestExcludeList):
method setup_method (line 560) | def setup_method(self, method):
class TestExcludeDictunion (line 564) | class TestExcludeDictunion(TestExcludeList):
method setup_method (line 565) | def setup_method(self, method):
FILE: core/tests/engine_test.py
function get_match_triangle (line 38) | def get_match_triangle():
function get_test_group (line 48) | def get_test_group():
function assert_match (line 57) | def assert_match(m, name1, name2):
class TestCasegetwords (line 67) | class TestCasegetwords:
method test_spaces (line 68) | def test_spaces(self):
method test_unicode (line 72) | def test_unicode(self):
method test_splitter_chars (line 79) | def test_splitter_chars(self):
method test_joiner_chars (line 85) | def test_joiner_chars(self):
method test_empty (line 88) | def test_empty(self):
method test_returns_lowercase (line 91) | def test_returns_lowercase(self):
method test_decompose_unicode (line 94) | def test_decompose_unicode(self):
class TestCasegetfields (line 98) | class TestCasegetfields:
method test_simple (line 99) | def test_simple(self):
method test_empty (line 102) | def test_empty(self):
method test_cleans_empty_fields (line 105) | def test_cleans_empty_fields(self):
class TestCaseUnpackFields (line 111) | class TestCaseUnpackFields:
method test_with_fields (line 112) | def test_with_fields(self):
method test_without_fields (line 117) | def test_without_fields(self):
method test_empty (line 122) | def test_empty(self):
class TestCaseWordCompare (line 126) | class TestCaseWordCompare:
method test_list (line 127) | def test_list(self):
method test_unordered (line 131) | def test_unordered(self):
method test_word_occurs_twice (line 137) | def test_word_occurs_twice(self):
method test_uses_copy_of_lists (line 141) | def test_uses_copy_of_lists(self):
method test_word_weight (line 148) | def test_word_weight(self):
method test_similar_words (line 154) | def test_similar_words(self):
method test_empty (line 164) | def test_empty(self):
method test_with_fields (line 167) | def test_with_fields(self):
method test_propagate_flags_with_fields (line 170) | def test_propagate_flags_with_fields(self, monkeypatch):
class TestCaseWordCompareWithFields (line 178) | class TestCaseWordCompareWithFields:
method test_simple (line 179) | def test_simple(self):
method test_empty (line 185) | def test_empty(self):
method test_different_length (line 188) | def test_different_length(self):
method test_propagates_flags (line 191) | def test_propagates_flags(self, monkeypatch):
method test_order (line 198) | def test_order(self):
method test_no_order (line 203) | def test_no_order(self):
method test_compare_fields_without_order_doesnt_alter_fields (line 214) | def test_compare_fields_without_order_doesnt_alter_fields(self):
class TestCaseBuildWordDict (line 223) | class TestCaseBuildWordDict:
method test_with_standard_words (line 224) | def test_with_standard_words(self):
method test_unpack_fields (line 242) | def test_unpack_fields(self):
method test_words_are_unaltered (line 249) | def test_words_are_unaltered(self):
method test_object_instances_can_only_be_once_in_words_object_list (line 255) | def test_object_instances_can_only_be_once_in_words_object_list(self):
method test_job (line 260) | def test_job(self):
class TestCaseMergeSimilarWords (line 274) | class TestCaseMergeSimilarWords:
method test_some_similar_words (line 275) | def test_some_similar_words(self):
class TestCaseReduceCommonWords (line 286) | class TestCaseReduceCommonWords:
method test_typical (line 287) | def test_typical(self):
method test_dont_remove_objects_with_only_common_words (line 296) | def test_dont_remove_objects_with_only_common_words(self):
method test_values_still_are_set_instances (line 305) | def test_values_still_are_set_instances(self):
method test_dont_raise_keyerror_when_a_word_has_been_removed (line 314) | def test_dont_raise_keyerror_when_a_word_has_been_removed(self):
method test_unpack_fields (line 327) | def test_unpack_fields(self):
method test_consider_a_reduced_common_word_common_even_after_reduction (line 340) | def test_consider_a_reduced_common_word_common_even_after_reduction(se...
class TestCaseGetMatch (line 357) | class TestCaseGetMatch:
method test_simple (line 358) | def test_simple(self):
method test_in (line 368) | def test_in(self):
method test_word_weight (line 376) | def test_word_weight(self):
class TestCaseGetMatches (line 381) | class TestCaseGetMatches:
method test_empty (line 382) | def test_empty(self):
method test_simple (line 385) | def test_simple(self):
method test_null_and_unrelated_objects (line 398) | def test_null_and_unrelated_objects(self):
method test_twice_the_same_word (line 411) | def test_twice_the_same_word(self):
method test_twice_the_same_word_when_preworded (line 416) | def test_twice_the_same_word_when_preworded(self):
method test_two_words_match (line 421) | def test_two_words_match(self):
method test_match_files_with_only_common_words (line 426) | def test_match_files_with_only_common_words(self):
method test_use_words_already_there_if_there (line 435) | def test_use_words_already_there_if_there(self):
method test_job (line 441) | def test_job(self):
method test_weight_words (line 454) | def test_weight_words(self):
method test_similar_word (line 459) | def test_similar_word(self):
method test_single_object_with_similar_words (line 470) | def test_single_object_with_similar_words(self):
method test_double_words_get_counted_only_once (line 474) | def test_double_words_get_counted_only_once(self):
method test_with_fields (line 479) | def test_with_fields(self):
method test_with_fields_no_order (line 487) | def test_with_fields_no_order(self):
method test_only_match_similar_when_the_option_is_set (line 495) | def test_only_match_similar_when_the_option_is_set(self):
method test_dont_recurse_do_match (line 499) | def test_dont_recurse_do_match(self):
method test_min_match_percentage (line 510) | def test_min_match_percentage(self):
method test_memory_error (line 519) | def test_memory_error(self, monkeypatch):
class TestCaseGetMatchesByContents (line 535) | class TestCaseGetMatchesByContents:
method test_big_file_partial_hashing (line 536) | def test_big_file_partial_hashing(self):
class TestCaseGroup (line 563) | class TestCaseGroup:
method test_empty (line 564) | def test_empty(self):
method test_add_match (line 570) | def test_add_match(self):
method test_multiple_add_match (line 579) | def test_multiple_add_match(self):
method test_len (line 605) | def test_len(self):
method test_add_same_match_twice (line 611) | def test_add_same_match_twice(self):
method test_in (line 621) | def test_in(self):
method test_remove (line 630) | def test_remove(self):
method test_remove_with_ref_dupes (line 647) | def test_remove_with_ref_dupes(self):
method test_switch_ref (line 660) | def test_switch_ref(self):
method test_switch_ref_from_ref_dir (line 674) | def test_switch_ref_from_ref_dir(self):
method test_get_match_of (line 684) | def test_get_match_of(self):
method test_percentage (line 695) | def test_percentage(self):
method test_percentage_on_empty_group (line 714) | def test_percentage_on_empty_group(self):
method test_prioritize (line 718) | def test_prioritize(self):
method test_prioritize_with_tie_breaker (line 734) | def test_prioritize_with_tie_breaker(self):
method test_prioritize_with_tie_breaker_runs_on_all_dupes (line 741) | def test_prioritize_with_tie_breaker_runs_on_all_dupes(self):
method test_prioritize_with_tie_breaker_runs_only_on_tie_dupes (line 752) | def test_prioritize_with_tie_breaker_runs_only_on_tie_dupes(self):
method test_prioritize_with_ref_dupe (line 765) | def test_prioritize_with_ref_dupe(self):
method test_prioritize_nothing_changes (line 774) | def test_prioritize_nothing_changes(self):
method test_list_like (line 782) | def test_list_like(self):
method test_discard_matches (line 789) | def test_discard_matches(self):
class TestCaseGetGroups (line 803) | class TestCaseGetGroups:
method test_empty (line 804) | def test_empty(self):
method test_simple (line 808) | def test_simple(self):
method test_group_with_multiple_matches (line 818) | def test_group_with_multiple_matches(self):
method test_must_choose_a_group (line 827) | def test_must_choose_a_group(self):
method test_should_all_go_in_the_same_group (line 842) | def test_should_all_go_in_the_same_group(self):
method test_give_priority_to_matches_with_higher_percentage (line 855) | def test_give_priority_to_matches_with_higher_percentage(self):
method test_four_sized_group (line 869) | def test_four_sized_group(self):
method test_referenced_by_ref2 (line 876) | def test_referenced_by_ref2(self):
method test_group_admissible_discarded_dupes (line 886) | def test_group_admissible_discarded_dupes(self):
FILE: core/tests/exclude_test.py
class TestCaseListXMLLoading (line 23) | class TestCaseListXMLLoading:
method setup_method (line 24) | def setup_method(self, method):
method test_load_non_existant_file (line 27) | def test_load_non_existant_file(self):
method test_save_to_xml (line 34) | def test_save_to_xml(self):
method test_save_and_load (line 42) | def test_save_and_load(self, tmpdir):
method test_load_xml_with_garbage_and_missing_elements (line 58) | def test_load_xml_with_garbage_and_missing_elements(self):
class TestCaseDictXMLLoading (line 89) | class TestCaseDictXMLLoading(TestCaseListXMLLoading):
method setup_method (line 90) | def setup_method(self, method):
class TestCaseListEmpty (line 94) | class TestCaseListEmpty:
method setup_method (line 95) | def setup_method(self, method):
method test_add_mark_and_remove_regex (line 100) | def test_add_mark_and_remove_regex(self):
method test_add_duplicate (line 116) | def test_add_duplicate(self):
method test_add_not_compilable (line 125) | def test_add_not_compilable(self):
method test_force_add_not_compilable (line 140) | def test_force_add_not_compilable(self):
method test_rename_regex (line 160) | def test_rename_regex(self):
method test_rename_regex_file_to_path (line 184) | def test_rename_regex_file_to_path(self):
method test_restore_default (line 206) | def test_restore_default(self):
class TestCaseListEmptyUnion (line 230) | class TestCaseListEmptyUnion(TestCaseListEmpty):
method setup_method (line 233) | def setup_method(self, method):
method test_add_mark_and_remove_regex (line 238) | def test_add_mark_and_remove_regex(self):
method test_rename_regex_file_to_path (line 255) | def test_rename_regex_file_to_path(self):
method test_restore_default (line 279) | def test_restore_default(self):
class TestCaseDictEmpty (line 298) | class TestCaseDictEmpty(TestCaseListEmpty):
method setup_method (line 301) | def setup_method(self, method):
class TestCaseDictEmptyUnion (line 307) | class TestCaseDictEmptyUnion(TestCaseDictEmpty):
method setup_method (line 310) | def setup_method(self, method):
method test_add_mark_and_remove_regex (line 315) | def test_add_mark_and_remove_regex(self):
method test_rename_regex_file_to_path (line 332) | def test_rename_regex_file_to_path(self):
method test_restore_default (line 356) | def test_restore_default(self):
function split_union (line 375) | def split_union(pattern_object):
class TestCaseCompiledList (line 380) | class TestCaseCompiledList:
method setup_method (line 383) | def setup_method(self, method):
method test_same_number_of_expressions (line 389) | def test_same_number_of_expressions(self):
method test_compiled_files (line 400) | def test_compiled_files(self):
class TestCaseCompiledDict (line 428) | class TestCaseCompiledDict(TestCaseCompiledList):
method setup_method (line 431) | def setup_method(self, method):
FILE: core/tests/fs_test.py
function create_fake_fs_with_random_data (line 29) | def create_fake_fs_with_random_data(rootpath):
function test_size_aggregates_subfiles (line 53) | def test_size_aggregates_subfiles(tmpdir):
function test_digest_aggregate_subfiles_sorted (line 59) | def test_digest_aggregate_subfiles_sorted(tmpdir):
function test_partial_digest_aggregate_subfile_sorted (line 79) | def test_partial_digest_aggregate_subfile_sorted(tmpdir):
function test_has_file_attrs (line 109) | def test_has_file_attrs(tmpdir):
FILE: core/tests/ignore_test.py
function test_empty (line 16) | def test_empty():
function test_simple (line 22) | def test_simple():
function test_multiple (line 32) | def test_multiple():
function test_clear (line 46) | def test_clear():
function test_add_same_twice (line 55) | def test_add_same_twice():
function test_save_to_xml (line 62) | def test_save_to_xml():
function test_save_then_load (line 80) | def test_save_then_load():
function test_load_xml_with_empty_file_tags (line 95) | def test_load_xml_with_empty_file_tags():
function test_are_ignore_works_when_a_child_is_a_key_somewhere_else (line 104) | def test_are_ignore_works_when_a_child_is_a_key_somewhere_else():
function test_no_dupes_when_a_child_is_a_key_somewhere_else (line 111) | def test_no_dupes_when_a_child_is_a_key_somewhere_else():
function test_iterate (line 119) | def test_iterate():
function test_filter (line 130) | def test_filter():
function test_save_with_non_ascii_items (line 141) | def test_save_with_non_ascii_items():
function test_len (line 151) | def test_len():
function test_nonzero (line 158) | def test_nonzero():
function test_remove (line 165) | def test_remove():
function test_remove_non_existant (line 174) | def test_remove_non_existant():
FILE: core/tests/markable_test.py
function gen (line 12) | def gen():
function test_unmarked (line 18) | def test_unmarked():
function test_mark (line 24) | def test_mark():
function test_unmark (line 31) | def test_unmark():
function test_unmark_unmarked (line 38) | def test_unmark_unmarked():
function test_mark_twice_and_unmark (line 44) | def test_mark_twice_and_unmark():
function test_mark_toggle (line 52) | def test_mark_toggle():
function test_is_markable (line 62) | def test_is_markable():
function test_change_notifications (line 80) | def test_change_notifications():
function test_mark_count (line 99) | def test_mark_count():
function test_mark_none (line 108) | def test_mark_none():
function test_mark_all (line 120) | def test_mark_all():
function test_mark_invert (line 128) | def test_mark_invert():
function test_mark_while_inverted (line 136) | def test_mark_while_inverted():
function test_remove_mark_flag (line 153) | def test_remove_mark_flag():
function test_is_marked_returns_false_if_object_not_markable (line 165) | def test_is_marked_returns_false_if_object_not_markable():
FILE: core/tests/prioritize_test.py
function app_with_dupes (line 18) | def app_with_dupes(dupes):
function app_normal_results (line 35) | def app_normal_results():
function test_kind_subcrit (line 47) | def test_kind_subcrit(app):
function test_kind_reprioritization (line 54) | def test_kind_reprioritization(app):
function test_folder_subcrit (line 65) | def test_folder_subcrit(app):
function test_folder_reprioritization (line 71) | def test_folder_reprioritization(app):
function test_prilist_display (line 80) | def test_prilist_display(app):
function test_size_subcrit (line 100) | def test_size_subcrit(app):
function test_size_reprioritization (line 106) | def test_size_reprioritization(app):
function test_reorder_prioritizations (line 115) | def test_reorder_prioritizations(app):
function test_remove_crit_from_list (line 127) | def test_remove_crit_from_list(app):
function test_add_crit_without_selection (line 139) | def test_add_crit_without_selection(app):
function app_one_name_ends_with_number (line 145) | def app_one_name_ends_with_number():
function test_filename_reprioritization (line 153) | def test_filename_reprioritization(app):
function app_with_subfolders (line 160) | def app_with_subfolders():
function test_folder_crit_is_sorted (line 169) | def test_folder_crit_is_sorted(app):
function test_folder_crit_includes_subfolders (line 176) | def test_folder_crit_includes_subfolders(app):
function test_display_something_on_empty_extensions (line 187) | def test_display_something_on_empty_extensions(app):
function app_one_name_longer_than_the_other (line 194) | def app_one_name_longer_than_the_other():
function test_longest_filename_prioritization (line 202) | def test_longest_filename_prioritization(app):
FILE: core/tests/result_table_test.py
function app_with_results (line 12) | def app_with_results():
function test_delta_flags_delta_mode_off (line 20) | def test_delta_flags_delta_mode_off():
function test_delta_flags_delta_mode_on_delta_columns (line 30) | def test_delta_flags_delta_mode_on_delta_columns():
function test_delta_flags_delta_mode_on_non_delta_columns (line 40) | def test_delta_flags_delta_mode_on_non_delta_columns():
function test_delta_flags_delta_mode_on_non_delta_columns_case_insensitive (line 53) | def test_delta_flags_delta_mode_on_non_delta_columns_case_insensitive():
FILE: core/tests/results_test.py
class TestCaseResultsEmpty (line 20) | class TestCaseResultsEmpty:
method setup_method (line 21) | def setup_method(self, method):
method test_apply_invalid_filter (line 25) | def test_apply_invalid_filter(self):
method test_stat_line (line 30) | def test_stat_line(self):
method test_groups (line 33) | def test_groups(self):
method test_get_group_of_duplicate (line 36) | def test_get_group_of_duplicate(self):
method test_save_to_xml (line 39) | def test_save_to_xml(self):
method test_is_modified (line 47) | def test_is_modified(self):
method test_is_modified_after_setting_empty_group (line 50) | def test_is_modified_after_setting_empty_group(self):
method test_save_to_same_name_as_folder (line 55) | def test_save_to_same_name_as_folder(self, tmpdir):
class TestCaseResultsWithSomeGroups (line 68) | class TestCaseResultsWithSomeGroups:
method setup_method (line 69) | def setup_method(self, method):
method test_stat_line (line 75) | def test_stat_line(self):
method test_groups (line 78) | def test_groups(self):
method test_get_group_of_duplicate (line 81) | def test_get_group_of_duplicate(self):
method test_remove_duplicates (line 88) | def test_remove_duplicates(self):
method test_remove_duplicates_with_ref_files (line 104) | def test_remove_duplicates_with_ref_files(self):
method test_make_ref (line 112) | def test_make_ref(self):
method test_sort_groups (line 118) | def test_sort_groups(self):
method test_set_groups_when_sorted (line 128) | def test_set_groups_when_sorted(self):
method test_get_dupe_list (line 138) | def test_get_dupe_list(self):
method test_dupe_list_is_cached (line 141) | def test_dupe_list_is_cached(self):
method test_dupe_list_cache_is_invalidated_when_needed (line 144) | def test_dupe_list_cache_is_invalidated_when_needed(self):
method test_dupe_list_sort (line 154) | def test_dupe_list_sort(self):
method test_dupe_list_remember_sort (line 166) | def test_dupe_list_remember_sort(self):
method test_dupe_list_sort_delta_values (line 177) | def test_dupe_list_sort_delta_values(self):
method test_sort_empty_list (line 187) | def test_sort_empty_list(self):
method test_dupe_list_update_on_remove_duplicates (line 194) | def test_dupe_list_update_on_remove_duplicates(self):
method test_is_modified (line 200) | def test_is_modified(self):
method test_is_modified_after_save_and_load (line 204) | def test_is_modified_after_save_and_load(self):
method test_is_modified_after_removing_all_results (line 217) | def test_is_modified_after_removing_all_results(self):
method test_group_of_duplicate_after_removal (line 223) | def test_group_of_duplicate_after_removal(self):
method test_dupe_list_sort_delta_values_nonnumeric (line 232) | def test_dupe_list_sort_delta_values_nonnumeric(self):
method test_dupe_list_sort_delta_values_nonnumeric_case_insensitive (line 242) | def test_dupe_list_sort_delta_values_nonnumeric_case_insensitive(self):
class TestCaseResultsWithSavedResults (line 251) | class TestCaseResultsWithSavedResults:
method setup_method (line 252) | def setup_method(self, method):
method test_is_modified (line 261) | def test_is_modified(self):
method test_is_modified_after_load (line 265) | def test_is_modified_after_load(self):
method test_is_modified_after_remove (line 274) | def test_is_modified_after_remove(self):
method test_is_modified_after_make_ref (line 279) | def test_is_modified_after_make_ref(self):
class TestCaseResultsMarkings (line 285) | class TestCaseResultsMarkings:
method setup_method (line 286) | def setup_method(self, method):
method test_stat_line (line 292) | def test_stat_line(self):
method test_with_ref_duplicate (line 308) | def test_with_ref_duplicate(self):
method test_perform_on_marked (line 315) | def test_perform_on_marked(self):
method test_perform_on_marked_with_problems (line 335) | def test_perform_on_marked_with_problems(self):
method test_perform_on_marked_with_ref (line 356) | def test_perform_on_marked_with_ref(self):
method test_perform_on_marked_remove_objects_only_at_the_end (line 372) | def test_perform_on_marked_remove_objects_only_at_the_end(self):
method test_remove_duplicates (line 385) | def test_remove_duplicates(self):
method test_make_ref (line 394) | def test_make_ref(self):
method test_save_xml (line 404) | def test_save_xml(self):
method test_load_xml (line 421) | def test_load_xml(self):
class TestCaseResultsXML (line 441) | class TestCaseResultsXML:
method setup_method (line 442) | def setup_method(self, method):
method get_file (line 448) | def get_file(self, path): # use this as a callback for load_from_xml
method test_save_to_xml (line 451) | def test_save_to_xml(self):
method test_load_xml (line 487) | def test_load_xml(self):
method test_load_xml_with_filename (line 519) | def test_load_xml_with_filename(self, tmpdir):
method test_load_xml_with_some_files_that_dont_exist_anymore (line 531) | def test_load_xml_with_some_files_that_dont_exist_anymore(self):
method test_load_xml_missing_attributes_and_bogus_elements (line 547) | def test_load_xml_missing_attributes_and_bogus_elements(self):
method test_xml_non_ascii (line 588) | def test_xml_non_ascii(self):
method test_load_invalid_xml (line 613) | def test_load_invalid_xml(self):
method test_load_non_existant_xml (line 623) | def test_load_non_existant_xml(self):
method test_remember_match_percentage (line 630) | def test_remember_match_percentage(self):
method test_save_and_load (line 655) | def test_save_and_load(self):
method test_apply_filter_works_on_paths (line 663) | def test_apply_filter_works_on_paths(self):
method test_save_xml_with_invalid_characters (line 668) | def test_save_xml_with_invalid_characters(self):
class TestCaseResultsFilter (line 674) | class TestCaseResultsFilter:
method setup_method (line 675) | def setup_method(self, method):
method test_groups (line 682) | def test_groups(self):
method test_dupes (line 686) | def test_dupes(self):
method test_cancel_filter (line 691) | def test_cancel_filter(self):
method test_dupes_reconstructed_filtered (line 696) | def test_dupes_reconstructed_filtered(self):
method test_include_ref_dupes_in_filter (line 703) | def test_include_ref_dupes_in_filter(self):
method test_filters_build_on_one_another (line 710) | def test_filters_build_on_one_another(self):
method test_stat_line (line 715) | def test_stat_line(self):
method test_mark_count_is_filtered_as_well (line 725) | def test_mark_count_is_filtered_as_well(self):
method test_mark_all_only_affects_filtered_items (line 734) | def test_mark_all_only_affects_filtered_items(self):
method test_sort_groups (line 741) | def test_sort_groups(self):
method test_set_group (line 757) | def test_set_group(self):
method test_load_cancels_filter (line 764) | def test_load_cancels_filter(self, tmpdir):
method test_remove_dupe (line 777) | def test_remove_dupe(self):
method test_filter_is_case_insensitive (line 788) | def test_filter_is_case_insensitive(self):
method test_make_ref_on_filtered_out_doesnt_mess_stats (line 793) | def test_make_ref_on_filtered_out_doesnt_mess_stats(self):
class TestCaseResultsRefFile (line 808) | class TestCaseResultsRefFile:
method setup_method (line 809) | def setup_method(self, method):
method test_stat_line (line 817) | def test_stat_line(self):
FILE: core/tests/scanner_test.py
class NamedObject (line 21) | class NamedObject:
method __init__ (line 22) | def __init__(self, name="foobar", size=1, path=None):
method __repr__ (line 32) | def __repr__(self):
method exists (line 35) | def exists(self):
function fake_fileexists (line 43) | def fake_fileexists(request):
function test_empty (line 50) | def test_empty(fake_fileexists):
function test_default_settings (line 56) | def test_default_settings(fake_fileexists):
function test_simple_with_default_settings (line 68) | def test_simple_with_default_settings(fake_fileexists):
function test_simple_with_lower_min_match (line 80) | def test_simple_with_lower_min_match(fake_fileexists):
function test_trim_all_ref_groups (line 90) | def test_trim_all_ref_groups(fake_fileexists):
function test_prioritize (line 107) | def test_prioritize(fake_fileexists):
function test_content_scan (line 126) | def test_content_scan(fake_fileexists):
function test_content_scan_compare_sizes_first (line 139) | def test_content_scan_compare_sizes_first(fake_fileexists):
function test_ignore_file_size (line 151) | def test_ignore_file_size(fake_fileexists):
function test_big_file_partial_hashes (line 195) | def test_big_file_partial_hashes(fake_fileexists):
function test_min_match_perc_doesnt_matter_for_content_scan (line 224) | def test_min_match_perc_doesnt_matter_for_content_scan(fake_fileexists):
function test_content_scan_doesnt_put_digest_in_words_at_the_end (line 241) | def test_content_scan_doesnt_put_digest_in_words_at_the_end(fake_fileexi...
function test_extension_is_not_counted_in_filename_scan (line 256) | def test_extension_is_not_counted_in_filename_scan(fake_fileexists):
function test_job (line 265) | def test_job(fake_fileexists):
function test_mix_file_kind (line 278) | def test_mix_file_kind(fake_fileexists):
function test_word_weighting (line 286) | def test_word_weighting(fake_fileexists):
function test_similar_words (line 298) | def test_similar_words(fake_fileexists):
function test_fields (line 311) | def test_fields(fake_fileexists):
function test_fields_no_order (line 319) | def test_fields_no_order(fake_fileexists):
function test_tag_scan (line 327) | def test_tag_scan(fake_fileexists):
function test_tag_with_album_scan (line 340) | def test_tag_with_album_scan(fake_fileexists):
function test_that_dash_in_tags_dont_create_new_fields (line 360) | def test_that_dash_in_tags_dont_create_new_fields(fake_fileexists):
function test_tag_scan_with_different_scanned (line 377) | def test_tag_scan_with_different_scanned(fake_fileexists):
function test_tag_scan_only_scans_existing_tags (line 395) | def test_tag_scan_only_scans_existing_tags(fake_fileexists):
function test_tag_scan_converts_to_str (line 409) | def test_tag_scan_converts_to_str(fake_fileexists):
function test_tag_scan_non_ascii (line 424) | def test_tag_scan_non_ascii(fake_fileexists):
function test_ignore_list (line 439) | def test_ignore_list(fake_fileexists):
function test_ignore_list_checks_for_unicode (line 461) | def test_ignore_list_checks_for_unicode(fake_fileexists):
function test_file_evaluates_to_false (line 483) | def test_file_evaluates_to_false(fake_fileexists):
function test_size_threshold (line 497) | def test_size_threshold(fake_fileexists):
function test_tie_breaker_path_deepness (line 513) | def test_tie_breaker_path_deepness(fake_fileexists):
function test_tie_breaker_copy (line 523) | def test_tie_breaker_copy(fake_fileexists):
function test_tie_breaker_same_name_plus_digit (line 533) | def test_tie_breaker_same_name_plus_digit(fake_fileexists):
function test_partial_group_match (line 553) | def test_partial_group_match(fake_fileexists):
function test_dont_group_files_that_dont_exist (line 571) | def test_dont_group_files_that_dont_exist(tmpdir):
function test_folder_scan_exclude_subfolder_matches (line 594) | def test_folder_scan_exclude_subfolder_matches(fake_fileexists):
function test_ignore_files_with_same_path (line 619) | def test_ignore_files_with_same_path(fake_fileexists):
function test_dont_count_ref_files_as_discarded (line 628) | def test_dont_count_ref_files_as_discarded(fake_fileexists):
function test_prioritize_me (line 646) | def test_prioritize_me(fake_fileexists):
FILE: core/util.py
function format_timestamp (line 20) | def format_timestamp(t, delta):
function format_words (line 30) | def format_words(w):
function format_perc (line 40) | def format_perc(p):
function format_dupe_count (line 44) | def format_dupe_count(c):
function cmp_value (line 48) | def cmp_value(dupe, attrname):
function fix_surrogate_encoding (line 53) | def fix_surrogate_encoding(s, encoding="utf-8"):
function executable_folder (line 71) | def executable_folder():
function check_for_update (line 75) | def check_for_update(current_version: str, include_prerelease: bool = Fa...
FILE: hscommon/build.py
function print_and_do (line 29) | def print_and_do(cmd: str) -> int:
function _perform (line 36) | def _perform(src: os.PathLike, dst: os.PathLike, action: Callable, actio...
function copy_file_or_folder (line 49) | def copy_file_or_folder(src: os.PathLike, dst: os.PathLike) -> None:
function move (line 56) | def move(src: os.PathLike, dst: os.PathLike) -> None:
function copy (line 60) | def copy(src: os.PathLike, dst: os.PathLike) -> None:
function _perform_on_all (line 64) | def _perform_on_all(pattern: AnyStr, dst: os.PathLike, action: Callable)...
function move_all (line 73) | def move_all(pattern: AnyStr, dst: os.PathLike) -> None:
function copy_all (line 77) | def copy_all(pattern: AnyStr, dst: os.PathLike) -> None:
function filereplace (line 81) | def filereplace(filename: os.PathLike, outfilename: Union[os.PathLike, N...
function get_module_version (line 96) | def get_module_version(modulename: str) -> str:
function setup_package_argparser (line 101) | def setup_package_argparser(parser: ArgumentParser):
function package_cocoa_app_in_dmg (line 128) | def package_cocoa_app_in_dmg(app_path: os.PathLike, destfolder: os.PathL...
function build_dmg (line 144) | def build_dmg(app_path: os.PathLike, destfolder: os.PathLike) -> None:
function add_to_pythonpath (line 169) | def add_to_pythonpath(path: os.PathLike) -> None:
function copy_packages (line 182) | def copy_packages(
function build_debian_changelog (line 224) | def build_debian_changelog(
function read_changelog_file (line 284) | def read_changelog_file(filename: os.PathLike) -> List[Dict[str, Any]]:
function fix_qt_resource_file (line 311) | def fix_qt_resource_file(path: os.PathLike) -> None:
FILE: hscommon/conflict.py
function get_conflicted_name (line 27) | def get_conflicted_name(other_names: List[str], name: str) -> str:
function get_unconflicted_name (line 44) | def get_unconflicted_name(name: str) -> str:
function is_conflicted (line 52) | def is_conflicted(name: str) -> bool:
function _smart_move_or_copy (line 57) | def _smart_move_or_copy(operation: Callable, source_path: Path, dest_pat...
function smart_move (line 69) | def smart_move(source_path: Path, dest_path: Path) -> None:
function smart_copy (line 74) | def smart_copy(source_path: Path, dest_path: Path) -> None:
FILE: hscommon/desktop.py
class SpecialFolder (line 15) | class SpecialFolder(Enum):
function open_url (line 20) | def open_url(url: str) -> None:
function open_path (line 25) | def open_path(path: PathLike) -> None:
function reveal_path (line 30) | def reveal_path(path: PathLike) -> None:
function special_folder_path (line 35) | def special_folder_path(special_folder: SpecialFolder, portable: bool = ...
function _open_url (line 54) | def _open_url(url: str) -> None:
function _open_path (line 57) | def _open_path(path: str) -> None:
function _reveal_path (line 61) | def _reveal_path(path: str) -> None:
function _special_folder_path (line 69) | def _special_folder_path(special_folder: SpecialFolder, portable: bool =...
function _open_url (line 84) | def _open_url(url: str) -> None:
function _open_path (line 88) | def _open_path(path: str) -> None:
function _reveal_path (line 92) | def _reveal_path(path: str) -> None:
function _special_folder_path (line 96) | def _special_folder_path(special_folder: SpecialFolder, portable: bool =...
FILE: hscommon/gui/base.py
function noop (line 8) | def noop(*args, **kwargs):
class NoopGUI (line 12) | class NoopGUI:
method __getattr__ (line 13) | def __getattr__(self, func_name):
class GUIObject (line 17) | class GUIObject:
method __init__ (line 39) | def __init__(self, multibind: bool = False) -> None:
method _view_updated (line 43) | def _view_updated(self) -> None:
method has_view (line 51) | def has_view(self) -> bool:
method view (line 55) | def view(self):
method view (line 70) | def view(self, value) -> None:
FILE: hscommon/gui/column.py
class Column (line 16) | class Column:
method __init__ (line 22) | def __init__(self, name: str, display: str = "", visible: bool = True,...
class ColumnsView (line 48) | class ColumnsView:
method restore_columns (line 57) | def restore_columns(self) -> None:
method set_column_visible (line 64) | def set_column_visible(self, colname: str, visible: bool) -> None:
class PrefAccessInterface (line 72) | class PrefAccessInterface:
method get_default (line 78) | def get_default(self, key: str, fallback_value: Union[Any, None]) -> Any:
method set_default (line 84) | def set_default(self, key: str, value: Any) -> None:
class Columns (line 88) | class Columns(GUIObject):
method __init__ (line 109) | def __init__(self, table: GUITable, prefaccess=None, savename: Union[s...
method _get_colname_attr (line 122) | def _get_colname_attr(self, colname: str, attrname: str, default: Any)...
method _set_colname_attr (line 128) | def _set_colname_attr(self, colname: str, attrname: str, value: Any) -...
method _optional_columns (line 135) | def _optional_columns(self) -> List[Column]:
method _view_updated (line 139) | def _view_updated(self) -> None:
method column_by_index (line 143) | def column_by_index(self, index: int):
method column_by_name (line 147) | def column_by_name(self, name: str):
method columns_count (line 151) | def columns_count(self) -> int:
method column_display (line 155) | def column_display(self, colname: str) -> str:
method column_is_visible (line 159) | def column_is_visible(self, colname: str) -> bool:
method column_width (line 163) | def column_width(self, colname: str) -> int:
method columns_to_right (line 167) | def columns_to_right(self, colname: str) -> List[str]:
method menu_items (line 177) | def menu_items(self) -> List[Tuple[str, bool]]:
method move_column (line 189) | def move_column(self, colname: str, index: int) -> None:
method reset_to_defaults (line 200) | def reset_to_defaults(self) -> None:
method resize_column (line 208) | def resize_column(self, colname: str, newwidth: int) -> None:
method restore_columns (line 212) | def restore_columns(self) -> None:
method save_columns (line 231) | def save_columns(self) -> None:
method set_column_order (line 243) | def set_column_order(self, colnames) -> None:
method set_column_visible (line 253) | def set_column_visible(self, colname: str, visible: bool) -> None:
method set_default_width (line 259) | def set_default_width(self, colname: str, width: int) -> None:
method toggle_menu_item (line 263) | def toggle_menu_item(self, index: int) -> bool:
method ordered_columns (line 277) | def ordered_columns(self) -> List[Column]:
method colnames (line 282) | def colnames(self) -> List[str]:
FILE: hscommon/gui/progress_window.py
class ProgressWindowView (line 13) | class ProgressWindowView:
method show (line 24) | def show(self) -> None:
method close (line 27) | def close(self) -> None:
method set_progress (line 30) | def set_progress(self, progress: int) -> None:
class ProgressWindow (line 41) | class ProgressWindow(GUIObject, ThreadedJobPerformer):
method __init__ (line 64) | def __init__(
method cancel (line 81) | def cancel(self) -> None:
method pulse (line 89) | def pulse(self) -> None:
method run (line 119) | def run(self, jobid: str, title: str, target: Callable, args: Tuple = ...
FILE: hscommon/gui/selectable_list.py
class Selectable (line 14) | class Selectable(Sequence):
method __init__ (line 21) | def __init__(self):
method _check_selection_range (line 25) | def _check_selection_range(self):
method _update_selection (line 35) | def _update_selection(self):
method select (line 53) | def select(self, indexes):
method selected_index (line 67) | def selected_index(self):
method selected_index (line 78) | def selected_index(self, value):
method selected_indexes (line 82) | def selected_indexes(self):
method selected_indexes (line 93) | def selected_indexes(self, value):
class SelectableList (line 99) | class SelectableList(MutableSequence, Selectable):
method __init__ (line 105) | def __init__(self, items=None):
method __delitem__ (line 112) | def __delitem__(self, key):
method __getitem__ (line 117) | def __getitem__(self, key):
method __len__ (line 120) | def __len__(self):
method __setitem__ (line 123) | def __setitem__(self, key, value):
method append (line 128) | def append(self, item):
method insert (line 132) | def insert(self, index, item):
method remove (line 136) | def remove(self, row):
method _on_change (line 142) | def _on_change(self):
method search_by_prefix (line 149) | def search_by_prefix(self, prefix):
class GUISelectableListView (line 158) | class GUISelectableListView:
method refresh (line 167) | def refresh(self):
method update_selection (line 173) | def update_selection(self):
class GUISelectableList (line 180) | class GUISelectableList(SelectableList, GUIObject):
method __init__ (line 191) | def __init__(self, items=None):
method _view_updated (line 195) | def _view_updated(self):
method _update_selection (line 202) | def _update_selection(self):
method _on_change (line 209) | def _on_change(self):
FILE: hscommon/gui/table.py
class Table (line 18) | class Table(MutableSequence, Selectable):
method __init__ (line 34) | def __init__(self) -> None:
method __delitem__ (line 41) | def __delitem__(self, key):
method __getitem__ (line 50) | def __getitem__(self, key) -> Any:
method __len__ (line 53) | def __len__(self) -> int:
method __setitem__ (line 57) | def __setitem__(self, key, value: Any) -> None:
method append (line 60) | def append(self, item: "Row") -> None:
method insert (line 70) | def insert(self, index: int, item: "Row") -> None:
method remove (line 82) | def remove(self, row: "Row") -> None:
method sort_by (line 94) | def sort_by(self, column_name: str, desc: bool = False) -> None:
method footer (line 115) | def footer(self) -> Union["Row", None]:
method footer (line 138) | def footer(self, value: Union["Row", None]) -> None:
method header (line 146) | def header(self) -> Union["Row", None]:
method header (line 154) | def header(self, value: Union["Row", None]) -> None:
method row_count (line 162) | def row_count(self) -> int:
method rows (line 175) | def rows(self) -> List["Row"]:
method selected_row (line 189) | def selected_row(self) -> "Row":
method selected_row (line 200) | def selected_row(self, value: int) -> None:
method selected_rows (line 207) | def selected_rows(self) -> List["Row"]:
class GUITableView (line 215) | class GUITableView:
method refresh (line 229) | def refresh(self) -> None:
method start_editing (line 236) | def start_editing(self) -> None:
method stop_editing (line 242) | def stop_editing(self) -> None:
class GUITable (line 254) | class GUITable(Table, GUIObject):
method __init__ (line 270) | def __init__(self) -> None:
method _do_add (line 278) | def _do_add(self) -> Tuple["Row", int]:
method _do_delete (line 285) | def _do_delete(self) -> None:
method _fill (line 289) | def _fill(self) -> None:
method _is_edited_new (line 296) | def _is_edited_new(self) -> bool:
method _restore_selection (line 306) | def _restore_selection(self, previous_selection):
method add (line 325) | def add(self) -> None:
method can_edit_cell (line 344) | def can_edit_cell(self, column_name: str, row_index: int) -> bool:
method cancel_edits (line 356) | def cancel_edits(self) -> None:
method delete (line 374) | def delete(self) -> None:
method refresh (line 387) | def refresh(self, refresh_view: bool = True) -> None:
method save_edits (line 409) | def save_edits(self) -> None:
method sort_by (line 420) | def sort_by(self, column_name: str, desc: bool = False) -> None:
class Row (line 436) | class Row:
method __init__ (line 460) | def __init__(self, table: GUITable) -> None:
method _edit (line 464) | def _edit(self) -> None:
method can_edit (line 471) | def can_edit(self) -> bool:
method load (line 479) | def load(self) -> None:
method save (line 488) | def save(self) -> None:
method sort_key_for_column (line 497) | def sort_key_for_column(self, column_name: str) -> Any:
method can_edit_cell (line 510) | def can_edit_cell(self, column_name: str) -> bool:
method get_cell_value (line 540) | def get_cell_value(self, attrname: str) -> Any:
method set_cell_value (line 550) | def set_cell_value(self, attrname: str, value: Any) -> None:
FILE: hscommon/gui/text_field.py
class TextFieldView (line 12) | class TextFieldView:
method refresh (line 22) | def refresh(self):
class TextField (line 29) | class TextField(GUIObject):
method __init__ (line 41) | def __init__(self):
method _parse (line 47) | def _parse(self, text):
method _format (line 54) | def _format(self, value):
method _update (line 61) | def _update(self, newvalue):
method _view_updated (line 69) | def _view_updated(self):
method refresh (line 73) | def refresh(self):
method text (line 78) | def text(self):
method text (line 89) | def text(self, newtext):
method value (line 93) | def value(self):
method value (line 104) | def value(self, newvalue):
FILE: hscommon/gui/tree.py
class Node (line 12) | class Node(MutableSequence):
method __init__ (line 24) | def __init__(self, name):
method __repr__ (line 30) | def __repr__(self):
method __delitem__ (line 34) | def __delitem__(self, key):
method __getitem__ (line 37) | def __getitem__(self, key):
method __len__ (line 40) | def __len__(self):
method __setitem__ (line 43) | def __setitem__(self, key, value):
method append (line 46) | def append(self, node):
method insert (line 51) | def insert(self, index, node):
method clear (line 57) | def clear(self):
method find (line 61) | def find(self, predicate, include_self=True):
method findall (line 71) | def findall(self, predicate, include_self=True):
method get_node (line 82) | def get_node(self, index_path):
method get_path (line 93) | def get_path(self, target_node):
method children_count (line 103) | def children_count(self):
method name (line 108) | def name(self):
method parent (line 113) | def parent(self):
method path (line 121) | def path(self):
method root (line 136) | def root(self):
class Tree (line 147) | class Tree(Node, GUIObject):
method __init__ (line 159) | def __init__(self):
method _select_nodes (line 166) | def _select_nodes(self, nodes):
method _view_updated (line 174) | def _view_updated(self):
method clear (line 177) | def clear(self):
method selected_node (line 183) | def selected_node(self):
method selected_node (line 193) | def selected_node(self, node):
method selected_nodes (line 200) | def selected_nodes(self):
method selected_nodes (line 211) | def selected_nodes(self, nodes):
method selected_path (line 215) | def selected_path(self):
method selected_path (line 225) | def selected_path(self, index_path):
method selected_paths (line 232) | def selected_paths(self):
method selected_paths (line 242) | def selected_paths(self, index_paths):
FILE: hscommon/jobprogress/job.py
class JobCancelled (line 13) | class JobCancelled(Exception):
class JobInProgressError (line 17) | class JobInProgressError(Exception):
class JobCountError (line 21) | class JobCountError(Exception):
class Job (line 25) | class Job:
method __init__ (line 42) | def __init__(self, job_proportions: Union[List[int], int], callback: C...
method _subjob_callback (line 61) | def _subjob_callback(self, progress: int, desc: str = "") -> bool:
method _do_update (line 66) | def _do_update(self, desc: str) -> None:
method add_progress (line 84) | def add_progress(self, progress: int = 1, desc: str = "") -> None:
method check_if_cancelled (line 87) | def check_if_cancelled(self) -> None:
method iter_with_progress (line 91) | def iter_with_progress(
method start_job (line 116) | def start_job(self, max_progress: int = 100, desc: str = "") -> None:
method start_subjob (line 131) | def start_subjob(self, job_proportions: Union[List[int], int], desc: s...
method set_progress (line 141) | def set_progress(self, progress: int, desc: str = "") -> None:
class NullJob (line 151) | class NullJob(Job):
method __init__ (line 152) | def __init__(self, *args, **kwargs) -> None:
method add_progress (line 156) | def add_progress(self, *args, **kwargs) -> None:
method check_if_cancelled (line 160) | def check_if_cancelled(self) -> None:
method start_job (line 164) | def start_job(self, *args, **kwargs) -> None:
method start_subjob (line 168) | def start_subjob(self, *args, **kwargs) -> "NullJob":
method set_progress (line 171) | def set_progress(self, *args, **kwargs) -> None:
FILE: hscommon/jobprogress/performer.py
class ThreadedJobPerformer (line 16) | class ThreadedJobPerformer:
method create_job (line 32) | def create_job(self) -> Job:
method _async_run (line 40) | def _async_run(self, *args) -> None:
method reraise_if_error (line 56) | def reraise_if_error(self) -> None:
method _update_progress (line 64) | def _update_progress(self, newprogress: int, newdesc: str = "") -> bool:
method run_threaded (line 70) | def run_threaded(self, target: Callable, args: Tuple = ()) -> None:
FILE: hscommon/loc.py
function get_langs (line 14) | def get_langs(folder: str) -> List[str]:
function files_with_ext (line 18) | def files_with_ext(folder: str, ext: str) -> List[str]:
function generate_pot (line 22) | def generate_pot(folders: List[str], outpath: str, keywords: Any, merge:...
function compile_all_po (line 43) | def compile_all_po(base_folder: str) -> None:
function merge_locale_dir (line 53) | def merge_locale_dir(target: str, mergeinto: str) -> None:
function merge_pots_into_pos (line 64) | def merge_pots_into_pos(folder: str) -> None:
function merge_po_and_preserve (line 77) | def merge_po_and_preserve(source: str, dest: str) -> None:
function normalize_all_pos (line 89) | def normalize_all_pos(base_folder: str) -> None:
FILE: hscommon/notify.py
class Broadcaster (line 19) | class Broadcaster:
method __init__ (line 22) | def __init__(self):
method add_listener (line 25) | def add_listener(self, listener: "Listener") -> None:
method notify (line 28) | def notify(self, msg: str) -> None:
method remove_listener (line 37) | def remove_listener(self, listener: "Listener") -> None:
class Listener (line 41) | class Listener:
method __init__ (line 44) | def __init__(self, broadcaster: Broadcaster) -> None:
method bind_messages (line 48) | def bind_messages(self, messages: str, func: Callable) -> None:
method connect (line 58) | def connect(self) -> None:
method disconnect (line 62) | def disconnect(self) -> None:
method dispatch (line 66) | def dispatch(self, msg: str) -> None:
class Repeater (line 75) | class Repeater(Broadcaster, Listener):
method __init__ (line 78) | def __init__(self, broadcaster: Broadcaster) -> None:
method _repeat_message (line 82) | def _repeat_message(self, msg: str) -> None:
method dispatch (line 86) | def dispatch(self, msg: str) -> None:
FILE: hscommon/path.py
function pathify (line 15) | def pathify(f):
function log_io_error (line 43) | def log_io_error(func):
FILE: hscommon/pygettext.py
function usage (line 43) | def usage(code, msg=""):
function make_escapes (line 53) | def make_escapes(pass_iso8859):
function escape (line 74) | def escape(s):
function safe_eval (line 82) | def safe_eval(s):
function normalize (line 87) | def normalize(s):
function containsAny (line 104) | def containsAny(str, set):
function _visit_pyfiles (line 109) | def _visit_pyfiles(list, dirname, names):
function getFilesForName (line 124) | def getFilesForName(name):
class TokenEater (line 158) | class TokenEater:
method __init__ (line 159) | def __init__(self, options):
method __call__ (line 168) | def __call__(self, ttype, tstring, stup, etup, line):
method __waiting (line 175) | def __waiting(self, ttype, tstring, lineno):
method __suiteseen (line 194) | def __suiteseen(self, ttype, tstring, lineno):
method __suitedocstring (line 199) | def __suitedocstring(self, ttype, tstring, lineno):
method __keywordseen (line 208) | def __keywordseen(self, ttype, tstring, lineno):
method __openseen (line 216) | def __openseen(self, ttype, tstring, lineno):
method __addentry (line 242) | def __addentry(self, msg, lineno=None, isdocstring=0):
method set_filename (line 249) | def set_filename(self, filename):
method write (line 253) | def write(self, fp):
function main (line 304) | def main(source_files, outpath, keywords=None):
FILE: hscommon/sphinxgen.py
function tixgen (line 22) | def tixgen(tixurl: str) -> Callable[[str], str]:
function gen (line 32) | def gen(
FILE: hscommon/tests/conflict_test.py
class TestCaseGetConflictedName (line 22) | class TestCaseGetConflictedName:
method test_simple (line 23) | def test_simple(self):
method test_no_conflict (line 29) | def test_no_conflict(self):
method test_fourth_digit (line 33) | def test_fourth_digit(self):
method test_auto_unconflict (line 41) | def test_auto_unconflict(self):
class TestCaseGetUnconflictedName (line 49) | class TestCaseGetUnconflictedName:
method test_main (line 50) | def test_main(self):
class TestCaseIsConflicted (line 59) | class TestCaseIsConflicted:
method test_main (line 60) | def test_main(self):
class TestCaseMoveCopy (line 69) | class TestCaseMoveCopy:
method do_setup (line 71) | def do_setup(self, request):
method test_move_no_conflict (line 78) | def test_move_no_conflict(self, do_setup):
method test_copy_no_conflict (line 83) | def test_copy_no_conflict(self, do_setup): # No need to duplicate the...
method test_move_no_conflict_dest_is_dir (line 88) | def test_move_no_conflict_dest_is_dir(self, do_setup):
method test_move_conflict (line 93) | def test_move_conflict(self, do_setup):
method test_move_conflict_dest_is_dir (line 98) | def test_move_conflict_dest_is_dir(self, do_setup):
method test_copy_folder (line 107) | def test_copy_folder(self, tmpdir):
FILE: hscommon/tests/notify_test.py
class HelloListener (line 11) | class HelloListener(Listener):
method __init__ (line 12) | def __init__(self, broadcaster):
method hello (line 16) | def hello(self):
class HelloRepeater (line 20) | class HelloRepeater(Repeater):
method __init__ (line 21) | def __init__(self, broadcaster):
method hello (line 25) | def hello(self):
function create_pair (line 29) | def create_pair():
function test_disconnect_during_notification (line 35) | def test_disconnect_during_notification():
function test_disconnect (line 61) | def test_disconnect():
function test_disconnect_when_not_connected (line 70) | def test_disconnect_when_not_connected():
function test_not_connected_on_init (line 76) | def test_not_connected_on_init():
function test_notify (line 83) | def test_notify():
function test_reconnect (line 91) | def test_reconnect():
function test_repeater (line 101) | def test_repeater():
function test_repeater_with_repeated_notifications (line 112) | def test_repeater_with_repeated_notifications():
function test_repeater_doesnt_try_to_dispatch_to_self_if_it_cant (line 137) | def test_repeater_doesnt_try_to_dispatch_to_self_if_it_cant():
function test_bind_messages (line 148) | def test_bind_messages():
FILE: hscommon/tests/path_test.py
function test_pathify (line 13) | def test_pathify():
function test_pathify_preserve_none (line 26) | def test_pathify_preserve_none():
FILE: hscommon/tests/selectable_list_test.py
function test_in (line 13) | def test_in():
function test_selection_range (line 21) | def test_selection_range():
function test_update_selection_called (line 30) | def test_update_selection_called():
function test_guicalls (line 43) | def test_guicalls():
function test_search_by_prefix (line 65) | def test_search_by_prefix():
FILE: hscommon/tests/table_test.py
class TestRow (line 13) | class TestRow(Row):
method __init__ (line 16) | def __init__(self, table, index, is_new=False):
method load (line 21) | def load(self):
method save (line 25) | def save(self):
method index (line 29) | def index(self):
class TestGUITable (line 33) | class TestGUITable(GUITable):
method __init__ (line 36) | def __init__(self, rowcount, viewclass=CallLogger):
method _do_add (line 43) | def _do_add(self):
method _is_edited_new (line 46) | def _is_edited_new(self):
method _fill (line 49) | def _fill(self):
method _update_selection (line 53) | def _update_selection(self):
function table_with_footer (line 57) | def table_with_footer():
function table_with_header (line 65) | def table_with_header():
function test_allow_edit_when_attr_is_property_with_fset (line 74) | def test_allow_edit_when_attr_is_property_with_fset():
function test_can_edit_prop_has_priority_over_fset_checks (line 98) | def test_can_edit_prop_has_priority_over_fset_checks():
function test_in (line 118) | def test_in():
function test_footer_del_all (line 126) | def test_footer_del_all():
function test_footer_del_row (line 133) | def test_footer_del_row():
function test_footer_is_appened_to_table (line 141) | def test_footer_is_appened_to_table():
function test_footer_remove (line 148) | def test_footer_remove():
function test_footer_replaces_old_footer (line 155) | def test_footer_replaces_old_footer():
function test_footer_rows_and_row_count (line 164) | def test_footer_rows_and_row_count():
function test_footer_setting_to_none_removes_old_one (line 171) | def test_footer_setting_to_none_removes_old_one():
function test_footer_stays_there_on_append (line 178) | def test_footer_stays_there_on_append():
function test_footer_stays_there_on_insert (line 186) | def test_footer_stays_there_on_insert():
function test_header_del_all (line 194) | def test_header_del_all():
function test_header_del_row (line 201) | def test_header_del_row():
function test_header_is_inserted_in_table (line 209) | def test_header_is_inserted_in_table():
function test_header_remove (line 216) | def test_header_remove():
function test_header_replaces_old_header (line 223) | def test_header_replaces_old_header():
function test_header_rows_and_row_count (line 232) | def test_header_rows_and_row_count():
function test_header_setting_to_none_removes_old_one (line 239) | def test_header_setting_to_none_removes_old_one():
function test_header_stays_there_on_insert (line 246) | def test_header_stays_there_on_insert():
function test_refresh_view_on_refresh (line 254) | def test_refresh_view_on_refresh():
function test_restore_selection (line 264) | def test_restore_selection():
function test_restore_selection_after_cancel_edits (line 271) | def test_restore_selection_after_cancel_edits():
function test_restore_selection_with_previous_selection (line 285) | def test_restore_selection_with_previous_selection():
function test_restore_selection_custom (line 294) | def test_restore_selection_custom():
function test_row_cell_value (line 306) | def test_row_cell_value():
function test_sort_table_also_tries_attributes_without_underscores (line 315) | def test_sort_table_also_tries_attributes_without_underscores():
function test_sort_table_updates_selection (line 337) | def test_sort_table_updates_selection():
function test_sort_table_with_footer (line 349) | def test_sort_table_with_footer():
function test_sort_table_with_header (line 356) | def test_sort_table_with_header():
function test_add_with_view_that_saves_during_refresh (line 363) | def test_add_with_view_that_saves_during_refresh():
FILE: hscommon/tests/tree_test.py
function tree_with_some_nodes (line 13) | def tree_with_some_nodes():
function test_selection (line 23) | def test_selection():
function test_select_one_node (line 31) | def test_select_one_node():
function test_select_one_path (line 40) | def test_select_one_path():
function test_select_multiple_nodes (line 46) | def test_select_multiple_nodes():
function test_select_multiple_paths (line 52) | def test_select_multiple_paths():
function test_select_none_path (line 58) | def test_select_none_path():
function test_select_none_node (line 65) | def test_select_none_node():
function test_clear_removes_selection (line 72) | def test_clear_removes_selection():
function test_selection_override (line 81) | def test_selection_override():
function test_findall (line 98) | def test_findall():
function test_findall_dont_include_self (line 104) | def test_findall_dont_include_self():
function test_find_dont_include_self (line 112) | def test_find_dont_include_self():
function test_find_none (line 120) | def test_find_none():
FILE: hscommon/tests/util_test.py
function test_nonone (line 38) | def test_nonone():
function test_tryint (line 43) | def test_tryint():
function test_first (line 53) | def test_first():
function test_flatten (line 58) | def test_flatten():
function test_dedupe (line 63) | def test_dedupe():
function test_extract (line 68) | def test_extract():
function test_allsame (line 74) | def test_allsame():
function test_iterconsume (line 82) | def test_iterconsume():
function test_escape (line 92) | def test_escape():
function test_get_file_ext (line 98) | def test_get_file_ext():
function test_rem_file_ext (line 105) | def test_rem_file_ext():
function test_pluralize (line 112) | def test_pluralize():
function test_format_time (line 123) | def test_format_time():
function test_format_time_decimal (line 145) | def test_format_time_decimal():
function test_format_size (line 158) | def test_format_size():
function test_multi_replace (line 194) | def test_multi_replace():
class TestCaseDeleteIfEmpty (line 210) | class TestCaseDeleteIfEmpty:
method test_is_empty (line 211) | def test_is_empty(self, tmpdir):
method test_not_empty (line 216) | def test_not_empty(self, tmpdir):
method test_with_files_to_delete (line 222) | def test_with_files_to_delete(self, tmpdir):
method test_directory_in_files_to_delete (line 229) | def test_directory_in_files_to_delete(self, tmpdir):
method test_delete_files_to_delete_only_if_dir_is_empty (line 235) | def test_delete_files_to_delete_only_if_dir_is_empty(self, tmpdir):
method test_doesnt_exist (line 243) | def test_doesnt_exist(self):
method test_is_file (line 247) | def test_is_file(self, tmpdir):
method test_ioerror (line 253) | def test_ioerror(self, tmpdir, monkeypatch):
class TestCaseOpenIfFilename (line 262) | class TestCaseOpenIfFilename:
method test_file_name (line 265) | def test_file_name(self, tmpdir):
method test_opened_file (line 273) | def test_opened_file(self):
method test_mode_is_passed_to_open (line 281) | def test_mode_is_passed_to_open(self, tmpdir):
class TestCaseFileOrPath (line 289) | class TestCaseFileOrPath:
method test_path (line 292) | def test_path(self, tmpdir):
method test_opened_file (line 298) | def test_opened_file(self):
method test_mode_is_passed_to_open (line 305) | def test_mode_is_passed_to_open(self, tmpdir):
FILE: hscommon/testutil.py
function eq_ (line 12) | def eq_(a, b, msg=None):
function callcounter (line 17) | def callcounter():
class CallLogger (line 25) | class CallLogger:
method __init__ (line 31) | def __init__(self):
method __getattr__ (line 34) | def __getattr__(self, func_name):
method clear_calls (line 40) | def clear_calls(self):
method check_gui_calls (line 43) | def check_gui_calls(self, expected, verify_order=False):
method check_gui_calls_partial (line 56) | def check_gui_calls_partial(self, expected=None, not_expected=None, ve...
class TestApp (line 81) | class TestApp:
method __init__ (line 82) | def __init__(self):
method clear_gui_calls (line 85) | def clear_gui_calls(self):
method make_logger (line 89) | def make_logger(self, logger=None):
method make_gui (line 95) | def make_gui(self, name, class_, view=None, parent=None, holder=None):
function with_app (line 111) | def with_app(setupfunc):
function app (line 120) | def app(request):
function _unify_args (line 138) | def _unify_args(func, args, kwargs, args_to_ignore=None):
function log_calls (line 177) | def log_calls(func):
FILE: hscommon/trans.py
function tr (line 25) | def tr(s: str, context: Union[str, None] = None) -> str:
function trget (line 35) | def trget(domain: str) -> Callable[[str], str]:
function set_tr (line 43) | def set_tr(
function get_locale_name (line 53) | def get_locale_name(lang: str) -> Union[str, None]:
function install_qt_trans (line 85) | def install_qt_trans(lang: str = None) -> None:
function install_gettext_trans (line 114) | def install_gettext_trans(base_folder: os.PathLike, lang: str) -> None:
function install_gettext_trans_under_qt (line 139) | def install_gettext_trans_under_qt(base_folder: os.PathLike, lang: str =...
FILE: hscommon/util.py
function nonone (line 16) | def nonone(value: Any, replace_value: Any) -> Any:
function tryint (line 24) | def tryint(value: Any, default: int = 0) -> int:
function dedupe (line 35) | def dedupe(iterable: Iterable[Any]) -> List[Any]:
function flatten (line 50) | def flatten(iterables: Iterable[Iterable], start_with: Iterable[Any] = N...
function first (line 64) | def first(iterable: Iterable[Any]):
function extract (line 72) | def extract(predicate: Callable[[Any], bool], iterable: Iterable[Any]) -...
function allsame (line 84) | def allsame(iterable: Iterable[Any]) -> bool:
function iterconsume (line 94) | def iterconsume(seq: List[Any], reverse: bool = True) -> Generator[Any, ...
function escape (line 113) | def escape(s: str, to_escape: str, escape_with: str = "\\") -> str:
function get_file_ext (line 118) | def get_file_ext(filename: str) -> str:
function rem_file_ext (line 127) | def rem_file_ext(filename: str) -> str:
function pluralize (line 137) | def pluralize(number, word: str, decimals: int = 0, plural_word: Union[s...
function format_time (line 156) | def format_time(seconds: int, with_hours: bool = True) -> str:
function format_time_decimal (line 176) | def format_time_decimal(seconds: int) -> str:
function format_size (line 199) | def format_size(size: int, decimal: int = 0, forcepower: int = -1, showd...
function multi_replace (line 237) | def multi_replace(s: str, replace_from: Union[str, List[str]], replace_t...
function delete_if_empty (line 266) | def delete_if_empty(path: Path, files_to_delete: List[str] = []) -> bool:
function open_if_filename (line 279) | def open_if_filename(
class FileOrPath (line 302) | class FileOrPath:
method __init__ (line 311) | def __init__(self, file_or_path: Union[Path, str], mode: str = "rb") -...
method __enter__ (line 317) | def __enter__(self) -> IO:
method __exit__ (line 321) | def __exit__(self, exc_type, exc_value, traceback) -> None:
FILE: package.py
function parse_args (line 34) | def parse_args():
function check_loc_doc (line 40) | def check_loc_doc():
function copy_files_to_package (line 49) | def copy_files_to_package(destpath, packages, with_so):
function package_debian_distribution (line 69) | def package_debian_distribution(distribution):
function package_debian (line 113) | def package_debian():
function package_arch (line 119) | def package_arch():
function package_source_txz (line 132) | def package_source_txz():
function package_windows (line 143) | def package_windows():
function package_macos (line 198) | def package_macos():
function main (line 221) | def main():
FILE: qt/about_box.py
class AboutBox (line 20) | class AboutBox(QDialog):
method __init__ (line 21) | def __init__(self, parent, app, **kwargs):
method _setupUi (line 30) | def _setupUi(self):
method _check_for_update (line 65) | def _check_for_update(self):
method showEvent (line 74) | def showEvent(self, event):
FILE: qt/app.py
class DupeGuru (line 44) | class DupeGuru(QObject):
method __init__ (line 48) | def __init__(self, **kwargs):
method _setup (line 59) | def _setup(self):
method _setupActions (line 111) | def _setupActions(self):
method _update_options (line 157) | def _update_options(self):
method _get_details_dialog_class (line 205) | def _get_details_dialog_class(self):
method _get_preferences_dialog_class (line 213) | def _get_preferences_dialog_class(self):
method _set_style (line 221) | def _set_style(self, style="light"):
method add_selected_to_ignore_list (line 255) | def add_selected_to_ignore_list(self):
method remove_selected (line 258) | def remove_selected(self):
method confirm (line 261) | def confirm(self, title, msg, default_button=QMessageBox.Yes):
method invokeCustomCommand (line 267) | def invokeCustomCommand(self):
method show_details (line 270) | def show_details(self):
method showResultsWindow (line 277) | def showResultsWindow(self):
method showDirectoriesWindow (line 287) | def showDirectoriesWindow(self):
method shutdown (line 294) | def shutdown(self):
method finishedLaunching (line 309) | def finishedLaunching(self):
method clearCacheTriggered (line 329) | def clearCacheTriggered(self):
method ignoreListTriggered (line 338) | def ignoreListTriggered(self):
method excludeListTriggered (line 344) | def excludeListTriggered(self):
method showTriggeredTabbedDialog (line 350) | def showTriggeredTabbedDialog(self, dialog, desc_string):
method openDebugLogTriggered (line 359) | def openDebugLogTriggered(self):
method preferencesTriggered (line 363) | def preferencesTriggered(self):
method quitTriggered (line 375) | def quitTriggered(self):
method showAboutBoxTriggered (line 384) | def showAboutBoxTriggered(self):
method showHelpTriggered (line 387) | def showHelpTriggered(self):
method handleSIGTERM (line 396) | def handleSIGTERM(self):
method get_default (line 400) | def get_default(self, key):
method set_default (line 403) | def set_default(self, key, value):
method show_message (line 406) | def show_message(self, msg):
method ask_yes_no (line 410) | def ask_yes_no(self, prompt):
method create_results_window (line 413) | def create_results_window(self):
method show_results_window (line 434) | def show_results_window(self):
method show_problem_dialog (line 437) | def show_problem_dialog(self):
method select_dest_folder (line 440) | def select_dest_folder(self, prompt):
method select_dest_file (line 444) | def select_dest_file(self, prompt, extension):
FILE: qt/column.py
class Column (line 13) | class Column:
method __init__ (line 14) | def __init__(
class Columns (line 36) | class Columns:
method __init__ (line 37) | def __init__(self, model, columns, header_view):
method set_columns_width (line 68) | def set_columns_width(self, widths):
method set_columns_order (line 78) | def set_columns_order(self, column_indexes):
method header_section_moved (line 87) | def header_section_moved(self, logical_index, old_visual_index, new_vi...
method header_section_resized (line 91) | def header_section_resized(self, logical_index, old_size, new_size):
method restore_columns (line 96) | def restore_columns(self):
method set_column_visible (line 108) | def set_column_visible(self, colname, visible):
FILE: qt/deletion_options.py
class DeletionOptions (line 18) | class DeletionOptions(QDialog):
method __init__ (line 19) | def __init__(self, parent, model, **kwargs):
method _setupUi (line 30) | def _setupUi(self):
method linkCheckboxChanged (line 65) | def linkCheckboxChanged(self, changed: int):
method update_msg (line 69) | def update_msg(self, msg: str):
method show (line 72) | def show(self):
method set_hardlink_option_enabled (line 82) | def set_hardlink_option_enabled(self, is_enabled: bool):
FILE: qt/details_dialog.py
class DetailsDialog (line 17) | class DetailsDialog(QDockWidget):
method __init__ (line 18) | def __init__(self, parent, app, **kwargs):
method _setupUi (line 37) | def _setupUi(self): # Virtual
method show (line 40) | def show(self):
method update_options (line 47) | def update_options(self):
method appWillSavePrefs (line 69) | def appWillSavePrefs(self):
method refresh (line 74) | def refresh(self):
method showEvent (line 78) | def showEvent(self, event):
FILE: qt/details_table.py
class DetailsModel (line 20) | class DetailsModel(QAbstractTableModel):
method __init__ (line 21) | def __init__(self, model, app, **kwargs):
method columnCount (line 26) | def columnCount(self, parent):
method data (line 29) | def data(self, index, role):
method headerData (line 56) | def headerData(self, section, orientation, role):
method rowCount (line 64) | def rowCount(self, parent):
class DetailsTable (line 68) | class DetailsTable(QTableView):
method __init__ (line 69) | def __init__(self, *args):
method setModel (line 78) | def setModel(self, model):
FILE: qt/directories_dialog.py
class DirectoriesDialog (line 40) | class DirectoriesDialog(QMainWindow):
method __init__ (line 41) | def __init__(self, app, **kwargs):
method _setupBindings (line 62) | def _setupBindings(self):
method _setupActions (line 76) | def _setupActions(self):
method _setupMenu (line 103) | def _setupMenu(self):
method _setupUi (line 161) | def _setupUi(self):
method _setupColumns (line 230) | def _setupColumns(self):
method _updateActionsState (line 237) | def _updateActionsState(self):
method _updateAddButton (line 240) | def _updateAddButton(self):
method _updateRemoveButton (line 246) | def _updateRemoveButton(self):
method _updateLoadResultsButton (line 253) | def _updateLoadResultsButton(self):
method _updateScanTypeList (line 259) | def _updateScanTypeList(self):
method closeEvent (line 277) | def closeEvent(self, event):
method addFolderTriggered (line 288) | def addFolderTriggered(self):
method appModeButtonSelected (line 309) | def appModeButtonSelected(self, index):
method appWillSavePrefs (line 319) | def appWillSavePrefs(self):
method directoriesModelAddedFolders (line 322) | def directoriesModelAddedFolders(self, folders):
method loadResultsTriggered (line 326) | def loadResultsTriggered(self):
method loadDirectoriesTriggered (line 334) | def loadDirectoriesTriggered(self):
method removeFolderButtonClicked (line 341) | def removeFolderButtonClicked(self):
method saveDirectoriesTriggered (line 344) | def saveDirectoriesTriggered(self):
method scanButtonClicked (line 353) | def scanButtonClicked(self):
method scanTypeChanged (line 361) | def scanTypeChanged(self, index):
method selectionChanged (line 366) | def selectionChanged(self, selected, deselected):
FILE: qt/directories_model.py
class DirectoriesDelegate (line 29) | class DirectoriesDelegate(QStyledItemDelegate):
method createEditor (line 30) | def createEditor(self, parent, option, index):
method paint (line 35) | def paint(self, painter, option, index):
method setEditorData (line 53) | def setEditorData(self, editor, index):
method setModelData (line 58) | def setModelData(self, editor, model, index):
method updateEditorGeometry (line 62) | def updateEditorGeometry(self, editor, option, index):
class DirectoriesModel (line 66) | class DirectoriesModel(TreeModel):
method __init__ (line 69) | def __init__(self, model, view, **kwargs):
method _create_node (line 78) | def _create_node(self, ref, row):
method _get_children (line 81) | def _get_children(self):
method columnCount (line 84) | def columnCount(self, parent=QModelIndex()):
method data (line 87) | def data(self, index, role):
method dropMimeData (line 107) | def dropMimeData(self, mime_data, action, row, column, parent_index):
method flags (line 120) | def flags(self, index):
method headerData (line 128) | def headerData(self, section, orientation, role):
method mimeTypes (line 133) | def mimeTypes(self):
method setData (line 136) | def setData(self, index, value, role):
method supportedDropActions (line 144) | def supportedDropActions(self):
method selectionChanged (line 150) | def selectionChanged(self, selected, deselected):
method refresh (line 158) | def refresh(self):
method refresh_states (line 161) | def refresh_states(self):
FILE: qt/error_report_dialog.py
class ErrorReportDialog (line 31) | class ErrorReportDialog(QDialog):
method __init__ (line 32) | def __init__(self, parent, github_url, error, **kwargs):
method _setupUi (line 49) | def _setupUi(self):
method goToGitHub (line 86) | def goToGitHub(self):
function install_excepthook (line 90) | def install_excepthook(github_url):
FILE: qt/exclude_list_dialog.py
class ExcludeListDialog (line 27) | class ExcludeListDialog(QDialog):
method __init__ (line 28) | def __init__(self, app, parent, model, **kwargs):
method _setupUI (line 50) | def _setupUI(self):
method show (line 96) | def show(self):
method addStringFromLineEdit (line 101) | def addStringFromLineEdit(self):
method removeSelected (line 115) | def removeSelected(self):
method restoreDefaults (line 118) | def restoreDefaults(self):
method onTestStringButtonClicked (line 121) | def onTestStringButtonClicked(self):
method reset_input_style (line 147) | def reset_input_style(self):
method reset_table_style (line 153) | def reset_table_style(self):
method display_help_message (line 159) | def display_help_message(self):
FILE: qt/exclude_list_table.py
class ExcludeListTable (line 15) | class ExcludeListTable(Table):
method __init__ (line 20) | def __init__(self, app, view, **kwargs):
method _getData (line 29) | def _getData(self, row, column, role):
method _getFlags (line 49) | def _getFlags(self, row, column):
method _setData (line 58) | def _setData(self, row, column, value, role):
FILE: qt/ignore_list_dialog.py
class IgnoreListDialog (line 25) | class IgnoreListDialog(QDialog):
method __init__ (line 26) | def __init__(self, parent, model, **kwargs):
method _setupUi (line 39) | def _setupUi(self):
method show (line 63) | def show(self):
FILE: qt/ignore_list_table.py
class IgnoreListTable (line 12) | class IgnoreListTable(Table):
FILE: qt/me/details_dialog.py
class DetailsDialog (line 17) | class DetailsDialog(DetailsDialogBase):
method _setupUi (line 18) | def _setupUi(self):
FILE: qt/me/preferences_dialog.py
class PreferencesDialog (line 26) | class PreferencesDialog(PreferencesDialogBase):
method _setupPreferenceWidgets (line 27) | def _setupPreferenceWidgets(self):
method _load (line 73) | def _load(self, prefs, setchecked, section):
method _save (line 102) | def _save(self, prefs, ischecked):
FILE: qt/me/results_model.py
class ResultsModel (line 11) | class ResultsModel(ResultsModelBase):
FILE: qt/pe/block.pyi
function getblock (line 6) | def getblock(image: QImage) -> _block: ... # noqa: E302
function getblocks (line 7) | def getblocks(image: QImage, block_count_per_side: int) -> Union[List[_b...
FILE: qt/pe/details_dialog.py
class DetailsDialog (line 18) | class DetailsDialog(DetailsDialogBase):
method __init__ (line 19) | def __init__(self, parent, app):
method _setupUi (line 23) | def _setupUi(self):
method _update (line 76) | def _update(self):
method resizeEvent (line 91) | def resizeEvent(self, event):
method show (line 98) | def show(self):
method ensure_same_sizes (line 111) | def ensure_same_sizes(self):
method refresh (line 129) | def refresh(self):
class EmittingFrame (line 135) | class EmittingFrame(QFrame):
method resizeEvent (line 140) | def resizeEvent(self, event):
FILE: qt/pe/image_viewer.py
function create_actions (line 29) | def create_actions(actions, target):
class ViewerToolBar (line 42) | class ViewerToolBar(QToolBar):
method __init__ (line 43) | def __init__(self, parent, controller):
method setupActions (line 55) | def setupActions(self, controller):
method createButtons (line 107) | def createButtons(self):
class BaseController (line 147) | class BaseController(QObject):
method __init__ (line 152) | def __init__(self, parent):
method setupViewers (line 167) | def setupViewers(self, selected_viewer, reference_viewer):
method _setupConnections (line 174) | def _setupConnections(self):
method updateView (line 178) | def updateView(self, ref, dupe, group):
method updateBothImages (line 204) | def updateBothImages(self, same_group=False):
method _updateImage (line 217) | def _updateImage(self, pixmap, viewer, same_group=False):
method resetState (line 238) | def resetState(self):
method resetViewersState (line 259) | def resetViewersState(self):
method zoomIn (line 288) | def zoomIn(self):
method zoomOut (line 292) | def zoomOut(self):
method scaleImagesBy (line 296) | def scaleImagesBy(self, factor):
method scaleImagesAt (line 304) | def scaleImagesAt(self, scale):
method updateButtons (line 311) | def updateButtons(self):
method updateButtonsAsPerDimensions (line 317) | def updateButtonsAsPerDimensions(self, previous_same_dimensions):
method zoomBestFit (line 334) | def zoomBestFit(self):
method setBestFit (line 357) | def setBestFit(self, value):
method zoomNormalSize (line 363) | def zoomNormalSize(self):
method centerViews (line 384) | def centerViews(self, only_selected=False):
method swapImages (line 391) | def swapImages(self):
class QWidgetController (line 396) | class QWidgetController(BaseController):
method __init__ (line 399) | def __init__(self, parent):
method _updateImage (line 402) | def _updateImage(self, *args):
method onDraggedMouse (line 409) | def onDraggedMouse(self, delta):
method swapImages (line 418) | def swapImages(self):
class ScrollAreaController (line 425) | class ScrollAreaController(BaseController):
method __init__ (line 428) | def __init__(self, parent):
method _setupConnections (line 431) | def _setupConnections(self):
method updateBothImages (line 436) | def updateBothImages(self, same_group=False):
method onDraggedMouse (line 444) | def onDraggedMouse(self, delta):
method swapImages (line 461) | def swapImages(self):
method onMouseWheel (line 468) | def onMouseWheel(self, scale, delta):
method onVScrollBarChanged (line 475) | def onVScrollBarChanged(self, value):
method onHScrollBarChanged (line 486) | def onHScrollBarChanged(self, value):
method scaleImagesBy (line 497) | def scaleImagesBy(self, factor):
method zoomBestFit (line 503) | def zoomBestFit(self):
class GraphicsViewController (line 512) | class GraphicsViewController(BaseController):
method __init__ (line 515) | def __init__(self, parent):
method _setupConnections (line 518) | def _setupConnections(self):
method syncCenters (line 527) | def syncCenters(self):
method onMouseWheel (line 534) | def onMouseWheel(self, factor, new_center):
method onVScrollBarChanged (line 544) | def onVScrollBarChanged(self, value):
method onHScrollBarChanged (line 555) | def onHScrollBarChanged(self, value):
method swapImages (line 566) | def swapImages(self):
method zoomBestFit (line 573) | def zoomBestFit(self):
method updateView (line 589) | def updateView(self, ref, dupe, group):
method updateBothImages (line 614) | def updateBothImages(self, same_group=False):
method _updateFitImage (line 626) | def _updateFitImage(self, pixmap, viewer):
method resetState (line 634) | def resetState(self):
method resetViewersState (line 655) | def resetViewersState(self):
method scaleImagesBy (line 681) | def scaleImagesBy(self, factor):
class QWidgetImageViewer (line 689) | class QWidgetImageViewer(QWidget):
method __init__ (line 696) | def __init__(self, parent, name=""):
method __repr__ (line 712) | def __repr__(self):
method connectMouseSignals (line 715) | def connectMouseSignals(self):
method disconnectMouseSignals (line 721) | def disconnectMouseSignals(self):
method paintEvent (line 729) | def paintEvent(self, event):
method resetCenter (line 736) | def resetCenter(self):
method changeEvent (line 742) | def changeEvent(self, event):
method contextMenuEvent (line 749) | def contextMenuEvent(self, event):
method mousePressEvent (line 753) | def mousePressEvent(self, event):
method mouseMoveEvent (line 769) | def mouseMoveEvent(self, event):
method mouseReleaseEvent (line 780) | def mouseReleaseEvent(self, event):
method wheelEvent (line 790) | def wheelEvent(self, event):
method setImage (line 804) | def setImage(self, pixmap):
method centerViewAndUpdate (line 817) | def centerViewAndUpdate(self):
method shouldBeActive (line 822) | def shouldBeActive(self):
method scaleBy (line 825) | def scaleBy(self, factor):
method scaleAt (line 829) | def scaleAt(self, scale):
method sizeHint (line 833) | def sizeHint(self):
method scaleToNormalSize (line 837) | def scaleToNormalSize(self):
method onDraggedMouse (line 843) | def onDraggedMouse(self, delta):
class ScalablePixmap (line 848) | class ScalablePixmap(QWidget):
method __init__ (line 851) | def __init__(self, parent):
method paintEvent (line 856) | def paintEvent(self, event):
method sizeHint (line 863) | def sizeHint(self):
method minimumSizeHint (line 866) | def minimumSizeHint(self):
class ScrollAreaImageViewer (line 870) | class ScrollAreaImageViewer(QScrollArea):
method __init__ (line 876) | def __init__(self, parent, name=""):
method __repr__ (line 912) | def __repr__(self):
method toggleScrollBars (line 915) | def toggleScrollBars(self, force_on=False):
method connectMouseSignals (line 928) | def connectMouseSignals(self):
method disconnectMouseSignals (line 934) | def disconnectMouseSignals(self):
method connectScrollBars (line 942) | def connectScrollBars(self):
method contextMenuEvent (line 948) | def contextMenuEvent(self, event):
method mousePressEvent (line 955) | def mousePressEvent(self, event):
method mouseMoveEvent (line 970) | def mouseMoveEvent(self, event):
method mouseReleaseEvent (line 980) | def mouseReleaseEvent(self, event):
method wheelEvent (line 989) | def wheelEvent(self, event):
method setImage (line 1007) | def setImage(self, pixmap):
method centerViewAndUpdate (line 1019) | def centerViewAndUpdate(self):
method setCachedPixmap (line 1026) | def setCachedPixmap(self):
method shouldBeActive (line 1031) | def shouldBeActive(self):
method scaleBy (line 1034) | def scaleBy(self, factor):
method scaleAt (line 1041) | def scaleAt(self, scale):
method adjustScrollBarsFactor (line 1048) | def adjustScrollBarsFactor(self, factor):
method adjustScrollBarsScaled (line 1058) | def adjustScrollBarsScaled(self, delta):
method adjustScrollBarsAuto (line 1063) | def adjustScrollBarsAuto(self):
method adjustScrollBarCentered (line 1068) | def adjustScrollBarCentered(self):
method resetCenter (line 1073) | def resetCenter(self):
method setCenter (line 1079) | def setCenter(self, point):
method sizeHint (line 1082) | def sizeHint(self):
method scaleToNormalSize (line 1086) | def scaleToNormalSize(self):
method onDraggedMouse (line 1093) | def onDraggedMouse(self, delta):
class GraphicsViewViewer (line 1100) | class GraphicsViewViewer(QGraphicsView):
method __init__ (line 1106) | def __init__(self, parent, name=""):
method connectMouseSignals (line 1151) | def connectMouseSignals(self):
method disconnectMouseSignals (line 1157) | def disconnectMouseSignals(self):
method connectScrollBars (line 1165) | def connectScrollBars(self):
method toggleScrollBars (line 1171) | def toggleScrollBars(self, force_on=False):
method contextMenuEvent (line 1184) | def contextMenuEvent(self, event):
method mousePressEvent (line 1188) | def mousePressEvent(self, event):
method mouseReleaseEvent (line 1204) | def mouseReleaseEvent(self, event):
method mouseMoveEvent (line 1214) | def mouseMoveEvent(self, event):
method updateCenterPoint (line 1225) | def updateCenterPoint(self):
method wheelEvent (line 1228) | def wheelEvent(self, event):
method setImage (line 1251) | def setImage(self, pixmap):
method centerViewAndUpdate (line 1260) | def centerViewAndUpdate(self):
method setCenter (line 1264) | def setCenter(self, point):
method resetCenter (line 1268) | def resetCenter(self):
method setNewCenter (line 1273) | def setNewCenter(self, position):
method setCachedPixmap (line 1277) | def setCachedPixmap(self):
method scaleAt (line 1282) | def scaleAt(self, scale):
method getScale (line 1288) | def getScale(self):
method scaleBy (line 1291) | def scaleBy(self, factor):
method resetScale (line 1295) | def resetScale(self):
method fitScale (line 1300) | def fitScale(self):
method scaleToNormalSize (line 1306) | def scaleToNormalSize(self):
method adjustScrollBarsScaled (line 1313) | def adjustScrollBarsScaled(self, delta):
method sizeHint (line 1318) | def sizeHint(self):
method adjustScrollBarsFactor (line 1321) | def adjustScrollBarsFactor(self, factor):
method adjustScrollBarsAuto (line 1330) | def adjustScrollBarsAuto(self):
FILE: qt/pe/modules/block.c
function max (line 15) | static int max(int a, int b) { return b > a ? b : a; }
function min (line 17) | static int min(int a, int b) { return b < a ? b : a; }
function PyObject (line 20) | static PyObject *getblock(PyObject *image, int width, int height) {
function PyObject (line 88) | static PyObject *block_getblocks(PyObject *self, PyObject *args) {
type PyModuleDef (line 150) | struct PyModuleDef
function PyObject (line 160) | PyObject *PyInit__block_qt(void) {
FILE: qt/pe/photo.py
class File (line 16) | class File(PhotoBase):
method _plat_get_dimensions (line 17) | def _plat_get_dimensions(self):
method _plat_get_blocks (line 29) | def _plat_get_blocks(self, block_count_per_side, orientation):
FILE: qt/pe/preferences_dialog.py
class PreferencesDialog (line 18) | class PreferencesDialog(PreferencesDialogBase):
method _setupPreferenceWidgets (line 19) | def _setupPreferenceWidgets(self):
method _setupDisplayPage (line 40) | def _setupDisplayPage(self):
method _load (line 60) | def _load(self, prefs, setchecked, section):
method _save (line 71) | def _save(self, prefs, ischecked):
FILE: qt/pe/results_model.py
class ResultsModel (line 11) | class ResultsModel(ResultsModelBase):
FILE: qt/preferences.py
function get_langnames (line 19) | def get_langnames():
function _normalize_for_serialization (line 44) | def _normalize_for_serialization(v):
function _adjust_after_deserialization (line 55) | def _adjust_after_deserialization(v):
class PreferencesBase (line 71) | class PreferencesBase(QObject):
method __init__ (line 74) | def __init__(self):
method _load_values (line 79) | def _load_values(self, settings):
method get_rect (line 83) | def get_rect(self, name, default=None):
method get_value (line 90) | def get_value(self, name, default=None):
method load (line 102) | def load(self):
method reset (line 106) | def reset(self):
method _save_values (line 110) | def _save_values(self, settings):
method save (line 114) | def save(self):
method set_rect (line 118) | def set_rect(self, name, r):
method set_value (line 126) | def set_value(self, name, value):
method saveGeometry (line 129) | def saveGeometry(self, name, widget):
method restoreGeometry (line 141) | def restoreGeometry(self, name, widget):
class Preferences (line 156) | class Preferences(PreferencesBase):
method _load_values (line 157) | def _load_values(self, settings):
method reset (line 230) | def reset(self):
method _save_values (line 283) | def _save_values(self, settings):
method get_scan_type (line 338) | def get_scan_type(self, app_mode):
method set_scan_type (line 346) | def set_scan_type(self, app_mode, value):
FILE: qt/preferences_dialog.py
class Sections (line 45) | class Sections(Flag):
class PreferencesDialogBase (line 55) | class PreferencesDialogBase(QDialog):
method __init__ (line 56) | def __init__(self, parent, app, **kwargs):
method _setupFilterHardnessBox (line 69) | def _setupFilterHardnessBox(self):
method _setupBottomPart (line 108) | def _setupBottomPart(self):
method _setupDisplayPage (line 124) | def _setupDisplayPage(self):
method _setup_advanced_page (line 218) | def _setup_advanced_page(self):
method _setupDebugPage (line 232) | def _setupDebugPage(self):
method _setupAddCheckbox (line 244) | def _setupAddCheckbox(self, name, label, parent=None):
method _setupPreferenceWidgets (line 251) | def _setupPreferenceWidgets(self):
method _setupUi (line 255) | def _setupUi(self):
method _load (line 295) | def _load(self, prefs, setchecked, section):
method _save (line 299) | def _save(self, prefs, ischecked):
method load (line 303) | def load(self, prefs=None, section=Sections.ALL):
method save (line 351) | def save(self):
method resetToDefaults (line 393) | def resetToDefaults(self, section_to_update):
method buttonClicked (line 397) | def buttonClicked(self, button):
method showEvent (line 410) | def showEvent(self, event):
class ColorPickerButton (line 416) | class ColorPickerButton(QPushButton):
method __init__ (line 417) | def __init__(self, parent):
method onClicked (line 424) | def onClicked(self):
method setColor (line 428) | def setColor(self, color):
FILE: qt/prioritize_dialog.py
class PrioritizationList (line 36) | class PrioritizationList(ListviewModel):
method flags (line 37) | def flags(self, index):
method dropMimeData (line 43) | def dropMimeData(self, mime_data, action, row, column, parent_index):
method mimeData (line 62) | def mimeData(self, indexes):
method mimeTypes (line 69) | def mimeTypes(self):
method supportedDropActions (line 72) | def supportedDropActions(self):
class PrioritizeDialog (line 76) | class PrioritizeDialog(QDialog):
method __init__ (line 77) | def __init__(self, parent, app, **kwargs):
method _setupUi (line 96) | def _setupUi(self):
FILE: qt/problem_dialog.py
class ProblemDialog (line 29) | class ProblemDialog(QDialog):
method __init__ (line 30) | def __init__(self, parent, model, **kwargs):
method _setupUi (line 41) | def _setupUi(self):
method showEvent (line 75) | def showEvent(self, event):
FILE: qt/problem_table.py
class ProblemTable (line 13) | class ProblemTable(Table):
method __init__ (line 19) | def __init__(self, model, view, **kwargs):
FILE: qt/progress_window.py
class ProgressWindow (line 13) | class ProgressWindow:
method __init__ (line 14) | def __init__(self, parent, model):
method refresh (line 25) | def refresh(self): # Labels
method set_progress (line 30) | def set_progress(self, last_progress):
method show (line 38) | def show(self):
method _setup_ui (line 48) | def _setup_ui(self):
method cancel (line 60) | def cancel(self):
method close (line 75) | def close(self):
FILE: qt/radio_box.py
class RadioBox (line 14) | class RadioBox(QWidget):
method __init__ (line 15) | def __init__(self, parent=None, items=None, spread=True, **kwargs):
method _update_buttons (line 29) | def _update_buttons(self):
method _update_selection (line 51) | def _update_selection(self):
method buttonToggled (line 57) | def buttonToggled(self):
method buttons (line 69) | def buttons(self):
method items (line 73) | def items(self):
method items (line 77) | def items(self, value):
method selected_index (line 82) | def selected_index(self):
method selected_index (line 86) | def selected_index(self, value):
FILE: qt/recent.py
class Recent (line 22) | class Recent(QObject):
method __init__ (line 23) | def __init__(self, app, pref_name, max_item_count=10, **kwargs):
method _loadFromPrefs (line 35) | def _loadFromPrefs(self):
method _insertItem (line 41) | def _insertItem(self, item):
method _refreshMenu (line 44) | def _refreshMenu(self, menu_entry):
method _refreshAllMenus (line 58) | def _refreshAllMenus(self):
method _saveToPrefs (line 62) | def _saveToPrefs(self):
method addMenu (line 66) | def addMenu(self, menu):
method clear (line 71) | def clear(self):
method insertItem (line 76) | def insertItem(self, item):
method isEmpty (line 81) | def isEmpty(self):
method menuItemWasClicked (line 85) | def menuItemWasClicked(self):
FILE: qt/result_window.py
class ResultWindow (line 41) | class ResultWindow(QMainWindow):
method __init__ (line 42) | def __init__(self, parent, app, **kwargs):
method _setupActions (line 66) | def _setupActions(self):
method _setupMenu (line 216) | def _setupMenu(self):
method _setupUi (line 326) | def _setupUi(self):
method _update_column_actions_status (line 390) | def _update_column_actions_status(self):
method actionsTriggered (line 397) | def actionsTriggered(self):
method addToIgnoreListTriggered (line 400) | def addToIgnoreListTriggered(self):
method copyTriggered (line 403) | def copyTriggered(self):
method deleteTriggered (line 406) | def deleteTriggered(self):
method deltaTriggered (line 409) | def deltaTriggered(self, state=None):
method detailsTriggered (line 415) | def detailsTriggered(self):
method markAllTriggered (line 418) | def markAllTriggered(self):
method markInvertTriggered (line 421) | def markInvertTriggered(self):
method markNoneTriggered (line 424) | def markNoneTriggered(self):
method markSelectedTriggered (line 427) | def markSelectedTriggered(self):
method moveTriggered (line 430) | def moveTriggered(self):
method openTriggered (line 433) | def openTriggered(self):
method powerMarkerTriggered (line 436) | def powerMarkerTriggered(self, state=None):
method preferencesTriggered (line 442) | def preferencesTriggered(self):
method removeMarkedTriggered (line 445) | def removeMarkedTriggered(self):
method removeSelectedTriggered (line 448) | def removeSelectedTriggered(self):
method renameTriggered (line 451) | def renameTriggered(self):
method reprioritizeTriggered (line 458) | def reprioritizeTriggered(self):
method revealTriggered (line 464) | def revealTriggered(self):
method saveResultsTriggered (line 467) | def saveResultsTriggered(self):
method appWillSavePrefs (line 478) | def appWillSavePrefs(self):
method columnToggled (line 483) | def columnToggled(self, action):
method contextMenuEvent (line 492) | def contextMenuEvent(self, event):
method resultsDoubleClicked (line 495) | def resultsDoubleClicked(self, model_index):
method resultsSpacePressed (line 498) | def resultsSpacePressed(self):
method searchChanged (line 501) | def searchChanged(self):
method closeEvent (line 504) | def closeEvent(self, event):
FILE: qt/results_model.py
class ResultsModel (line 16) | class ResultsModel(Table):
method __init__ (line 17) | def __init__(self, app, view, **kwargs):
method _getData (line 30) | def _getData(self, row, column, role):
method _getFlags (line 57) | def _getFlags(self, row, column):
method _setData (line 66) | def _setData(self, row, column, value, role):
method sort (line 75) | def sort(self, column, order):
method power_marker (line 81) | def power_marker(self):
method power_marker (line 85) | def power_marker(self, value):
method delta_values (line 89) | def delta_values(self):
method delta_values (line 93) | def delta_values(self, value):
method appWillSavePrefs (line 97) | def appWillSavePrefs(self):
method invalidate_markings (line 101) | def invalidate_markings(self):
class ResultsView (line 108) | class ResultsView(QTableView):
method keyPressEvent (line 110) | def keyPressEvent(self, event):
method mouseDoubleClickEvent (line 116) | def mouseDoubleClickEvent(self, event):
FILE: qt/se/details_dialog.py
class DetailsDialog (line 17) | class DetailsDialog(DetailsDialogBase):
method _setupUi (line 18) | def _setupUi(self):
FILE: qt/se/preferences_dialog.py
class PreferencesDialog (line 28) | class PreferencesDialog(PreferencesDialogBase):
method _setupPreferenceWidgets (line 29) | def _setupPreferenceWidgets(self):
method _load (line 109) | def _load(self, prefs, setchecked, section):
method _save (line 126) | def _save(self, prefs, ischecked):
FILE: qt/se/results_model.py
class ResultsModel (line 11) | class ResultsModel(ResultsModelBase):
FILE: qt/search_edit.py
class LineEditButton (line 21) | class LineEditButton(QToolButton):
method __init__ (line 22) | def __init__(self, parent, **kwargs):
class ClearableEdit (line 33) | class ClearableEdit(QLineEdit):
method __init__ (line 34) | def __init__(self, parent=None, is_clearable=True, **kwargs):
method _clearSearch (line 49) | def _clearSearch(self):
method _updateClearButton (line 52) | def _updateClearButton(self):
method _hasClearableContent (line 55) | def _hasClearableContent(self):
method resizeEvent (line 59) | def resizeEvent(self, event):
method _textChanged (line 69) | def _textChanged(self, text):
class SearchEdit (line 74) | class SearchEdit(ClearableEdit):
method __init__ (line 75) | def __init__(self, parent=None, immediate=False):
method _clearSearch (line 84) | def _clearSearch(self):
method _textChanged (line 88) | def _textChanged(self, text):
method keyPressEvent (line 93) | def keyPressEvent(self, event):
method paintEvent (line 100) | def paintEvent(self, event):
method _returnPressed (line 115) | def _returnPressed(self):
FILE: qt/selectable_list.py
class SelectableList (line 12) | class SelectableList(QAbstractListModel):
method __init__ (line 13) | def __init__(self, model, view, **kwargs):
method data (line 22) | def data(self, index, role):
method rowCount (line 30) | def rowCount(self, index):
method _updateSelection (line 36) | def _updateSelection(self):
method _restoreSelection (line 39) | def _restoreSelection(self):
method refresh (line 43) | def refresh(self):
method update_selection (line 50) | def update_selection(self):
class ComboboxModel (line 54) | class ComboboxModel(SelectableList):
method __init__ (line 55) | def __init__(self, model, view, **kwargs):
method _updateSelection (line 60) | def _updateSelection(self):
method _restoreSelection (line 65) | def _restoreSelection(self):
method selectionChanged (line 71) | def selectionChanged(self, index):
class ListviewModel (line 76) | class ListviewModel(SelectableList):
method __init__ (line 77) | def __init__(self, model, view, **kwargs):
method _updateSelection (line 82) | def _updateSelection(self):
method _restoreSelection (line 87) | def _restoreSelection(self):
method selectionChanged (line 98) | def selectionChanged(self, index):
FILE: qt/stats_label.py
class StatsLabel (line 10) | class StatsLabel:
method __init__ (line 11) | def __init__(self, model, view):
method refresh (line 16) | def refresh(self):
FILE: qt/tabbed_window.py
class TabWindow (line 26) | class TabWindow(QMainWindow):
method __init__ (line 27) | def __init__(self, app, **kwargs):
method _setupActions (line 38) | def _setupActions(self):
method _setupUi (line 53) | def _setupUi(self):
method restoreGeometry (line 77) | def restoreGeometry(self):
method _setupMenu (line 83) | def _setupMenu(self):
method updateMenuBar (line 113) | def updateMenuBar(self, page_index=-1):
method createPage (line 152) | def createPage(self, cls, **kwargs):
method addTab (line 174) | def addTab(self, page, title, switch=False):
method showTab (line 183) | def showTab(self, page):
method indexOfWidget (line 187) | def indexOfWidget(self, widget):
method setCurrentIndex (line 190) | def setCurrentIndex(self, index):
method removeTab (line 193) | def removeTab(self, index):
method isTabVisible (line 196) | def isTabVisible(self, index):
method getCurrentIndex (line 199) | def getCurrentIndex(self):
method getWidgetAtIndex (line 202) | def getWidgetAtIndex(self, index):
method getCount (line 205) | def getCount(self):
method appWillSavePrefs (line 209) | def appWillSavePrefs(self):
method showEvent (line 217) | def showEvent(self, event):
method changeEvent (line 223) | def changeEvent(self, event):
method closeEvent (line 228) | def closeEvent(self, close_event):
method onTabCloseRequested (line 236) | def onTabCloseRequested(self, index):
method onDialogAccepted (line 246) | def onDialogAccepted(self):
method toggleTabBar (line 254) | def toggleTabBar(self):
class TabBarWindow (line 260) | class TabBarWindow(TabWindow):
method __init__ (line 264) | def __init__(self, app, **kwargs):
method _setupUi (line 267) | def _setupUi(self):
method addTab (line 295) | def addTab(self, page, title, switch=True):
method showTabIndex (line 306) | def showTabIndex(self, index):
method indexOfWidget (line 311) | def indexOfWidget(self, widget):
method setCurrentIndex (line 315) | def setCurrentIndex(self, tab_index):
method setCurrentWidget (line 320) | def setCurrentWidget(self, widget):
method setTabIndex (line 325) | def setTabIndex(self, index):
method onRemovedWidget (line 331) | def onRemovedWidget(self, index):
method removeTab (line 335) | def removeTab(self, index):
method removeWidget (line 340) | def removeWidget(self, widget):
method isTabVisible (line 343) | def isTabVisible(self, index):
method getCurrentIndex (line 346) | def getCurrentIndex(self):
method getWidgetAtIndex (line 349) | def getWidgetAtIndex(self, index):
method getCount (line 352) | def getCount(self):
method toggleTabBar (line 356) | def toggleTabBar(self):
method onTabCloseRequested (line 362) | def onTabCloseRequested(self, index):
method onDialogAccepted (line 374) | def onDialogAccepted(self):
FILE: qt/table.py
class Table (line 21) | class Table(QAbstractTableModel):
method __init__ (line 26) | def __init__(self, model, view, **kwargs):
method _updateModelSelection (line 37) | def _updateModelSelection(self):
method _updateViewSelection (line 46) | def _updateViewSelection(self):
method _getData (line 60) | def _getData(self, row, column, role):
method _getFlags (line 69) | def _getFlags(self, row, column):
method _setData (line 76) | def _setData(self, row, column, value, role):
method columnCount (line 85) | def columnCount(self, index):
method data (line 88) | def data(self, index, role):
method flags (line 95) | def flags(self, index):
method headerData (line 102) | def headerData(self, section, orientation, role):
method revert (line 115) | def revert(self):
method rowCount (line 118) | def rowCount(self, index):
method setData (line 123) | def setData(self, index, value, role):
method sort (line 130) | def sort(self, section, order):
method submit (line 135) | def submit(self):
method selectionChanged (line 140) | def selectionChanged(self, selected, deselected):
method refresh (line 144) | def refresh(self):
method show_selected_row (line 149) | def show_selected_row(self):
method start_editing (line 153) | def start_editing(self):
method stop_editing (line 156) | def stop_editing(self):
method update_selection (line 159) | def update_selection(self):
FILE: qt/tree_model.py
class NodeContainer (line 14) | class NodeContainer:
method __init__ (line 15) | def __init__(self):
method _create_node (line 20) | def _create_node(self, ref, row):
method _get_children (line 24) | def _get_children(self):
method invalidate (line 29) | def invalidate(self):
method subnodes (line 35) | def subnodes(self):
class TreeNode (line 50) | class TreeNode(NodeContainer):
method __init__ (line 51) | def __init__(self, model, parent, row):
method index (line 58) | def index(self):
class RefNode (line 62) | class RefNode(TreeNode):
method __init__ (line 68) | def __init__(self, model, parent, ref, row):
method _create_node (line 72) | def _create_node(self, ref, row):
method _get_children (line 75) | def _get_children(self):
class DummyNode (line 80) | class DummyNode(TreeNode):
class TreeModel (line 84) | class TreeModel(QAbstractItemModel, NodeContainer):
method __init__ (line 85) | def __init__(self, **kwargs):
method _create_dummy_node (line 90) | def _create_dummy_node(self, parent, row):
method _last_index (line 98) | def _last_index(self):
method index (line 108) | def index(self, row, column, parent):
method parent (line 126) | def parent(self, index):
method reset (line 135) | def reset(self):
method rowCount (line 142) | def rowCount(self, parent=QModelIndex()):
method findIndex (line 147) | def findIndex(self, row_path):
method pathForIndex (line 159) | def pathForIndex(index):
method refreshData (line 166) | def refreshData(self):
FILE: qt/util.py
function move_to_screen_center (line 29) | def move_to_screen_center(widget):
function vertical_spacer (line 46) | def vertical_spacer(size=None):
function horizontal_spacer (line 53) | def horizontal_spacer(size=None):
function horizontal_wrap (line 60) | def horizontal_wrap(widgets):
function create_actions (line 75) | def create_actions(actions, target):
function set_accel_keys (line 88) | def set_accel_keys(menu):
function get_appdata (line 103) | def get_appdata(portable=False):
class SysWrapper (line 110) | class SysWrapper(io.IOBase):
method write (line 111) | def write(self, s):
function setup_qt_logging (line 116) | def setup_qt_logging(level=logging.WARNING, log_to_stdout=False):
function escape_amp (line 137) | def escape_amp(s):
function create_qsettings (line 143) | def create_qsettings():
FILE: run.py
function signal_handler (line 35) | def signal_handler(sig, frame):
function setup_signals (line 43) | def setup_signals():
function main (line 49) | def main():
Condensed preview — 344 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,375K chars).
[
{
"path": ".ctags",
"chars": 66,
"preview": "-R\n--exclude=build\n--exclude=env\n--exclude=.tox\n--python-kinds=-i\n"
},
{
"path": ".github/FUNDING.yml",
"chars": 18,
"preview": "github: arsenetar\n"
},
{
"path": ".github/ISSUE_TEMPLATE/bug_report.md",
"chars": 766,
"preview": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: bug\nassignees: ''\n\n---\n\n**Describe the "
},
{
"path": ".github/ISSUE_TEMPLATE/feature_request.md",
"chars": 600,
"preview": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: ''\nlabels: feature\nassignees: ''\n\n---\n\n**Is you"
},
{
"path": ".github/workflows/codeql-analysis.yml",
"chars": 1622,
"preview": "name: \"CodeQL\"\n\non:\n push:\n branches: [master]\n pull_request:\n # The branches below must be a subset of the bran"
},
{
"path": ".github/workflows/default.yml",
"chars": 2047,
"preview": "# Workflow lints, and checks format in parallel then runs tests on all platforms\n\nname: Default CI/CD\n\non:\n push:\n pul"
},
{
"path": ".github/workflows/tx-push.yml",
"chars": 629,
"preview": "# Push translation source to Transifex\nname: Transifex Sync\n\non:\n push:\n branches:\n - master\n paths:\n -"
},
{
"path": ".gitignore",
"chars": 1410,
"preview": "# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n*$py.class\n\n# C extensions\n*.so\n\n# Distribution / packagi"
},
{
"path": ".pre-commit-config.yaml",
"chars": 679,
"preview": "repos:\n - repo: https://github.com/pre-commit/pre-commit-hooks\n rev: v4.5.0\n hooks:\n - id: check-yaml\n "
},
{
"path": ".sonarcloud.properties",
"chars": 47,
"preview": "sonar.python.version=3.7, 3.8, 3.9, 3.10, 3.11\n"
},
{
"path": ".tx/config",
"chars": 493,
"preview": "[main]\nhost = https://www.transifex.com\n\n[o:voltaicideas:p:dupeguru-1:r:columns]\nfile_filter = locale/<lang>/LC_MESSAGES"
},
{
"path": ".vscode/extensions.json",
"chars": 399,
"preview": "{\n // List of extensions which should be recommended for users of this workspace.\n \"recommendations\": [\n \"r"
},
{
"path": ".vscode/launch.json",
"chars": 517,
"preview": "{\n // Use IntelliSense to learn about possible attributes.\n // Hover to view descriptions of existing attributes.\n"
},
{
"path": ".vscode/settings.json",
"chars": 366,
"preview": "{\n \"cSpell.words\": [\n \"Dupras\",\n \"hscommon\"\n ],\n \"editor.rulers\": [\n 88,\n 120\n ]"
},
{
"path": "CONTRIBUTING.md",
"chars": 5429,
"preview": "# Contributing to dupeGuru\n\nThe following is a set of guidelines and information for contributing to dupeGuru.\n\n#### Tab"
},
{
"path": "CREDITS",
"chars": 867,
"preview": "To know who contributed to dupeGuru, you can look at the commit log, but not all contributions\nresult in a commit. This "
},
{
"path": "LICENSE",
"chars": 32472,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
},
{
"path": "MANIFEST.in",
"chars": 93,
"preview": "recursive-include core *.h\nrecursive-include core *.m\ninclude run.py\ngraft locale\ngraft help\n"
},
{
"path": "Makefile",
"chars": 3709,
"preview": "PYTHON ?= python3\nPYTHON_VERSION_MINOR := $(shell ${PYTHON} -c \"import sys; print(sys.version_info.minor)\")\nPYRCC5 ?= py"
},
{
"path": "README.md",
"chars": 4049,
"preview": "# dupeGuru\n\n[dupeGuru][dupeguru] is a cross-platform (Linux, OS X, Windows) GUI tool to find duplicate files in\na system"
},
{
"path": "Windows.md",
"chars": 3296,
"preview": "## How to build dupeGuru for Windows\n\n### Prerequisites\n\n- [Python 3.7+][python]\n- [Visual Studio 2019][vs] or [Visual S"
},
{
"path": "build.py",
"chars": 4885,
"preview": "# Copyright 2017 Virgil Dupras\n#\n# This software is licensed under the \"GPLv3\" License as described in the \"LICENSE\" fil"
},
{
"path": "commitlint.config.js",
"chars": 508,
"preview": "const Configuration = {\n /*\n * Resolve and load @commitlint/config-conventional from node_modules.\n * Referen"
},
{
"path": "core/__init__.py",
"chars": 47,
"preview": "__version__ = \"4.3.1\"\n__appname__ = \"dupeGuru\"\n"
},
{
"path": "core/app.py",
"chars": 35740,
"preview": "# Copyright 2016 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed under the \"GPLv3\" License a"
},
{
"path": "core/directories.py",
"chars": 10673,
"preview": "# Copyright 2017 Virgil Dupras\n#\n# This software is licensed under the \"GPLv3\" License as described in the \"LICENSE\" fil"
},
{
"path": "core/engine.py",
"chars": 19921,
"preview": "# Created By: Virgil Dupras\n# Created On: 2006/01/29\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "core/exclude.py",
"chars": 18256,
"preview": "# This software is licensed under the \"GPLv3\" License as described in the \"LICENSE\" file,\n# which should be included wit"
},
{
"path": "core/export.py",
"chars": 3565,
"preview": "# Created By: Virgil Dupras\n# Created On: 2006/09/16\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "core/fs.py",
"chars": 15932,
"preview": "# Created By: Virgil Dupras\n# Created On: 2009-10-22\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "core/gui/__init__.py",
"chars": 743,
"preview": "\"\"\"\nMeta GUI elements in dupeGuru\n-----------------------------\n\ndupeGuru is designed with a `cross-toolkit`_ approach i"
},
{
"path": "core/gui/base.py",
"chars": 935,
"preview": "# Created By: Virgil Dupras\n# Created On: 2010-02-06\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "core/gui/deletion_options.py",
"chars": 3919,
"preview": "# Created On: 2012-05-30\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed un"
},
{
"path": "core/gui/details_panel.py",
"chars": 1648,
"preview": "# Created By: Virgil Dupras\n# Created On: 2010-02-05\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "core/gui/directory_tree.py",
"chars": 3347,
"preview": "# Created By: Virgil Dupras\n# Created On: 2010-02-06\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "core/gui/exclude_list_dialog.py",
"chars": 3156,
"preview": "# Created On: 2012/03/13\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed un"
},
{
"path": "core/gui/exclude_list_table.py",
"chars": 3032,
"preview": "# This software is licensed under the \"GPLv3\" License as described in the \"LICENSE\" file,\n# which should be included wit"
},
{
"path": "core/gui/ignore_list_dialog.py",
"chars": 1212,
"preview": "# Created On: 2012/03/13\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed un"
},
{
"path": "core/gui/ignore_list_table.py",
"chars": 1283,
"preview": "# Created By: Virgil Dupras\n# Created On: 2012-03-13\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "core/gui/prioritize_dialog.py",
"chars": 3022,
"preview": "# Created By: Virgil Dupras\n# Created On: 2011-09-06\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "core/gui/problem_dialog.py",
"chars": 870,
"preview": "# Created By: Virgil Dupras\n# Created On: 2010-04-12\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "core/gui/problem_table.py",
"chars": 1297,
"preview": "# Created By: Virgil Dupras\n# Created On: 2010-04-12\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "core/gui/result_table.py",
"chars": 6256,
"preview": "# Created By: Virgil Dupras\n# Created On: 2010-02-11\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "core/gui/stats_label.py",
"chars": 641,
"preview": "# Created By: Virgil Dupras\n# Created On: 2010-02-11\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "core/ignore.py",
"chars": 4193,
"preview": "# Created By: Virgil Dupras\n# Created On: 2006/05/02\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "core/markable.py",
"chars": 3064,
"preview": "# Created By: Virgil Dupras\n# Created On: 2006/02/23\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n\n# T"
},
{
"path": "core/me/__init__.py",
"chars": 66,
"preview": "from core.me import fs, prioritize, result_table, scanner # noqa\n"
},
{
"path": "core/me/fs.py",
"chars": 4008,
"preview": "# Created By: Virgil Dupras\n# Created On: 2009-10-23\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "core/me/prioritize.py",
"chars": 1173,
"preview": "# Created On: 2011/09/16\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed un"
},
{
"path": "core/me/result_table.py",
"chars": 1876,
"preview": "# Created On: 2011-11-27\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed un"
},
{
"path": "core/me/scanner.py",
"chars": 913,
"preview": "# Copyright 2016 Hardcoded Software (http://www.hardcoded.net)\r\n#\r\n# This software is licensed under the \"GPLv3\" License"
},
{
"path": "core/pe/__init__.py",
"chars": 153,
"preview": "from core.pe import ( # noqa\n block,\n cache,\n exif,\n matchblock,\n matchexif,\n photo,\n prioritize,\n"
},
{
"path": "core/pe/block.py",
"chars": 4409,
"preview": "# Created By: Virgil Dupras\n# Created On: 2006/09/01\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "core/pe/block.pyi",
"chars": 561,
"preview": "from typing import Tuple, List, Union, Sequence\n\n_block = Tuple[int, int, int]\n\nclass NoBlocksError(Exception): ... # n"
},
{
"path": "core/pe/cache.py",
"chars": 531,
"preview": "# Copyright 2016 Virgil Dupras\n#\n# This software is licensed under the \"GPLv3\" License as described in the \"LICENSE\" fil"
},
{
"path": "core/pe/cache.pyi",
"chars": 204,
"preview": "from typing import Union, Tuple, List\n\n_block = Tuple[int, int, int]\n\ndef colors_to_bytes(colors: List[_block]) -> bytes"
},
{
"path": "core/pe/cache_sqlite.py",
"chars": 7379,
"preview": "# Copyright 2016 Virgil Dupras\n#\n# This software is licensed under the \"GPLv3\" License as described in the \"LICENSE\" fil"
},
{
"path": "core/pe/exif.py",
"chars": 10920,
"preview": "# Created By: Virgil Dupras\n# Created On: 2011-04-20\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "core/pe/matchblock.py",
"chars": 11751,
"preview": "# Created By: Virgil Dupras\n# Created On: 2007/02/25\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "core/pe/matchexif.py",
"chars": 1138,
"preview": "# Created By: Virgil Dupras\n# Created On: 2011-04-20\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "core/pe/modules/block.c",
"chars": 7077,
"preview": "/* Created By: Virgil Dupras\n * Created On: 2010-01-30\n * Copyright 2014 Hardcoded Software (http://www.hardcoded.net)\n "
},
{
"path": "core/pe/modules/block_osx.m",
"chars": 8803,
"preview": "/* Created By: Virgil Dupras\n * Created On: 2010-02-04\n * Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n "
},
{
"path": "core/pe/modules/cache.c",
"chars": 1877,
"preview": "/* Created By: Virgil Dupras\n * Created On: 2010-01-30\n * Copyright 2014 Hardcoded Software (http://www.hardcoded.net)\n "
},
{
"path": "core/pe/modules/common.c",
"chars": 946,
"preview": "/* Created By: Virgil Dupras\n * Created On: 2010-02-04\n * Copyright 2014 Hardcoded Software (http://www.hardcoded.net)\n "
},
{
"path": "core/pe/modules/common.h",
"chars": 590,
"preview": "/* Created By: Virgil Dupras\n * Created On: 2010-02-04\n * Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n "
},
{
"path": "core/pe/photo.py",
"chars": 4075,
"preview": "# Copyright 2016 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed under the \"GPLv3\" License a"
},
{
"path": "core/pe/prioritize.py",
"chars": 956,
"preview": "# Created On: 2011/09/16\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed un"
},
{
"path": "core/pe/result_table.py",
"chars": 1224,
"preview": "# Created On: 2011-11-27\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed un"
},
{
"path": "core/pe/scanner.py",
"chars": 1283,
"preview": "# Copyright 2016 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed under the \"GPLv3\" License a"
},
{
"path": "core/prioritize.py",
"chars": 5457,
"preview": "# Created By: Virgil Dupras\n# Created On: 2011/09/07\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "core/results.py",
"chars": 16064,
"preview": "# Created By: Virgil Dupras\n# Created On: 2006/02/23\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "core/scanner.py",
"chars": 8974,
"preview": "# Copyright 2016 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed under the \"GPLv3\" License a"
},
{
"path": "core/se/__init__.py",
"chars": 54,
"preview": "from core.se import fs, result_table, scanner # noqa\n"
},
{
"path": "core/se/fs.py",
"chars": 1503,
"preview": "# Created By: Virgil Dupras\n# Created On: 2013-07-14\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "core/se/result_table.py",
"chars": 1131,
"preview": "# Created On: 2011-11-27\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed un"
},
{
"path": "core/se/scanner.py",
"chars": 658,
"preview": "# Copyright 2016 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed under the \"GPLv3\" License a"
},
{
"path": "core/tests/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "core/tests/app_test.py",
"chars": 20612,
"preview": "# Copyright 2016 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed under the \"GPLv3\" License a"
},
{
"path": "core/tests/base.py",
"chars": 5792,
"preview": "# Copyright 2016 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed under the \"GPLv3\" License a"
},
{
"path": "core/tests/block_test.py",
"chars": 5647,
"preview": "# Copyright 2016 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed under the \"GPLv3\" License a"
},
{
"path": "core/tests/cache_test.py",
"chars": 4727,
"preview": "# Copyright 2016 Virgil Dupras\n#\n# This software is licensed under the \"GPLv3\" License as described in the \"LICENSE\" fil"
},
{
"path": "core/tests/conftest.py",
"chars": 42,
"preview": "from hscommon.testutil import app # noqa\n"
},
{
"path": "core/tests/directories_test.py",
"chars": 21237,
"preview": "# Copyright 2016 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed under the \"GPLv3\" License a"
},
{
"path": "core/tests/engine_test.py",
"chars": 30188,
"preview": "# Copyright 2016 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed under the \"GPLv3\" License a"
},
{
"path": "core/tests/exclude_test.py",
"chars": 17739,
"preview": "# Copyright 2016 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed under the \"GPLv3\" License a"
},
{
"path": "core/tests/fs_test.py",
"chars": 4604,
"preview": "# Created By: Virgil Dupras\n# Created On: 2009-10-23\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "core/tests/ignore_test.py",
"chars": 4351,
"preview": "# Copyright 2016 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed under the \"GPLv3\" License a"
},
{
"path": "core/tests/markable_test.py",
"chars": 3689,
"preview": "# Copyright 2016 Hardcoded Software (http://www.hardcoded.net)\n\n# This software is licensed under the \"GPLv3\" License as"
},
{
"path": "core/tests/prioritize_test.py",
"chars": 6310,
"preview": "# Created By: Virgil Dupras\n# Created On: 2011/09/07\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "core/tests/result_table_test.py",
"chars": 2229,
"preview": "# Created By: Virgil Dupras\n# Created On: 2013-07-28\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "core/tests/results_test.py",
"chars": 31679,
"preview": "# Copyright 2016 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed under the \"GPLv3\" License a"
},
{
"path": "core/tests/scanner_test.py",
"chars": 20264,
"preview": "# Copyright 2016 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed under the \"GPLv3\" License a"
},
{
"path": "core/util.py",
"chars": 3646,
"preview": "# Copyright 2016 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed under the \"GPLv3\" License a"
},
{
"path": "help/changelog",
"chars": 25232,
"preview": "=== 4.3.1 (2022-07-08)\n* Fix issue where cache db exceptions could prevent files being hashed (#1015)\n* Add extra guard "
},
{
"path": "help/changelog.tmpl",
"chars": 478,
"preview": ":tocdepth: 1\n\nChangelog\n=========\n\n**About the word \"crash\":** When reading this changelog, you might be alarmed at the "
},
{
"path": "help/conf.tmpl",
"chars": 6166,
"preview": "# -*- coding: utf-8 -*-\n#\n# dupeGuru documentation build configuration file, created by\n# sphinx-quickstart on Wed Jan 1"
},
{
"path": "help/de/faq.rst",
"chars": 9125,
"preview": "Häufig gestellte Fragen\n==========================\n\n.. topic:: What is dupeGuru?\n\n .. only:: edition_se\n\n Dupe"
},
{
"path": "help/de/folders.rst",
"chars": 1998,
"preview": "Ordnerauswahl\n================\n\nDas erste Fenster das Sie sehen, wenn dupeGuru gestartet wird, ist das Ordnerauswahl Fen"
},
{
"path": "help/de/index.rst",
"chars": 1297,
"preview": "dupeGuru Hilfe\n===============\n\n.. only:: edition_se\n\n Dieses Dokument ist auch auf `Englisch <http://dupeguru.voltai"
},
{
"path": "help/de/preferences.rst",
"chars": 9387,
"preview": "Einstellungen\n=============\n\n.. only:: edition_se\n\n **Scan Typ:** Diese Option bestimmt nach welcher Eigenschaft die "
},
{
"path": "help/de/quick_start.rst",
"chars": 1072,
"preview": "Schnellstart\n============\n\nDamit Sie sich schnell mit dupeGuru zurechtfinden, machen wir für den Anfang einen Standardsc"
},
{
"path": "help/de/reprioritize.rst",
"chars": 1762,
"preview": "Re-Prioritizing duplicates\n==========================\n\ndupeGuru tries to automatically determine which duplicate should "
},
{
"path": "help/de/results.rst",
"chars": 10949,
"preview": "Ergebnisse\n==========\n\nSobald dupeGuru den Duplikatescan beendet hat, werden die Ergebnisse in Form einer Duplikate-Grup"
},
{
"path": "help/en/contribute.rst",
"chars": 5182,
"preview": "Contribute to dupeGuru\n======================\n\ndupeGuru was started as shareware (thus proprietary) so it doesn't have a"
},
{
"path": "help/en/developer/core/app.rst",
"chars": 58,
"preview": "core.app\n========\n\n.. automodule:: core.app\n :members:\n"
},
{
"path": "help/en/developer/core/directories.rst",
"chars": 82,
"preview": "core.directories\n================\n\n.. automodule:: core.directories\n :members:\n"
},
{
"path": "help/en/developer/core/engine.rst",
"chars": 1293,
"preview": "core.engine\n===========\n\n.. automodule:: core.engine\n\n .. autoclass:: Match\n\n .. autoclass:: Group\n :member"
},
{
"path": "help/en/developer/core/fs.rst",
"chars": 55,
"preview": "core.fs\n=======\n\n.. automodule:: core.fs\n :members:\n"
},
{
"path": "help/en/developer/core/gui/deletion_options.rst",
"chars": 109,
"preview": "core.gui.deletion_options\n=========================\n\n.. automodule:: core.gui.deletion_options\n :members:\n"
},
{
"path": "help/en/developer/core/gui/index.rst",
"chars": 111,
"preview": "core.gui\n========\n\n.. automodule:: core.gui\n :members:\n\n.. toctree::\n :maxdepth: 2\n\n deletion_options\n"
},
{
"path": "help/en/developer/core/index.rst",
"chars": 110,
"preview": "core\n====\n\n.. toctree::\n :maxdepth: 2\n\n app\n fs\n engine\n directories\n results\n gui/index\n"
},
{
"path": "help/en/developer/core/results.rst",
"chars": 70,
"preview": "core.results\n============\n\n.. automodule:: core.results\n :members:\n"
},
{
"path": "help/en/developer/hscommon/build.rst",
"chars": 76,
"preview": "hscommon.build\n==============\n\n.. automodule:: hscommon.build\n :members:\n"
},
{
"path": "help/en/developer/hscommon/conflict.rst",
"chars": 85,
"preview": "hscommon.conflict\n=================\n\n.. automodule:: hscommon.conflict\n :members:\n"
},
{
"path": "help/en/developer/hscommon/desktop.rst",
"chars": 82,
"preview": "hscommon.desktop\n================\n\n.. automodule:: hscommon.desktop\n :members:\n"
},
{
"path": "help/en/developer/hscommon/gui/base.rst",
"chars": 186,
"preview": "hscommon.gui.base\n=================\n\n.. automodule:: hscommon.gui.base\n\n .. autosummary::\n\n GUIObject\n\n .. "
},
{
"path": "help/en/developer/hscommon/gui/column.rst",
"chars": 439,
"preview": "hscommon.gui.column\n============================\n\n.. automodule:: hscommon.gui.column\n\n .. autosummary::\n\n Col"
},
{
"path": "help/en/developer/hscommon/gui/progress_window.rst",
"chars": 339,
"preview": "hscommon.gui.progress_window\n============================\n\n.. automodule:: hscommon.gui.progress_window\n\n .. autosumm"
},
{
"path": "help/en/developer/hscommon/gui/selectable_list.rst",
"chars": 521,
"preview": "hscommon.gui.selectable_list\n============================\n\n.. automodule:: hscommon.gui.selectable_list\n\n .. autosumm"
},
{
"path": "help/en/developer/hscommon/gui/table.rst",
"chars": 423,
"preview": "hscommon.gui.table\n==================\n\n.. automodule:: hscommon.gui.table\n\n .. autosummary::\n\n Table\n R"
},
{
"path": "help/en/developer/hscommon/gui/text_field.rst",
"chars": 278,
"preview": "hscommon.gui.text_field\n=======================\n\n.. automodule:: hscommon.gui.text_field\n\n .. autosummary::\n\n "
},
{
"path": "help/en/developer/hscommon/gui/tree.rst",
"chars": 258,
"preview": "hscommon.gui.tree\n=================\n\n.. automodule:: hscommon.gui.tree\n\n .. autosummary::\n\n Tree\n Node\n"
},
{
"path": "help/en/developer/hscommon/index.rst",
"chars": 153,
"preview": "hscommon\n========\n\n.. toctree::\n :maxdepth: 2\n :glob:\n\n build\n conflict\n desktop\n notify\n path\n "
},
{
"path": "help/en/developer/hscommon/jobprogress/job.rst",
"chars": 257,
"preview": "hscommon.jobprogress.job\n========================\n\n.. automodule:: hscommon.jobprogress.job\n\n .. autosummary::\n\n "
},
{
"path": "help/en/developer/hscommon/jobprogress/performer.rst",
"chars": 221,
"preview": "hscommon.jobprogress.performer\n==============================\n\n.. automodule:: hscommon.jobprogress.performer\n\n .. au"
},
{
"path": "help/en/developer/hscommon/notify.rst",
"chars": 79,
"preview": "hscommon.notify\n===============\n\n.. automodule:: hscommon.notify\n :members:\n"
},
{
"path": "help/en/developer/hscommon/path.rst",
"chars": 73,
"preview": "hscommon.path\n=============\n\n.. automodule:: hscommon.path\n :members:\n"
},
{
"path": "help/en/developer/hscommon/util.rst",
"chars": 73,
"preview": "hscommon.util\n=============\n\n.. automodule:: hscommon.util\n :members:\n"
},
{
"path": "help/en/developer/index.rst",
"chars": 3283,
"preview": "Developer Guide\n===============\n\nWhen looking at a non-trivial codebase for the first time, it's very difficult to under"
},
{
"path": "help/en/faq.rst",
"chars": 9096,
"preview": "Frequently Asked Questions\n==========================\n\n.. contents::\n\nWhat is dupeGuru?\n-----------------\n\ndupeGuru is a"
},
{
"path": "help/en/folders.rst",
"chars": 2914,
"preview": "Folder Selection\n================\n\nThe first window you see when you launch dupeGuru is the folder selection window. Thi"
},
{
"path": "help/en/index.rst",
"chars": 1192,
"preview": "dupeGuru help\n=============\n\nThis help document is also available in these languages:\n\n* `French <http://dupeguru.voltai"
},
{
"path": "help/en/preferences.rst",
"chars": 4015,
"preview": "Preferences\n===========\n\n**Tags to scan:**\n When using the **Tags** scan type, you can select the tags that will be u"
},
{
"path": "help/en/quick_start.rst",
"chars": 938,
"preview": "Quick Start\n===========\n\nTo get you quickly started with dupeGuru, let's just make a standard scan using default prefere"
},
{
"path": "help/en/reprioritize.rst",
"chars": 1762,
"preview": "Re-Prioritizing duplicates\n==========================\n\ndupeGuru tries to automatically determine which duplicate should "
},
{
"path": "help/en/results.rst",
"chars": 11903,
"preview": "Results\n=======\n\n.. contents::\n\nWhen dupeGuru is finished scanning for duplicates, it will show its results in the form "
},
{
"path": "help/en/scan.rst",
"chars": 8795,
"preview": "The scanning process\n====================\n\n.. contents::\n\ndupeGuru has 3 basic ways of scanning: :ref:`worded-scan` and "
},
{
"path": "help/fr/faq.rst",
"chars": 10106,
"preview": "Foire aux questions\n===================\n\n.. contents::\n\nQu'est-ce que dupeGuru?\n------------------------\n\n.. only:: edit"
},
{
"path": "help/fr/folders.rst",
"chars": 3318,
"preview": "Sélection de dossiers\n=====================\n\nLa première fenêtre qui apparaît lorsque dupeGuru démarre est la fenêtre de"
},
{
"path": "help/fr/index.rst",
"chars": 1401,
"preview": "Aide dupeGuru\n===============\n\n.. only:: edition_se\n\n Ce document est aussi disponible en `anglais <http://dupeguru.v"
},
{
"path": "help/fr/preferences.rst",
"chars": 8212,
"preview": "Préférences\n===========\n\n.. only:: edition_se\n\n **Type de scan:** Cette option détermine quels aspects du fichier doi"
},
{
"path": "help/fr/quick_start.rst",
"chars": 942,
"preview": "Démarrage rapide\n=================\n\nVoici les étapes à suivre pour faire un simple scan par défaut:\n\n* Démarrer dupeGuru"
},
{
"path": "help/fr/reprioritize.rst",
"chars": 1762,
"preview": "Re-Prioritizing duplicates\n==========================\n\ndupeGuru tries to automatically determine which duplicate should "
},
{
"path": "help/fr/results.rst",
"chars": 9753,
"preview": "Résultats\n==========\n\nQuand dupeGuru a terminé de scanner, la fenêtre de résultat apparaît avec la liste de groupes de d"
},
{
"path": "help/hy/faq.rst",
"chars": 9052,
"preview": "Հաճախ Տրվող Հարցեր\n==========================\n\n.. topic:: Ի՞նչ է dupeGuru-ը:\n\n .. only:: edition_se\n\n dupeGur"
},
{
"path": "help/hy/folders.rst",
"chars": 1875,
"preview": "Թղթապանակի ընտրություն\n=======================\n\nԱռաջին թղթապանակը, որ Դուք տեսնում եք dupeGuru-ն բացելիս դա թղթապանակի "
},
{
"path": "help/hy/index.rst",
"chars": 1334,
"preview": "dupeGuru help\n===============\n\n.. only:: edition_se\n\n Այս փաստաթուղթը հասանելի է նաև՝ `Ֆրանսերեն <http://dupeguru.vo"
},
{
"path": "help/hy/preferences.rst",
"chars": 9334,
"preview": "Կարգավորումներ\n================\n\n.. only:: edition_se\n\n **Ստուգելու տեսակը.** Այս ընտրանքը որոշում է, թե ֆայլերի որ "
},
{
"path": "help/hy/quick_start.rst",
"chars": 904,
"preview": "Արագ Սկիզբ\n===========\n\nԱրագ սկսելու համար dupeGuru-ն, պարզապես կատարեք ստանդարտ ստուգում՝ օգտագործելով ծրագրային կարգա"
},
{
"path": "help/hy/reprioritize.rst",
"chars": 1695,
"preview": "Վերաառաջնայնության կրկնօրինակներ\n================================\n\ndupeGuru-ը փորձում է որոշել, թե որ կրկնօրինակները պե"
},
{
"path": "help/hy/results.rst",
"chars": 10255,
"preview": "Արդյունքները\n=============\n\nԵրբ dupeGuru-ն ավարտի կրկնօրինակների ստուգումը, կցուցադրի արդյունքները կրկնօրինակ խմբերի ցա"
},
{
"path": "help/ru/faq.rst",
"chars": 9079,
"preview": "Часто задаваемые вопросы\n==========================\n\n.. topic:: Что такое dupeGuru?\n\n .. only:: edition_se\n\n "
},
{
"path": "help/ru/folders.rst",
"chars": 1947,
"preview": "Выбор папки\r\n================\r\n\r\nПервое окно, вы видите, когда вы запускаете dupeGuru это окно выбора папки. Это окно с"
},
{
"path": "help/ru/index.rst",
"chars": 1379,
"preview": "dupeGuru help\n===============\n\nЭтот документ также доступна на `французском <http://dupeguru.voltaicideas.net/help/fr/>"
},
{
"path": "help/ru/preferences.rst",
"chars": 9417,
"preview": "Предпочтения\n=============\n\n.. only:: edition_se\n\n **Тип сканирования:** Этот параметр определяет, какой аспект файл"
},
{
"path": "help/ru/quick_start.rst",
"chars": 1013,
"preview": "Быстрый старт\r\n=============\r\n\r\nЧтобы вы быстро начали с dupeGuru, давайте просто делать сканирование с помощью стандар"
},
{
"path": "help/ru/reprioritize.rst",
"chars": 1801,
"preview": "Повторное приоритетов дубликатов\r\n================================\r\n\r\ndupeGuru пытается автоматически определить, какие"
},
{
"path": "help/ru/results.rst",
"chars": 10805,
"preview": "Результаты\r\n==========\r\n\r\nКогда dupeGuru завершения сканирования на наличие дубликатов, он покажет его результаты в вид"
},
{
"path": "help/uk/faq.rst",
"chars": 8779,
"preview": "Часті питання\n==========================\n\n.. topic:: Що таке dupeGuru?\n\n .. only:: edition_se\n\n dupeGuru це і"
},
{
"path": "help/uk/folders.rst",
"chars": 1889,
"preview": "Вибір папки\n================\n\nПерше вікно, ви бачите, коли ви запускаєте dupeGuru це вікно вибору папки. Це вікно місти"
},
{
"path": "help/uk/index.rst",
"chars": 1370,
"preview": "dupeGuru help\n===============\n\n.. only:: edition_se\n\n Цей документ також доступна на `французькому <http://dupeguru."
},
{
"path": "help/uk/preferences.rst",
"chars": 9096,
"preview": "Уподобання\n===========\n\n.. only:: edition_se\n\n **Тип сканування:** Цей параметр визначає, який аспект файли будуть п"
},
{
"path": "help/uk/quick_start.rst",
"chars": 975,
"preview": "Швидкий старт\n==============\n\nЩоб ви швидко почали з dupeGuru, давайте просто робити сканування за допомогою стандартни"
},
{
"path": "help/uk/reprioritize.rst",
"chars": 1746,
"preview": "Повторне пріоритетів дублікатів\n================================\n\ndupeGuru намагається автоматично визначити, які дублі"
},
{
"path": "help/uk/results.rst",
"chars": 10424,
"preview": "Результати\n===========\n\nКоли dupeGuru завершення сканування на наявність дублікатів, він покаже його результати у вигля"
},
{
"path": "hscommon/LICENSE",
"chars": 1526,
"preview": "Copyright 2014, Hardcoded Software Inc., http://www.hardcoded.net\nAll rights reserved.\n\nRedistribution and use in source"
},
{
"path": "hscommon/README",
"chars": 216,
"preview": "This module is common code used in all Hardcoded Software applications. It has no stable API so\nit is not recommended to"
},
{
"path": "hscommon/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "hscommon/build.py",
"chars": 11452,
"preview": "# Created By: Virgil Dupras\n# Created On: 2009-03-03\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n\n# T"
},
{
"path": "hscommon/conflict.py",
"chars": 2971,
"preview": "# Created By: Virgil Dupras\n# Created On: 2008-01-08\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n\n# T"
},
{
"path": "hscommon/desktop.py",
"chars": 3091,
"preview": "# Created By: Virgil Dupras\n# Created On: 2013-10-12\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "hscommon/gui/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "hscommon/gui/base.py",
"chars": 3581,
"preview": "# Copyright 2016 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed under the \"GPLv3\" License a"
},
{
"path": "hscommon/gui/column.py",
"chars": 12278,
"preview": "# Created By: Virgil Dupras\n# Created On: 2010-07-25\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "hscommon/gui/progress_window.py",
"chars": 6316,
"preview": "# Copyright 2016 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed under the \"GPLv3\" License a"
},
{
"path": "hscommon/gui/selectable_list.py",
"chars": 6722,
"preview": "# Created By: Virgil Dupras\n# Created On: 2011-09-06\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "hscommon/gui/table.py",
"chars": 21256,
"preview": "# Created By: Eric Mc Sween\n# Created On: 2008-05-29\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "hscommon/gui/text_field.py",
"chars": 3465,
"preview": "# Created On: 2012/01/23\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed un"
},
{
"path": "hscommon/gui/tree.py",
"chars": 7472,
"preview": "# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed under the \"GPLv3\" License a"
},
{
"path": "hscommon/jobprogress/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "hscommon/jobprogress/job.py",
"chars": 6812,
"preview": "# Created By: Virgil Dupras\n# Created On: 2004/12/20\n# Copyright 2011 Hardcoded Software (http://www.hardcoded.net)\n\n# T"
},
{
"path": "hscommon/jobprogress/performer.py",
"chars": 2373,
"preview": "# Created By: Virgil Dupras\n# Created On: 2010-11-19\n# Copyright 2011 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "hscommon/loc.py",
"chars": 3602,
"preview": "import os\nimport os.path as op\nimport shutil\nimport tempfile\nfrom typing import Any, List\n\nimport polib\n\nfrom hscommon i"
},
{
"path": "hscommon/notify.py",
"chars": 3343,
"preview": "# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n\n# This software is licensed under the \"GPLv3\" License as"
},
{
"path": "hscommon/path.py",
"chars": 1892,
"preview": "# Created By: Virgil Dupras\n# Created On: 2006/02/21\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n\n# T"
},
{
"path": "hscommon/plat.py",
"chars": 675,
"preview": "# Created On: 2011/09/22\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# This software is licensed un"
},
{
"path": "hscommon/pygettext.py",
"chars": 12538,
"preview": "# This module was taken from CPython's Tools/i18n and dirtily hacked to bypass the need for cmdline\n# invocation.\n\n# Ori"
},
{
"path": "hscommon/sphinxgen.py",
"chars": 2969,
"preview": "# Copyright 2018 Virgil Dupras\n#\n# This software is licensed under the \"GPLv3\" License as described in the \"LICENSE\" fil"
},
{
"path": "hscommon/tests/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "hscommon/tests/conflict_test.py",
"chars": 4451,
"preview": "# Created By: Virgil Dupras\n# Created On: 2008-01-08\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n\n# T"
},
{
"path": "hscommon/tests/notify_test.py",
"chars": 4444,
"preview": "# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n\n# This software is licensed under the \"GPLv3\" License as"
},
{
"path": "hscommon/tests/path_test.py",
"chars": 857,
"preview": "# Created By: Virgil Dupras\n# Created On: 2006/02/21\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n\n# T"
},
{
"path": "hscommon/tests/selectable_list_test.py",
"chars": 2577,
"preview": "# Created By: Virgil Dupras\n# Created On: 2011-09-06\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "hscommon/tests/table_test.py",
"chars": 10049,
"preview": "# Created By: Virgil Dupras\n# Created On: 2008-08-12\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "hscommon/tests/tree_test.py",
"chars": 3443,
"preview": "# Created By: Virgil Dupras\n# Created On: 2010-02-12\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "hscommon/tests/util_test.py",
"chars": 9695,
"preview": "# Created By: Virgil Dupras\n# Created On: 2011-01-11\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "hscommon/testutil.py",
"chars": 6339,
"preview": "# Created By: Virgil Dupras\n# Created On: 2010-11-14\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "hscommon/trans.py",
"chars": 5015,
"preview": "# Created By: Virgil Dupras\n# Created On: 2010-06-23\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "hscommon/util.py",
"chars": 10435,
"preview": "# Created By: Virgil Dupras\n# Created On: 2011-01-11\n# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)\n#\n# "
},
{
"path": "locale/ar/LC_MESSAGES/columns.po",
"chars": 2786,
"preview": "# Translators:\n# Andrew Senetar <arsenetar@gmail.com>, 2022\n#\nmsgid \"\"\nmsgstr \"\"\n\"Last-Translator: Andrew Senetar <arsen"
}
]
// ... and 144 more files (download for full content)
About this extraction
This page contains the full source code of the arsenetar/dupeguru GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 344 files (2.1 MB), approximately 573.3k tokens, and a symbol index with 2144 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.