1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2025-05-08 09:49:51 +00:00

Compare commits

..

1 Commits

Author SHA1 Message Date
791d898195
Migrate from hscommon.path to pathlib
- Part one, this gets all hscommon and core tests passing
- App appears to be able to load directories and complete scans, need further testing
- app.py copy_or_move needs some additional work
2022-03-17 23:56:52 -05:00
22 changed files with 175 additions and 413 deletions

13
.github/FUNDING.yml vendored
View File

@ -1,13 +0,0 @@
# These are supported funding model platforms
github: arsenetar
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View File

@ -2,12 +2,12 @@ name: "CodeQL"
on:
push:
branches: [master]
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
branches: [ master ]
schedule:
- cron: "24 20 * * 2"
- cron: '24 20 * * 2'
jobs:
analyze:
@ -21,30 +21,30 @@ jobs:
strategy:
fail-fast: false
matrix:
language: ["cpp", "python"]
language: [ 'cpp', 'python' ]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v2
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
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@v1
# Analysis
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
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@v1
# Analysis
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

View File

@ -4,48 +4,48 @@ name: Default CI/CD
on:
push:
branches: [master]
branches: [ master ]
pull_request:
branches: [master]
branches: [ master ]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-extra.txt
- name: Lint with flake8
run: |
flake8 .
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-extra.txt
- name: Lint with flake8
run: |
flake8 .
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-extra.txt
- name: Check format with black
run: |
black .
- uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-extra.txt
- name: Check format with black
run: |
black .
test:
needs: [lint, format]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9, "3.10"]
python-version: [3.7, 3.8, 3.9, '3.10']
exclude:
- os: macos-latest
python-version: 3.7
@ -61,24 +61,24 @@ jobs:
python-version: 3.9
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
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@v3
with:
name: modules ${{ matrix.python-version }}
path: ${{ github.workspace }}/**/*.so
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
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@v3
with:
name: modules ${{ matrix.python-version }}
path: ${{ github.workspace }}/**/*.so

127
.gitignore vendored
View File

