pyautoclick 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyautoclick-0.3.0/.github/workflows/ci.yml +63 -0
- pyautoclick-0.3.0/.github/workflows/publish.yml +56 -0
- pyautoclick-0.3.0/.gitignore +54 -0
- pyautoclick-0.3.0/CHANGELOG.md +59 -0
- pyautoclick-0.3.0/LICENSE +674 -0
- pyautoclick-0.3.0/PKG-INFO +928 -0
- pyautoclick-0.3.0/README.md +222 -0
- pyautoclick-0.3.0/py-autoclick.png +0 -0
- pyautoclick-0.3.0/py-autoclick.pyw +17 -0
- pyautoclick-0.3.0/pyautoclick/__init__.py +3 -0
- pyautoclick-0.3.0/pyautoclick/__main__.py +95 -0
- pyautoclick-0.3.0/pyautoclick/assets/__init__.py +0 -0
- pyautoclick-0.3.0/pyautoclick/assets/py-autoclick.png +0 -0
- pyautoclick-0.3.0/pyautoclick/core/__init__.py +0 -0
- pyautoclick-0.3.0/pyautoclick/core/buttons.py +25 -0
- pyautoclick-0.3.0/pyautoclick/core/clicker.py +305 -0
- pyautoclick-0.3.0/pyautoclick/core/hotkeys.py +106 -0
- pyautoclick-0.3.0/pyautoclick/core/platform_capabilities.py +96 -0
- pyautoclick-0.3.0/pyautoclick/core/single_instance.py +169 -0
- pyautoclick-0.3.0/pyautoclick/i18n/__init__.py +18 -0
- pyautoclick-0.3.0/pyautoclick/i18n/core.py +218 -0
- pyautoclick-0.3.0/pyautoclick/i18n/direction.py +49 -0
- pyautoclick-0.3.0/pyautoclick/i18n/locales/__init__.py +0 -0
- pyautoclick-0.3.0/pyautoclick/i18n/locales/ar.json +101 -0
- pyautoclick-0.3.0/pyautoclick/i18n/locales/de.json +99 -0
- pyautoclick-0.3.0/pyautoclick/i18n/locales/en.json +98 -0
- pyautoclick-0.3.0/pyautoclick/i18n/locales/es.json +99 -0
- pyautoclick-0.3.0/pyautoclick/i18n/locales/fr.json +98 -0
- pyautoclick-0.3.0/pyautoclick/i18n/locales/he.json +101 -0
- pyautoclick-0.3.0/pyautoclick/i18n/locales/it.json +99 -0
- pyautoclick-0.3.0/pyautoclick/i18n/locales/ja.json +100 -0
- pyautoclick-0.3.0/pyautoclick/i18n/locales/pt.json +99 -0
- pyautoclick-0.3.0/pyautoclick/i18n/locales/ru.json +100 -0
- pyautoclick-0.3.0/pyautoclick/i18n/locales/zh.json +100 -0
- pyautoclick-0.3.0/pyautoclick/logging_config.py +84 -0
- pyautoclick-0.3.0/pyautoclick/paths.py +54 -0
- pyautoclick-0.3.0/pyautoclick/persistence/__init__.py +0 -0
- pyautoclick-0.3.0/pyautoclick/persistence/migrations.py +41 -0
- pyautoclick-0.3.0/pyautoclick/persistence/settings.py +251 -0
- pyautoclick-0.3.0/pyautoclick/services/__init__.py +0 -0
- pyautoclick-0.3.0/pyautoclick/services/notifications.py +96 -0
- pyautoclick-0.3.0/pyautoclick/ui/__init__.py +0 -0
- pyautoclick-0.3.0/pyautoclick/ui/app.py +314 -0
- pyautoclick-0.3.0/pyautoclick/ui/colors.py +26 -0
- pyautoclick-0.3.0/pyautoclick/ui/constants.py +72 -0
- pyautoclick-0.3.0/pyautoclick/ui/context.py +104 -0
- pyautoclick-0.3.0/pyautoclick/ui/status_bar.py +73 -0
- pyautoclick-0.3.0/pyautoclick/ui/tabs/__init__.py +11 -0
- pyautoclick-0.3.0/pyautoclick/ui/tabs/auto.py +161 -0
- pyautoclick-0.3.0/pyautoclick/ui/tabs/base.py +98 -0
- pyautoclick-0.3.0/pyautoclick/ui/tabs/hold.py +144 -0
- pyautoclick-0.3.0/pyautoclick/ui/tabs/hotkeys.py +125 -0
- pyautoclick-0.3.0/pyautoclick/ui/tabs/positions.py +88 -0
- pyautoclick-0.3.0/pyautoclick/ui/tabs/test.py +62 -0
- pyautoclick-0.3.0/pyautoclick/ui/theme.py +62 -0
- pyautoclick-0.3.0/pyautoclick/ui/widgets/__init__.py +0 -0
- pyautoclick-0.3.0/pyautoclick/ui/widgets/capture_dialog.py +86 -0
- pyautoclick-0.3.0/pyautoclick/ui/widgets/hotkey_entry.py +43 -0
- pyautoclick-0.3.0/pyautoclick/ui/widgets/tooltip.py +58 -0
- pyautoclick-0.3.0/pyproject.toml +148 -0
- pyautoclick-0.3.0/tests/__init__.py +0 -0
- pyautoclick-0.3.0/tests/conftest.py +57 -0
- pyautoclick-0.3.0/tests/core/__init__.py +0 -0
- pyautoclick-0.3.0/tests/core/clicker/__init__.py +0 -0
- pyautoclick-0.3.0/tests/core/hotkeys/__init__.py +0 -0
- pyautoclick-0.3.0/tests/core/single_instance/__init__.py +0 -0
- pyautoclick-0.3.0/tests/core/single_instance/test_lock.py +104 -0
- pyautoclick-0.3.0/tests/i18n/__init__.py +0 -0
- pyautoclick-0.3.0/tests/integration/__init__.py +0 -0
- pyautoclick-0.3.0/tests/persistence/__init__.py +0 -0
- pyautoclick-0.3.0/tests/services/__init__.py +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
name: Test on ${{ matrix.os }} / Python ${{ matrix.python-version }}
|
|
12
|
+
runs-on: ${{ matrix.os }}
|
|
13
|
+
strategy:
|
|
14
|
+
fail-fast: false
|
|
15
|
+
matrix:
|
|
16
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
17
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- name: Set up Python
|
|
23
|
+
uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: ${{ matrix.python-version }}
|
|
26
|
+
cache: pip
|
|
27
|
+
|
|
28
|
+
- name: Install package + dev deps
|
|
29
|
+
run: |
|
|
30
|
+
python -m pip install --upgrade pip
|
|
31
|
+
python -m pip install -e ".[dev]"
|
|
32
|
+
|
|
33
|
+
- name: Run pytest (skip linux_only on non-Linux)
|
|
34
|
+
if: runner.os != 'Linux'
|
|
35
|
+
run: pytest -v -m "not linux_only"
|
|
36
|
+
|
|
37
|
+
- name: Run pytest (full)
|
|
38
|
+
if: runner.os == 'Linux'
|
|
39
|
+
run: pytest -v
|
|
40
|
+
|
|
41
|
+
lint:
|
|
42
|
+
name: Lint (ruff + mypy)
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
steps:
|
|
45
|
+
- uses: actions/checkout@v4
|
|
46
|
+
- uses: actions/setup-python@v5
|
|
47
|
+
with:
|
|
48
|
+
python-version: "3.12"
|
|
49
|
+
cache: pip
|
|
50
|
+
|
|
51
|
+
- name: Install dev deps
|
|
52
|
+
run: |
|
|
53
|
+
python -m pip install --upgrade pip
|
|
54
|
+
python -m pip install -e ".[dev]"
|
|
55
|
+
|
|
56
|
+
- name: Ruff (format + lint)
|
|
57
|
+
run: |
|
|
58
|
+
ruff check pyautoclick tests
|
|
59
|
+
ruff format --check pyautoclick tests
|
|
60
|
+
|
|
61
|
+
- name: Mypy
|
|
62
|
+
run: mypy pyautoclick
|
|
63
|
+
continue-on-error: true # mypy strict on a fresh codebase will surface issues; soft fail until cleaned
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
# Triggers a publish whenever a tag matching v*.*.* is pushed
|
|
4
|
+
# (e.g. ``git tag v0.3.0 && git push --tags``).
|
|
5
|
+
#
|
|
6
|
+
# Setup once on the GitHub repo:
|
|
7
|
+
# 1. Create a PyPI account at https://pypi.org
|
|
8
|
+
# 2. Go to https://pypi.org/manage/account/publishing/ and add a
|
|
9
|
+
# *Trusted Publisher* for this repo:
|
|
10
|
+
# PyPI project name : pyautoclick
|
|
11
|
+
# Owner : <your-github-username>
|
|
12
|
+
# Repository : py-autoclick
|
|
13
|
+
# Workflow filename : publish.yml
|
|
14
|
+
# Environment : pypi
|
|
15
|
+
# 3. In the GitHub repo: Settings -> Environments -> New environment named
|
|
16
|
+
# "pypi" (no secrets needed thanks to OIDC trusted publishing).
|
|
17
|
+
|
|
18
|
+
on:
|
|
19
|
+
push:
|
|
20
|
+
tags:
|
|
21
|
+
- "v*.*.*"
|
|
22
|
+
|
|
23
|
+
jobs:
|
|
24
|
+
build-and-publish:
|
|
25
|
+
name: Build and publish to PyPI
|
|
26
|
+
runs-on: ubuntu-latest
|
|
27
|
+
environment:
|
|
28
|
+
name: pypi
|
|
29
|
+
url: https://pypi.org/p/pyautoclick
|
|
30
|
+
permissions:
|
|
31
|
+
id-token: write # Required for PyPI OIDC trusted publishing
|
|
32
|
+
|
|
33
|
+
steps:
|
|
34
|
+
- name: Check out source
|
|
35
|
+
uses: actions/checkout@v4
|
|
36
|
+
|
|
37
|
+
- name: Set up Python
|
|
38
|
+
uses: actions/setup-python@v5
|
|
39
|
+
with:
|
|
40
|
+
python-version: "3.12"
|
|
41
|
+
|
|
42
|
+
- name: Install build tooling
|
|
43
|
+
run: |
|
|
44
|
+
python -m pip install --upgrade pip
|
|
45
|
+
python -m pip install build
|
|
46
|
+
|
|
47
|
+
- name: Build wheel + sdist
|
|
48
|
+
run: python -m build
|
|
49
|
+
|
|
50
|
+
- name: Verify wheel contents
|
|
51
|
+
run: |
|
|
52
|
+
python -m zipfile -l dist/*.whl | grep -E "i18n/locales/.*\.json"
|
|
53
|
+
python -m zipfile -l dist/*.whl | grep "assets/py-autoclick.png"
|
|
54
|
+
|
|
55
|
+
- name: Publish to PyPI
|
|
56
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# Distribution / packaging
|
|
7
|
+
.Python
|
|
8
|
+
build/
|
|
9
|
+
dist/
|
|
10
|
+
*.egg-info/
|
|
11
|
+
*.egg
|
|
12
|
+
MANIFEST
|
|
13
|
+
|
|
14
|
+
# Virtual environments
|
|
15
|
+
.venv/
|
|
16
|
+
venv/
|
|
17
|
+
env/
|
|
18
|
+
ENV/
|
|
19
|
+
|
|
20
|
+
# Test / coverage artifacts
|
|
21
|
+
.pytest_cache/
|
|
22
|
+
.coverage
|
|
23
|
+
.coverage.*
|
|
24
|
+
htmlcov/
|
|
25
|
+
.tox/
|
|
26
|
+
.nox/
|
|
27
|
+
coverage.xml
|
|
28
|
+
*.cover
|
|
29
|
+
.hypothesis/
|
|
30
|
+
|
|
31
|
+
# Type checkers / linters caches
|
|
32
|
+
.mypy_cache/
|
|
33
|
+
.dmypy.json
|
|
34
|
+
dmypy.json
|
|
35
|
+
.ruff_cache/
|
|
36
|
+
.pytype/
|
|
37
|
+
|
|
38
|
+
# IDEs / editors
|
|
39
|
+
.vscode/
|
|
40
|
+
.idea/
|
|
41
|
+
*.swp
|
|
42
|
+
*.swo
|
|
43
|
+
*~
|
|
44
|
+
.DS_Store
|
|
45
|
+
|
|
46
|
+
# OS
|
|
47
|
+
Thumbs.db
|
|
48
|
+
|
|
49
|
+
# Project-specific runtime artifacts (live under ~/.config/, but just in case)
|
|
50
|
+
*.log
|
|
51
|
+
config.json
|
|
52
|
+
app.lock
|
|
53
|
+
app.sock
|
|
54
|
+
app.port
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.3.0] — 2026-05-03
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- **Internationalization** with 10 languages: English, French, Spanish, Portuguese, German, Italian, Russian, Chinese, Japanese, Arabic. JSON locale files, ICU-style plurals (`{n, plural, one {…} other {…}}`), locale-aware number formatting.
|
|
14
|
+
- **Right-to-left (RTL) layout support**: Arabic UI mirrors automatically (label/control columns swap, status bar mirrors). Detection via `_meta.direction` in locale JSON.
|
|
15
|
+
- **Theme switcher** in the status bar (☀ / ☾ glyph), persisted to config.
|
|
16
|
+
- **Cross-platform foundation**: `single_instance` abstracts POSIX (`fcntl` + `AF_UNIX`) vs Windows (`msvcrt` + TCP loopback). Notifications dispatch to `notify-send` / `osascript` / PowerShell BurntToast.
|
|
17
|
+
- **Wayland detection** via `core/platform_capabilities.py`: amber warning banner in the *Shortcuts* tab when global hotkeys are unavailable.
|
|
18
|
+
- **Atomic config save** via `tempfile.mkstemp` + `os.fsync` + `os.replace` — crash mid-write cannot corrupt JSON.
|
|
19
|
+
- **Settings validation** with field-level validators; invalid values fall back to defaults (logged as warnings) instead of crashing.
|
|
20
|
+
- **Schema versioning** (`config_version`) with extensible migration registry.
|
|
21
|
+
- **Structured logging** to stderr + rotating file (`~/.config/autoclicker/pyautoclick.log`, 1 MiB × 3). Level via `PYAUTOCLICK_LOG_LEVEL` env var.
|
|
22
|
+
- **Signal handling**: SIGINT and SIGTERM trigger a graceful shutdown via the existing window-close path.
|
|
23
|
+
- **`AppContext` split** into 3 typed sub-contexts (`StateContext`, `ServicesContext`, `LifecycleContext`).
|
|
24
|
+
- **`BaseTab(ABC)`** for tab subclasses with `@abstractmethod build()`.
|
|
25
|
+
- **Tests**: 6 single-instance tests including a cross-process verification.
|
|
26
|
+
- **Tooling config** in `pyproject.toml`: ruff (9 rule sets), mypy strict, pytest + coverage.
|
|
27
|
+
- **Hot-reload of UI** on language change (preserves clicker, hotkey listener, settings).
|
|
28
|
+
- **Single instance focus**: launching a second instance brings the existing window to the foreground via Unix socket IPC instead of failing.
|
|
29
|
+
- **Sun Valley theme** (`sv-ttk`) integration.
|
|
30
|
+
- **Position cycling** for auto mode: record (x, y) screen positions, cycle through them.
|
|
31
|
+
- **Click jitter** (± ms) on both modes for human-like irregularity.
|
|
32
|
+
- **Click count limit** for auto mode.
|
|
33
|
+
- **Hotkey momentary mode**: auto mode runs while a combination is held.
|
|
34
|
+
- **Emergency stop hotkey**.
|
|
35
|
+
- **Mouse-event test panel** for identifying side buttons.
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
- **Refactored from a single 1300-line `.pyw` file into a layered package** (`pyautoclick/`) with 7 sub-modules (`core`, `persistence`, `i18n`, `services`, `ui`, plus `paths` and `logging_config`).
|
|
39
|
+
- **Settings storage** moved from raw dict to dataclass with `Literal` types.
|
|
40
|
+
- **`TRIGGERS` / `ACTIONS`** dicts split into language-agnostic stable keys (`"button8"`, `"left"`) + i18n-driven labels. Legacy French labels in old configs are migrated transparently.
|
|
41
|
+
- **Strict typing** throughout, `from __future__ import annotations` standardized in every module.
|
|
42
|
+
- **License**: GPLv3 (was unlicensed).
|
|
43
|
+
- **Constants and colors** centralized in `pyautoclick/ui/constants.py` and `pyautoclick/ui/colors.py`.
|
|
44
|
+
- **Icon redesigned** for visual modernization (gradient + ripple animation feel + cursor at click center).
|
|
45
|
+
|
|
46
|
+
### Fixed
|
|
47
|
+
- **`mouse.Listener` cleanup** at shutdown (previously orphaned the listener thread).
|
|
48
|
+
- **Race conditions** in `AutoClicker`: explicit `RLock` on all setters, snapshots in loops.
|
|
49
|
+
|
|
50
|
+
### Security
|
|
51
|
+
- Replaced broad `except Exception:` with specific exception types except for documented user-callback wrappers (which log via `logger.exception`).
|
|
52
|
+
|
|
53
|
+
## [0.2.0] — 2026-05-02
|
|
54
|
+
|
|
55
|
+
Initial layered architecture extracted from the monolithic `.pyw` script.
|
|
56
|
+
|
|
57
|
+
## [0.1.0] — initial
|
|
58
|
+
|
|
59
|
+
Single-file `py-autoclick.pyw` with hold-mode + auto-mode + 3 hotkeys + positions + i18n FR/EN.
|