@ -1,111 +1,30 @@
# 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
__pycache__
*.egg-info
*.so
*.mo
*.waf*
.lock-waf*
.tox
/tags
*.eggs
# Visual Studio Code
.vscode/*
!.vscode/settings.json
#!.vscode/tasks.json
#!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
build
dist
env*
/deps
cocoa/autogen
# Local History for Visual Studio Code
.history/
# Built Visual Studio Code Extensions
*.vsix
# dupeGuru Specific
/run.py
/cocoa/*/Info.plist
/cocoa/*/build
/qt/*_rc.py
/help/*/conf.py
/help/*/changelog.rst
cocoa/autogen
/cocoa/*/Info.plist
/cocoa/*/build
/transifex
*.waf*
.lock-waf*
/tags
*.pyd
*.exe
*.spec
.vscode

View File

@ -1,27 +1,26 @@
[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]
[dupeguru-1.core]
file_filter = locale/<lang>/LC_MESSAGES/core.po
source_file = locale/core.pot
source_lang = en
type = PO
type = PO
[o:voltaicideas:p:dupeguru-1:r:qtlib]
file_filter = qtlib/locale/<lang>/LC_MESSAGES/qtlib.po
source_file = qtlib/locale/qtlib.pot
[dupeguru-1.columns]
file_filter = locale/<lang>/LC_MESSAGES/columns.po
source_file = locale/columns.pot
source_lang = en
type = PO
type = PO
[o:voltaicideas:p:dupeguru-1:r:ui]
[dupeguru-1.ui]
file_filter = locale/<lang>/LC_MESSAGES/ui.po
source_file = locale/ui.pot
source_lang = en
type = PO
type = PO
[dupeguru-1.qtlib]
file_filter = qtlib/locale/<lang>/LC_MESSAGES/qtlib.po
source_file = qtlib/locale/qtlib.pot
source_lang = en
type = PO

View File

@ -1,10 +0,0 @@
{
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"redhat.vscode-yaml",
"ms-python.vscode-pylance",
"ms-python.python"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
}

12
.vscode/settings.json vendored
View File

@ -1,12 +0,0 @@
{
"python.formatting.provider": "black",
"cSpell.words": [
"Dupras",
"hscommon"
],
"python.languageServer": "Pylance",
"yaml.schemaStore.enable": true,
"yaml.schemas": {
"https://json.schemastore.org/github-workflow.json": ".github/workflows/*.yml"
}
}

View File

@ -1,88 +0,0 @@
# 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.

View File

@ -1,7 +1,7 @@
PYTHON ?= python3
PYTHON_VERSION_MINOR := $(shell ${PYTHON} -c "import sys; print(sys.version_info.minor)")
PYRCC5 ?= pyrcc5
REQ_MINOR_VERSION = 7
REQ_MINOR_VERSION = 6
PREFIX ?= /usr/local
# Window compatability via Msys2

View File

@ -1,2 +1,2 @@
__version__ = "4.2.1"
__version__ = "4.2.0"
__appname__ = "dupeGuru"

View File

@ -12,7 +12,7 @@ a community around this project.
So, whatever your skills, if you're interested in contributing to dupeGuru, please do so. Normally,
this documentation should be enough to get you started, but if it isn't, then **please**,
open a discussion at https://github.com/arsenetar/dupeguru/discussions. If there's any situation where you'd
`let me know`_ because it's a problem that I'm committed to fix. If there's any situation where you'd
wish to contribute but some doubt you're having prevent you from going forward, please contact me.
I'd much prefer to spend the time figuring out with you whether (and how) you can contribute than
taking the chance of missing that opportunity.
@ -82,9 +82,10 @@ agree on what should be added to the documentation.
dupeGuru. For more information about how to do that, you can refer to the `translator guide`_.
.. _been open source: https://www.hardcoded.net/articles/free-as-in-speech-fair-as-in-trade
.. _let me know: mailto:hsoft@hardcoded.net
.. _Source code repository: https://github.com/arsenetar/dupeguru
.. _Issue Tracker: https://github.com/arsenetar/issues
.. _Issue labels meaning: https://github.com/arsenetar/wiki/issue-labels
.. _Issue Tracker: https://github.com/hsoft/arsenetar/issues
.. _Issue labels meaning: https://github.com/hsoft/arsenetar/wiki/issue-labels
.. _Sphinx: http://sphinx-doc.org/
.. _reST: http://en.wikipedia.org/wiki/ReStructuredText
.. _translator guide: https://github.com/arsenetar/wiki/Translator-Guide
.. _translator guide: https://github.com/hsoft/arsenetar/wiki/Translator-Guide

View File

@ -45,7 +45,7 @@ class _ActualThread(threading.Thread):
self._lock = threading.Lock()
self._run = True
self.lastrowid = -1
self.daemon = True
self.setDaemon(True)
self.start()
def _query(self, query):

View File

@ -1,9 +1,9 @@
# Translators:
# Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi (MNH48) <admin@mnh48.moe>, 2022
# Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi (MNH48) <admin@mnh48.moe>, 2021
#
msgid ""
msgstr ""
"Last-Translator: Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi (MNH48) <admin@mnh48.moe>, 2022\n"
"Last-Translator: Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi (MNH48) <admin@mnh48.moe>, 2021\n"
"Language-Team: Malay (https://www.transifex.com/voltaicideas/teams/116153/ms/)\n"
"Language: ms\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -987,4 +987,4 @@ msgstr "Cache dikosongkan."
#: qt\preferences_dialog.py:173
msgid "Use dark style"
msgstr "Guna gaya gelap"
msgstr ""

View File

@ -1,10 +1,10 @@
# Translators:
# Ahmet Haydar Işık <itsahmthydr@gmail.com>, 2021
# Emin Tufan Çetin <etcetin@gmail.com>, 2022
# Emin Tufan Çetin <etcetin@gmail.com>, 2021
#
msgid ""
msgstr ""
"Last-Translator: Emin Tufan Çetin <etcetin@gmail.com>, 2022\n"
"Last-Translator: Emin Tufan Çetin <etcetin@gmail.com>, 2021\n"
"Language-Team: Turkish (https://www.transifex.com/voltaicideas/teams/116153/tr/)\n"
"Language: tr\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -983,4 +983,4 @@ msgstr "Önbellek temizlendi."
#: qt\preferences_dialog.py:173
msgid "Use dark style"
msgstr "Karanlık biçem kullan"
msgstr ""

View File

@ -1,9 +1,6 @@
# Translators:
# 太子 VC <taiziccf@gmail.com>, 2021
#
msgid ""
msgstr ""
"Last-Translator: 太子 VC <taiziccf@gmail.com>, 2021\n"
"Language-Team: Chinese (Taiwan) (https://www.transifex.com/voltaicideas/teams/116153/zh_TW/)\n"
"Language: zh_TW\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -12,53 +9,53 @@ msgstr ""
#: qt/app.py:81
msgid "Quit"
msgstr "退出"
msgstr ""
#: qt/app.py:82 qt/preferences_dialog.py:116
#: cocoa/en.lproj/Localizable.strings:0
msgid "Options"
msgstr "选项"
msgstr ""
#: qt/app.py:83 qt/ignore_list_dialog.py:32
#: cocoa/en.lproj/Localizable.strings:0
msgid "Ignore List"
msgstr "忽略列表"
msgstr ""
#: qt/app.py:84 qt/app.py:179 cocoa/en.lproj/Localizable.strings:0
msgid "Clear Picture Cache"
msgstr "清空图片缓存"
msgstr ""
#: qt/app.py:85 cocoa/en.lproj/Localizable.strings:0
msgid "dupeGuru Help"
msgstr "dupeGuru 帮助"
msgstr ""
#: qt/app.py:86 cocoa/en.lproj/Localizable.strings:0
msgid "About dupeGuru"
msgstr "关于 dupeGuru"
msgstr ""
#: qt/app.py:87
msgid "Open Debug Log"
msgstr "打开调试记录"
msgstr ""
#: qt/app.py:180 cocoa/en.lproj/Localizable.strings:0
msgid "Do you really want to remove all your cached picture analysis?"
msgstr "确定要移除所有缓存分析图片?"
msgstr ""
#: qt/app.py:184
msgid "Picture cache cleared."
msgstr "图片缓存已清空。"
msgstr ""
#: qt/app.py:251
msgid "{} file (*.{})"
msgstr "{} 文件 (*.{})"
msgstr ""
#: qt/deletion_options.py:30 cocoa/en.lproj/Localizable.strings:0
msgid "Deletion Options"
msgstr "删除选项"
msgstr ""
#: qt/deletion_options.py:35 cocoa/en.lproj/Localizable.strings:0
msgid "Link deleted files"
msgstr "链接已删除的文件"
msgstr ""
#: qt/deletion_options.py:37 cocoa/en.lproj/Localizable.strings:0
msgid ""
@ -94,20 +91,20 @@ msgstr ""
#: qt/deletion_options.py:60 cocoa/en.lproj/Localizable.strings:0
msgid "Cancel"
msgstr "取消"
msgstr ""
#: qt/details_table.py:16 cocoa/en.lproj/Localizable.strings:0
msgid "Attribute"
msgstr "属性"
msgstr ""
#: qt/details_table.py:16 cocoa/en.lproj/Localizable.strings:0
msgid "Selected"
msgstr "已选择"
msgstr ""
#: qt/details_table.py:16 qt/directories_model.py:24
#: cocoa/en.lproj/Localizable.strings:0
msgid "Reference"
msgstr "源文件"
msgstr ""
#: qt/directories_dialog.py:64 cocoa/en.lproj/Localizable.strings:0
msgid "Load Results..."
@ -911,43 +908,3 @@ msgstr ""
#: qt\preferences_dialog.py:286
msgid "Display"
msgstr ""
#: qt\se\preferences_dialog.py:70
msgid "Partially hash files bigger than"
msgstr ""
#: qt\se\preferences_dialog.py:80
msgid "MB"
msgstr ""
#: qt\preferences_dialog.py:163
msgid "Use native OS dialogs"
msgstr ""
#: qt\preferences_dialog.py:166
msgid ""
"For actions such as file/folder selection use the OS native dialogs.\n"
"Some native dialogs have limited functionality."
msgstr ""
#: qt\se\preferences_dialog.py:68
msgid "Ignore files larger than"
msgstr ""
#: qt\app.py:135 qt\app.py:293
msgid "Clear Cache"
msgstr ""
#: qt\app.py:294
msgid ""
"Do you really want to clear the cache? This will remove all cached file "
"hashes and picture analysis."
msgstr ""
#: qt\app.py:299
msgid "Cache cleared."
msgstr ""
#: qt\preferences_dialog.py:173
msgid "Use dark style"
msgstr ""

View File

@ -3,7 +3,3 @@ requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[tool.black]
line-length = 120
[tool.isort]
# make it compatible with black
profile = "black"
skip_gitignore = true

View File

@ -1041,26 +1041,44 @@ class ScrollAreaImageViewer(QScrollArea):
"""After scaling, no mouse position, default to center."""
# scrollBar.setMaximum(scrollBar.maximum() - scrollBar.minimum() + scrollBar.pageStep())
self._horizontalScrollBar.setValue(
int(factor * self._horizontalScrollBar.value() + ((factor - 1) * self._horizontalScrollBar.pageStep() / 2))
int(
factor * self._horizontalScrollBar.value()
+ ((factor - 1) * self._horizontalScrollBar.pageStep() / 2)
)
)
self._verticalScrollBar.setValue(
int(factor * self._verticalScrollBar.value() + ((factor - 1) * self._verticalScrollBar.pageStep() / 2))
int(
factor * self._verticalScrollBar.value()
+ ((factor - 1) * self._verticalScrollBar.pageStep() / 2)
)
)
def adjustScrollBarsScaled(self, delta):
"""After scaling with the mouse, update relative to mouse position."""
self._horizontalScrollBar.setValue(int(self._horizontalScrollBar.value() + delta.x()))
self._verticalScrollBar.setValue(int(self._verticalScrollBar.value() + delta.y()))
self._horizontalScrollBar.setValue(
int(self._horizontalScrollBar.value() + delta.x())
)
self._verticalScrollBar.setValue(
int(self._verticalScrollBar.value() + delta.y())
)
def adjustScrollBarsAuto(self):
"""After panning, update accordingly."""
self.horizontalScrollBar().setValue(int(self.horizontalScrollBar().value() - self._mousePanningDelta.x()))
self.verticalScrollBar().setValue(int(self.verticalScrollBar().value() - self._mousePanningDelta.y()))
self.horizontalScrollBar().setValue(
int(self.horizontalScrollBar().value() - self._mousePanningDelta.x())
)
self.verticalScrollBar().setValue(
int(self.verticalScrollBar().value() - self._mousePanningDelta.y())
)
def adjustScrollBarCentered(self):
"""Just center in the middle."""
self._horizontalScrollBar.setValue(int(self._horizontalScrollBar.maximum() / 2))
self._verticalScrollBar.setValue(int(self._verticalScrollBar.maximum() / 2))
self._horizontalScrollBar.setValue(
int(self._horizontalScrollBar.maximum() / 2)
)
self._verticalScrollBar.setValue(
int(self._verticalScrollBar.maximum() / 2)
)
def resetCenter(self):
"""Resets origin"""

View File

@ -14,11 +14,11 @@ if op.exists(__file__):
else:
# Should be a frozen environment
if ISOSX:
BASE_PATH = op.abspath(op.join(op.dirname(__file__), "..", "..", "Resources"))
BASE_PATH = op.abspath(op.join(op.dirname(__file__), '..', '..', 'Resources'))
else:
# For others our base path is ''.
BASE_PATH = ""
HELP_PATH = op.join(BASE_PATH, "help", "en")
HELP_PATH = op.join(BASE_PATH, "help")
if ISWINDOWS:
INITIAL_FOLDER_IN_DIALOGS = "C:\\"

View File

@ -221,7 +221,7 @@ class TabWindow(QMainWindow):
super().showEvent(event)
def changeEvent(self, event):
if event.type() == QEvent.WindowStateChange and not self.isMaximized():
if event.type() == QEvent.Type.WindowStateChange and not self.isMaximized():
move_to_screen_center(self)
super().changeEvent(event)

View File

@ -1,10 +1,11 @@
# Translators:
# Ahmet Haydar Işık <itsahmthydr@gmail.com>, 2021
# Emin Tufan Çetin <etcetin@gmail.com>, 2022
# Emin Tufan Çetin <etcetin@gmail.com>, 2021
# Andrew Senetar <arsenetar@gmail.com>, 2022
#
msgid ""
msgstr ""
"Last-Translator: Emin Tufan Çetin <etcetin@gmail.com>, 2022\n"
"Last-Translator: Andrew Senetar <arsenetar@gmail.com>, 2022\n"
"Language-Team: Turkish (https://www.transifex.com/voltaicideas/teams/116153/tr/)\n"
"Language: tr\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -99,7 +100,7 @@ msgstr "Korece"
#: qtlib\preferences.py:34
msgid "Malay"
msgstr "Malayca"
msgstr "Malay dili"
#: qtlib\preferences.py:35
msgid "Dutch"

View File

@ -30,13 +30,13 @@ packages = find:
python_requires = >=3.7
install_requires =
Send2Trash>=1.3.0
polib>=1.1.0
mutagen>=1.45.1
distro>=1.5.0
PyQt5 >=5.14.1,<6.0; sys_platform != 'linux'
pywin32>=228; sys_platform == 'win32'
setup_requires =
sphinx>=3.0.0
polib>=1.1.0
tests_require =
pytest >=6,<7
include_package_data = true

View File

@ -12,8 +12,6 @@ Unicode true
SetCompressor /SOLID lzma
; General Headers
!include "FileFunc.nsh"
!include "WinVer.nsh"
!include "LogicLib.nsh"
;==============================================================================
; Configuration Defines
@ -281,10 +279,6 @@ SectionEnd
;==============================================================================
Function .onInit
${IfNot} ${AtLeastWin7}
MessageBox MB_OK "Windows 7 and above required"
Quit
${EndIf}
!if ${BITS} == "64"
SetRegView 64
!else