Compare commits
59 Commits
cursor/cro
...
cursor/yea
| Author | SHA1 | Date | |
|---|---|---|---|
| c2b10ac856 | |||
| d3960cdbf7 | |||
|
|
a9c31148e0 | ||
| e4cdb540e9 | |||
| fb9295ce65 | |||
| 1d18dbd7c4 | |||
|
|
b013181d35 | ||
|
|
94791dcd67 | ||
| 1cad94b8d5 | |||
| f1d9693966 | |||
| 7c50480324 | |||
| f04ca3fe72 | |||
| 31dd69c2aa | |||
| 95e0acbe71 | |||
| a39cccb0dc | |||
| 5d827ae70d | |||
|
|
8ee6cebea3 | ||
| a07d3b46dc | |||
|
|
78d1a0a5fc | ||
| 89bb9689e9 | |||
|
|
86d0006291 | ||
| 8443149979 | |||
|
|
3a0e02d9e0 | ||
|
|
19b81201b8 | ||
| f1b99e5da9 | |||
|
|
7cc3a350cd | ||
| 34a68b4e22 | |||
| 61f1a737a4 | |||
| f0a004b637 | |||
| 7e305f18be | |||
| 6b2d13272f | |||
| 8f5d0d24c9 | |||
| 911e6f3612 | |||
| 0fc5eecfb4 | |||
| b389a13add | |||
| 5fb66a2794 | |||
| 9e317e41df | |||
| d5f1a563e2 | |||
| a9f1e90fc1 | |||
|
|
0bca5e551e | ||
| 7f60185536 | |||
|
|
3463fb74df | ||
| c38d9a93be | |||
|
|
0e0a2c5e62 | ||
|
|
b9ea8b2d36 | ||
| cf08d35767 | |||
|
|
ba1231c73d | ||
|
|
63bd3b0f0e | ||
|
|
a70793f61a | ||
|
|
d1e817f4ac | ||
|
|
dc097a2da4 | ||
|
|
aab7afee37 | ||
|
|
d07c4b6ca2 | ||
|
|
d46fe5b6a4 | ||
|
|
5c6451c32a | ||
|
|
71c269b9f0 | ||
|
|
ff9d35f488 | ||
|
|
afec00b50f | ||
|
|
1be0c3ca0f |
75
.github/workflows/bump-version.yml
vendored
Normal file
75
.github/workflows/bump-version.yml
vendored
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
# Manually bump package version and open a PR to main.
|
||||||
|
# Actions → Bump version → Run workflow → choose patch / minor / major.
|
||||||
|
name: Bump version
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
part:
|
||||||
|
description: Version part to bump
|
||||||
|
required: true
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- patch
|
||||||
|
- minor
|
||||||
|
- major
|
||||||
|
default: patch
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: bump-version
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
bump:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout main
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: main
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Install uv
|
||||||
|
uses: astral-sh/setup-uv@v5
|
||||||
|
|
||||||
|
- name: Bump version
|
||||||
|
id: bump
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
OLD=$(uvx --from bump-my-version bump-my-version show current_version)
|
||||||
|
uvx --from bump-my-version bump-my-version bump "${{ inputs.part }}" --no-commit --no-tag
|
||||||
|
NEW=$(uvx --from bump-my-version bump-my-version show current_version)
|
||||||
|
echo "old=${OLD}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "new=${NEW}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "Bumped ${OLD} → ${NEW} (${{ inputs.part }})"
|
||||||
|
|
||||||
|
- name: Create pull request
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
OLD="${{ steps.bump.outputs.old }}"
|
||||||
|
NEW="${{ steps.bump.outputs.new }}"
|
||||||
|
BRANCH="chore/bump-version-${NEW}"
|
||||||
|
|
||||||
|
git config user.name "github-actions[bot]"
|
||||||
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||||
|
|
||||||
|
git checkout -b "$BRANCH"
|
||||||
|
git add pyproject.toml
|
||||||
|
git commit -m "Bump version: ${OLD} → ${NEW}"
|
||||||
|
git push -u origin "$BRANCH"
|
||||||
|
|
||||||
|
gh pr create \
|
||||||
|
--base main \
|
||||||
|
--head "$BRANCH" \
|
||||||
|
--title "Bump version to ${NEW}" \
|
||||||
|
--body "## Summary
|
||||||
|
|
||||||
|
Automated \`${{ inputs.part }}\` bump: \`${OLD}\` → \`${NEW}\`.
|
||||||
|
|
||||||
|
Source: \`[project].version\` in \`pyproject.toml\` (via bump-my-version)."
|
||||||
42
.github/workflows/mirror-to-gitea.yml
vendored
Normal file
42
.github/workflows/mirror-to-gitea.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
# Mirror all branches and tags from GitHub → Gitea after every ref change.
|
||||||
|
# Requires repo secret GITEA_TOKEN (Gitea PAT with write:repository on rhino/xlsx-clean).
|
||||||
|
name: Mirror to Gitea
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
delete:
|
||||||
|
create:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: mirror-to-gitea
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
mirror:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
steps:
|
||||||
|
- name: Mirror repository to Gitea
|
||||||
|
env:
|
||||||
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
if [ -z "${GITEA_TOKEN:-}" ]; then
|
||||||
|
echo "Missing secret GITEA_TOKEN (Gitea PAT with write:repository)." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
git clone --mirror \
|
||||||
|
"https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" \
|
||||||
|
mirror.git
|
||||||
|
cd mirror.git
|
||||||
|
|
||||||
|
# Push only branches/tags. Never push GitHub refs/pull/* — Gitea
|
||||||
|
# rejects those with "hook declined" and fails the whole mirror.
|
||||||
|
git push --prune \
|
||||||
|
"https://rhino:${GITEA_TOKEN}@git.faryad.top/rhino/xlsx-clean.git" \
|
||||||
|
"+refs/heads/*:refs/heads/*" \
|
||||||
|
"+refs/tags/*:refs/tags/*"
|
||||||
@@ -1 +1 @@
|
|||||||
3.12.2
|
3.12
|
||||||
|
|||||||
62
AGENTS.md
62
AGENTS.md
@@ -1,45 +1,65 @@
|
|||||||
# xlsx-clean
|
# xlsx-clean
|
||||||
|
|
||||||
`xlsx-clean` is a Python CLI (`src/xlsx_clean/clean_cells.py`) that generates a new
|
`xlsx-clean` generates a new Excel QC datasheet from the most recent workbook in a
|
||||||
Excel QC datasheet from the most recent workbook in a configured directory,
|
configured directory, clearing/resetting specific cells. Interfaces:
|
||||||
clearing/resetting specific cells.
|
|
||||||
|
- CLI: `src/xlsx_clean/clean_cells.py` (`beaupy`)
|
||||||
|
- GUI: `src/xlsx_clean/gui_app.py` (PyWebView cross-platform desktop window with a local HTML/CSS/JS frontend)
|
||||||
|
|
||||||
## Backends
|
## Backends
|
||||||
|
|
||||||
- **`com` (Windows default):** Microsoft Excel COM via `pywin32`. Loads add-ins listed
|
- **`com` (Windows default):** Microsoft Excel COM via `pywin32`. Loads add-ins listed
|
||||||
in `strings.txt`, edits cells, `SaveAs`, leaves Excel visible/maximized.
|
in `strings.txt`, edits cells, `SaveAs`, leaves Excel visible/maximized and brought
|
||||||
|
to the front.
|
||||||
- **`ooxml` (Linux/macOS default):** Surgical edit of the `.xlsx` zip (worksheet XML
|
- **`ooxml` (Linux/macOS default):** Surgical edit of the `.xlsx` zip (worksheet XML
|
||||||
only). Preserves non-worksheet parts (styles, connections/Power Query definitions,
|
only). Preserves non-worksheet parts (styles, connections/Power Query definitions,
|
||||||
drawings, etc.). Does not calculate formulas or refresh queries.
|
drawings, etc.). Does not calculate formulas or refresh queries.
|
||||||
|
|
||||||
Select with `--backend com|ooxml`.
|
Select with `--backend com|ooxml` (CLI) or `config.toml`.
|
||||||
|
|
||||||
## Cursor Cloud specific instructions
|
## Cursor Cloud Specific Instructions
|
||||||
|
|
||||||
### Platform notes
|
### Platform Notes
|
||||||
- `pywin32` has no Linux wheels and is declared as Windows-only
|
- `pywin32` has no Linux wheels and is declared as Windows-only
|
||||||
(`pywin32>=306; sys_platform == 'win32'`). It is intentionally **not** installed here.
|
(`pywin32>=312; sys_platform == 'win32'`). It is intentionally **not** installed here.
|
||||||
- End-to-end COM automation needs Windows + desktop Excel and does not run on this VM.
|
- End-to-end COM automation needs Windows + desktop Excel and does not run on this VM.
|
||||||
- On Linux, the **ooxml** backend can clear/set cells and write a new workbook when
|
- On Linux, the **ooxml** backend can clear/set cells and write a new workbook when
|
||||||
sample files and `XLSX_CLEAN_ROOT` point at a real tree. Without those data files,
|
sample files and `XLSX_CLEAN_ROOT` point at a real tree. Without those data files,
|
||||||
interactive selection still works for config loading, but globbing finds no templates.
|
interactive selection still works for config loading, but globbing finds no templates.
|
||||||
|
- PyWebView supports Windows (Edge WebView2), Linux (WebKitGTK), and macOS (WKWebView).
|
||||||
|
Windows needs the separately-installed Microsoft Edge WebView2 Runtime; `pythonnet`
|
||||||
|
does not install it. Linux needs `python3-gi`, GTK, and WebKitGTK typelibs; use the
|
||||||
|
system Python with `--system-site-packages` so apt-provided `gi` remains importable.
|
||||||
|
- On headless machines without a display server the GUI cannot open a native window.
|
||||||
|
|
||||||
### Environment
|
### Environment
|
||||||
- Dependencies are installed into a `uv`-managed virtualenv at `.venv` by the startup
|
- Prefer **uv** for all installs (`uv` in `~/.local/bin`, on PATH via `~/.bashrc`).
|
||||||
update script (`uv` itself is installed via `pip install --break-system-packages uv`
|
- Rye is **not** used (`requirements.lock` removed). Use `uv.lock` + `uv sync`.
|
||||||
and lives in `~/.local/bin`, which is on PATH for interactive shells via `~/.bashrc`).
|
|
||||||
- The install uses pinned versions from `requirements.lock`, excluding the `-e file:.`
|
```bash
|
||||||
editable line and `pywin32`; the package is then installed editable with `--no-deps`.
|
# Linux desktop (system WebKitGTK deps + venv + Desktop shortcut):
|
||||||
|
./desktop/setup_linux.sh
|
||||||
|
|
||||||
|
# Dependencies and test tooling (any OS):
|
||||||
|
uv sync
|
||||||
|
```
|
||||||
|
|
||||||
- Run Python via the venv interpreter: `.venv/bin/python`.
|
- Run Python via the venv interpreter: `.venv/bin/python`.
|
||||||
- Optional: `XLSX_CLEAN_ROOT` remaps `D:\OpenCloud\...` paths from `file_data.csv`.
|
- Optional: `XLSX_CLEAN_ROOT` remaps `D:\OpenCloud\...` paths from `file_data.csv`.
|
||||||
|
- Note: the `uv`-created `.venv` does not include `pip`; use `uv pip ...` / `uv sync`
|
||||||
|
for package operations.
|
||||||
|
|
||||||
### Lint / test / build
|
### Lint / Test / Build
|
||||||
- There is **no lint config, no test suite, and no build step** in this repo (no ruff/flake8,
|
- Tests use `pytest`; run `uv run pytest -q`.
|
||||||
no pytest, no CI). Don't invent one unless asked.
|
- `pyproject.toml` uses `hatchling` as the build backend; build a wheel with `uv build`.
|
||||||
- `pyproject.toml` uses `hatchling` as the build backend; there is nothing to "build" for dev.
|
|
||||||
|
|
||||||
### Running / verifying
|
### Running / Verifying
|
||||||
- Interactive tool: `.venv/bin/python -m xlsx_clean.clean_cells` (defaults to `ooxml` on Linux).
|
- CLI: `.venv/bin/python -m xlsx_clean.clean_cells` (defaults to `ooxml` on Linux).
|
||||||
|
- GUI: `.venv/bin/python -m xlsx_clean.gui_app [--width 800 --height 600]`.
|
||||||
|
- Linux setup: `./desktop/setup_linux.sh` (GTK/WebKitGTK check, uv sync).
|
||||||
|
- Windows shop-floor: double-click `desktop/Setup.bat` (uv sync), or build
|
||||||
|
an exe with `desktop/build_windows_exe.bat` **on a Windows PC** (cannot build Windows
|
||||||
|
exe here).
|
||||||
|
- Operators create their own shortcut to the GUI launcher (no installer script).
|
||||||
- Sanity-check imports:
|
- Sanity-check imports:
|
||||||
`.venv/bin/python -c "import pandas, beaupy; from xlsx_clean import hello; from xlsx_clean.ooxml_backend import expand_a1_range; print(hello(), expand_a1_range('A1:B2'))"`.
|
`.venv/bin/python -c "import webview, beaupy; from xlsx_clean import hello; from xlsx_clean.core import load_config, list_sets; from xlsx_clean.ooxml_backend import expand_a1_range; print(webview, hello(), expand_a1_range('A1:B2'))"`.
|
||||||
- Note: the `uv`-created `.venv` does not include `pip`; use `uv pip ...` for package operations.
|
|
||||||
|
|||||||
160
README.md
160
README.md
@@ -1,36 +1,152 @@
|
|||||||
# xlsx-clean
|
# xlsx-clean
|
||||||
|
|
||||||
Create a new QC datasheet from the latest matching workbook: clear configured
|
Operator-facing name: **New QC Sheet**.
|
||||||
cells, blank notes, write the batch serial, and save under a new `[SERIAL]` name.
|
|
||||||
|
|
||||||
## Platforms
|
Create a new QC datasheet from the latest matching workbook: clear configured cells,
|
||||||
|
blank notes, write the batch serial, and save under a new `[SERIAL]` name.
|
||||||
|
|
||||||
| Platform | Default backend | Behavior |
|
Everyday use opens a **single app window** (Set -> Ink -> Serial -> Create).
|
||||||
|----------|-----------------|----------|
|
No terminal commands are required for operators.
|
||||||
| Windows | `com` | Microsoft Excel via `pywin32`; loads add-ins from `strings.txt`; leaves Excel open |
|
|
||||||
| Linux / macOS | `ooxml` | Surgical OOXML zip edit; preserves formulas, formatting, queries/connections on disk |
|
|
||||||
|
|
||||||
Force a backend with `--backend com` or `--backend ooxml`.
|
## Quick start (Windows operators)
|
||||||
|
|
||||||
The OOXML path does **not** refresh Power Query, evaluate formulas, or load `.xlam`/`.xla`
|
1. One-time setup (IT / first install): install [uv](https://docs.astral.sh/uv/getting-started/installation/), clone/copy this project, then double-click
|
||||||
add-ins. Open the written file in Excel for refresh/calc. Prefer `com` on Windows when
|
**`desktop\Setup.bat`**
|
||||||
|
2. Every day: launch the app via the **New QC Sheet** shortcut
|
||||||
|
3. In the app window: choose **Set**, **Ink color**, enter **Serial**, click **Create datasheet**
|
||||||
|
|
||||||
|
`Setup.bat` creates `.venv` with uv and installs the package. Operators create their own
|
||||||
|
shortcut to `desktop\XlsxClean.vbs` (uses the modern icon in `desktop\xlsx-clean.ico`).
|
||||||
|
On Windows, install the Microsoft Edge WebView2 Runtime separately before opening the
|
||||||
|
PyWebView GUI; `pythonnet` does not install it. The shortcut runs `desktop\XlsxClean.vbs`
|
||||||
|
which launches the GUI window. Closing that window stops the app.
|
||||||
|
|
||||||
|
When you **Create** with the **com** backend, Excel is maximized and brought to the front
|
||||||
|
after the new workbook is saved.
|
||||||
|
|
||||||
|
If something fails, use **`desktop\XlsxClean.bat`** instead - it shows a console with errors.
|
||||||
|
|
||||||
|
## Standalone Windows exe (optional)
|
||||||
|
|
||||||
|
To put a self-contained app on other PCs (build **on Windows**):
|
||||||
|
|
||||||
|
1. Install [uv](https://docs.astral.sh/uv/getting-started/installation/) if needed
|
||||||
|
2. Double-click **`desktop\build_windows_exe.bat`**
|
||||||
|
3. It creates `dist\New QC Sheet\New QC Sheet.exe`
|
||||||
|
4. Copy the whole **`dist\New QC Sheet\`** folder when moving to another machine (keep files together)
|
||||||
|
|
||||||
|
## What the app does
|
||||||
|
|
||||||
|
| Step | Action |
|
||||||
|
|------|--------|
|
||||||
|
| 1 | Resolve `[YEAR]` and find the latest matching workbook (template) in that product folder |
|
||||||
|
| 2 | Clear configured cells / blank notes |
|
||||||
|
| 3 | Write the batch serial |
|
||||||
|
| 4 | Save under the largest existing year folder using the `[SERIAL]` name pattern |
|
||||||
|
|
||||||
|
Year folders in `file_data.csv` use a `[YEAR]` placeholder. The template is read from the largest digit-named year directory that already contains matching sheets for that ink. The new workbook is written into the largest digit-named year directory under the same QC parent (existence only; the ink folder is created if missing).
|
||||||
|
|
||||||
|
### Excel backends
|
||||||
|
|
||||||
|
| Platform | Default | Notes |
|
||||||
|
|----------|---------|--------|
|
||||||
|
| Windows | `com` | Uses Microsoft Excel + add-ins from `strings.txt`; leaves Excel open |
|
||||||
|
| Linux / macOS | `ooxml` | Surgical `.xlsx` edit; keeps formulas, formatting, and queries on disk |
|
||||||
|
|
||||||
|
Choose the backend in the `config.toml` file, or override with CLI `--backend com|ooxml`.
|
||||||
|
|
||||||
|
**Limits of `ooxml`:** does not refresh Power Query, calculate formulas, or load `.xlam`/`.xla`
|
||||||
|
add-ins. Open the file in Excel afterward for refresh/calc. Prefer **`com` on Windows** when
|
||||||
you need add-ins and a live Excel session.
|
you need add-ins and a live Excel session.
|
||||||
|
|
||||||
## Config
|
## First-time install (admins)
|
||||||
|
|
||||||
- `src/xlsx_clean/file_data.csv` — product dirs, filename patterns, cells to clear/set
|
Uses **uv** only (no pip / no rye). Install uv once:
|
||||||
- `src/xlsx_clean/strings.txt` — prompts + Windows add-in paths (COM only)
|
https://docs.astral.sh/uv/getting-started/installation/
|
||||||
- `XLSX_CLEAN_ROOT` — optional root that replaces `D:\OpenCloud` in CSV paths
|
|
||||||
(example: `export XLSX_CLEAN_ROOT=/mnt/opencloud`)
|
|
||||||
|
|
||||||
## Run
|
**Windows (recommended):** double-click **`desktop\Setup.bat`**
|
||||||
|
|
||||||
|
**Linux (recommended):** from the project root:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# installed entry point
|
chmod +x desktop/setup_linux.sh
|
||||||
xlsx-clean
|
./desktop/setup_linux.sh
|
||||||
|
|
||||||
# or module
|
|
||||||
python -m xlsx_clean.clean_cells --backend ooxml
|
|
||||||
```
|
```
|
||||||
|
|
||||||
On Windows, `src/xlsx_clean/new_xslx.bat` runs the same module entry point.
|
That installs the required GTK/WebKitGTK packages, creates a venv that can import the
|
||||||
|
apt-provided `gi` bindings, and runs `uv sync`. It uses WebKit2 4.1 when available and
|
||||||
|
supports distro packages that provide WebKit2 4.0. Operators create their own shortcut
|
||||||
|
to `.venv/bin/python -m xlsx_clean.gui_app`.
|
||||||
|
|
||||||
|
**Manual / macOS:**
|
||||||
|
|
||||||
|
The macOS backend defaults to **`ooxml`** (no Excel/COM on macOS). WKWebView is built into
|
||||||
|
macOS, so no extra system packages are needed beyond Python 3.12+ and `uv`.
|
||||||
|
|
||||||
|
From the project root:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
uv sync
|
||||||
|
```
|
||||||
|
|
||||||
|
That creates `.venv` and installs locked deps from `uv.lock` (including the `pyobjc`
|
||||||
|
bindings used by PyWebView).
|
||||||
|
|
||||||
|
To create a double-clickable Finder launcher that runs the GUI:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
chmod +x desktop/XlsxClean.command
|
||||||
|
```
|
||||||
|
|
||||||
|
Then double-click **`desktop/XlsxClean.command`** in Finder. The first launch may require
|
||||||
|
right-click → Open (Gatekeeper) once. The script opens the app window in a new Terminal
|
||||||
|
window; closing that window stops the app. Operators create their own shortcut to this
|
||||||
|
executable.
|
||||||
|
|
||||||
|
Before building the standalone exe:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
uv sync --extra desktop
|
||||||
|
```
|
||||||
|
|
||||||
|
Optional: Edit `~/.xlsx-clean/config.toml` (created automatically on first run) if workbooks are not under the default `D:\\OpenCloud` paths.
|
||||||
|
|
||||||
|
## Developer interfaces
|
||||||
|
|
||||||
|
These are optional; operators use the shortcut to the app executable.
|
||||||
|
|
||||||
|
**GUI (desktop window)**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
.venv/bin/python -m xlsx_clean.gui_app --width 800 --height 600
|
||||||
|
# Windows: .venv\Scripts\python.exe -m xlsx_clean.gui_app --width 800 --height 600
|
||||||
|
```
|
||||||
|
|
||||||
|
**CLI**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
.venv/bin/python -m xlsx_clean.clean_cells --backend ooxml
|
||||||
|
```
|
||||||
|
|
||||||
|
Windows CLI helper: `src\xlsx_clean\new_xslx.bat`
|
||||||
|
|
||||||
|
## Config files
|
||||||
|
|
||||||
|
| File | Purpose |
|
||||||
|
|------|---------|
|
||||||
|
| `config.toml` | Backend choice and root directory path for each set (auto-generated in `~/.xlsx-clean/` on first run) |
|
||||||
|
| `src/xlsx_clean/file_data.csv` | Relative product folders (`[YEAR]` placeholder), filename patterns, cells to clear/set |
|
||||||
|
| `src/xlsx_clean/strings.txt` | UI prompts + Windows Excel add-in paths (`com` only) |
|
||||||
|
|
||||||
|
## Project layout (launchers)
|
||||||
|
|
||||||
|
| Path | Purpose |
|
||||||
|
|------|---------|
|
||||||
|
| `desktop/xlsx-clean.ico` | Modern Windows Desktop / exe icon |
|
||||||
|
| `desktop/Setup.bat` | Windows one-time setup via uv |
|
||||||
|
| `desktop/setup_linux.sh` | Linux one-time setup (uv sync) |
|
||||||
|
| `desktop/XlsxClean.command` | macOS double-click launcher (opens GUI in Terminal) |
|
||||||
|
| `desktop/XlsxClean.vbs` | Silent Windows double-click launcher |
|
||||||
|
| `desktop/XlsxClean.bat` | Windows launcher with visible console |
|
||||||
|
| `desktop/build_windows_exe.bat` | Build standalone `New QC Sheet.exe` with uv |
|
||||||
|
| `packaging/xlsx_clean.spec` | PyInstaller spec |
|
||||||
|
|||||||
25
desktop/Setup.bat
Normal file
25
desktop/Setup.bat
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
@echo off
|
||||||
|
REM One-time Windows setup with uv: sync deps from uv.lock.
|
||||||
|
setlocal
|
||||||
|
cd /d "%~dp0\.."
|
||||||
|
|
||||||
|
where uv >nul 2>&1
|
||||||
|
if errorlevel 1 (
|
||||||
|
echo uv was not found on PATH.
|
||||||
|
echo Install uv from https://docs.astral.sh/uv/getting-started/installation/
|
||||||
|
echo then re-run this script.
|
||||||
|
pause
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
echo Syncing project with uv (creates .venv if needed)...
|
||||||
|
uv sync
|
||||||
|
if errorlevel 1 (
|
||||||
|
echo uv sync failed.
|
||||||
|
pause
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo Setup complete. Create your own shortcut to desktop\XlsxClean.vbs.
|
||||||
|
pause
|
||||||
10
desktop/XlsxClean.bat
Normal file
10
desktop/XlsxClean.bat
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
@echo off
|
||||||
|
REM Double-click launcher with visible console (useful for troubleshooting).
|
||||||
|
setlocal
|
||||||
|
cd /d "%~dp0\.."
|
||||||
|
|
||||||
|
if exist ".venv\Scripts\python.exe" (
|
||||||
|
".venv\Scripts\python.exe" -m xlsx_clean.gui_app %*
|
||||||
|
) else (
|
||||||
|
py -3 -m xlsx_clean.gui_app %*
|
||||||
|
)
|
||||||
14
desktop/XlsxClean.command
Executable file
14
desktop/XlsxClean.command
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Operator launcher for New QC Sheet on macOS.
|
||||||
|
# Double-click in Finder (or run from Terminal). Opens the GUI in a new Terminal window.
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||||
|
cd "$ROOT"
|
||||||
|
|
||||||
|
if [[ ! -x .venv/bin/python ]]; then
|
||||||
|
echo "Virtual environment not found. Run 'uv sync' first, or use desktop/setup_macos.sh." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec ./.venv/bin/python -m xlsx_clean.gui_app
|
||||||
28
desktop/XlsxClean.vbs
Normal file
28
desktop/XlsxClean.vbs
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
' XlsxClean.vbs - double-click launcher (no console window)
|
||||||
|
' Resolves repo root from this script's folder (desktop\ -> repo root).
|
||||||
|
Option Explicit
|
||||||
|
|
||||||
|
Dim fso, sh, scriptDir, root, pythonExe, cmd
|
||||||
|
Set fso = CreateObject("Scripting.FileSystemObject")
|
||||||
|
Set sh = CreateObject("WScript.Shell")
|
||||||
|
|
||||||
|
scriptDir = fso.GetParentFolderName(WScript.ScriptFullName)
|
||||||
|
root = fso.GetParentFolderName(scriptDir)
|
||||||
|
|
||||||
|
' Prefer project venv, then py launcher, then python on PATH.
|
||||||
|
pythonExe = root & "\.venv\Scripts\pythonw.exe"
|
||||||
|
If Not fso.FileExists(pythonExe) Then
|
||||||
|
pythonExe = root & "\.venv\Scripts\python.exe"
|
||||||
|
End If
|
||||||
|
If Not fso.FileExists(pythonExe) Then
|
||||||
|
pythonExe = "py"
|
||||||
|
End If
|
||||||
|
|
||||||
|
sh.CurrentDirectory = root
|
||||||
|
' Window style 0 = hidden.
|
||||||
|
cmd = """" & pythonExe & """ -m xlsx_clean.gui_app"
|
||||||
|
If pythonExe = "py" Then
|
||||||
|
cmd = "py -3 -m xlsx_clean.gui_app"
|
||||||
|
End If
|
||||||
|
|
||||||
|
sh.Run cmd, 0, False
|
||||||
56
desktop/build_windows_exe.bat
Normal file
56
desktop/build_windows_exe.bat
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
@echo off
|
||||||
|
REM Build dist\New QC Sheet\New QC Sheet.exe on Windows with uv, then Desktop shortcut.
|
||||||
|
setlocal
|
||||||
|
cd /d "%~dp0\.."
|
||||||
|
|
||||||
|
where uv >nul 2>&1
|
||||||
|
if errorlevel 1 (
|
||||||
|
echo uv was not found on PATH.
|
||||||
|
echo Install uv from https://docs.astral.sh/uv/getting-started/installation/
|
||||||
|
pause
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
echo Syncing project + desktop extras with uv...
|
||||||
|
uv sync --extra desktop
|
||||||
|
if errorlevel 1 (
|
||||||
|
echo uv sync failed.
|
||||||
|
pause
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
echo Building executable with PyInstaller...
|
||||||
|
uv run pyinstaller --noconfirm packaging\xlsx_clean.spec
|
||||||
|
if errorlevel 1 (
|
||||||
|
echo PyInstaller build failed.
|
||||||
|
pause
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
set EXE=%CD%\dist\New QC Sheet\New QC Sheet.exe
|
||||||
|
if not exist "%EXE%" (
|
||||||
|
echo Expected exe not found: %EXE%
|
||||||
|
pause
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
echo Creating Desktop shortcut to the exe...
|
||||||
|
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
|
||||||
|
"$desk=[Environment]::GetFolderPath('Desktop');" ^
|
||||||
|
"$lnk=Join-Path $desk 'New QC Sheet.lnk';" ^
|
||||||
|
"$legacy=Join-Path $desk 'XlsxClean.lnk';" ^
|
||||||
|
"if (Test-Path $legacy) { Remove-Item $legacy -Force };" ^
|
||||||
|
"$ico=Join-Path '%CD%' 'desktop\xlsx-clean.ico';" ^
|
||||||
|
"$w=New-Object -ComObject WScript.Shell;" ^
|
||||||
|
"$s=$w.CreateShortcut($lnk);" ^
|
||||||
|
"$s.TargetPath='%EXE%';" ^
|
||||||
|
"$s.WorkingDirectory='%~dp0..\dist\New QC Sheet';" ^
|
||||||
|
"$s.Description='Open New QC Sheet';" ^
|
||||||
|
"if (Test-Path $ico) { $s.IconLocation = $ico };" ^
|
||||||
|
"$s.Save();" ^
|
||||||
|
"Write-Host Created $lnk"
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo Done. Double-click the New QC Sheet icon on your Desktop.
|
||||||
|
echo Exe folder: dist\New QC Sheet\
|
||||||
|
pause
|
||||||
107
desktop/setup_linux.sh
Executable file
107
desktop/setup_linux.sh
Executable file
@@ -0,0 +1,107 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Operator setup for New QC Sheet on Debian/Ubuntu Linux desktops.
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||||
|
cd "$ROOT"
|
||||||
|
|
||||||
|
SYS_PY=/usr/bin/python3
|
||||||
|
|
||||||
|
if ! command -v uv >/dev/null 2>&1; then
|
||||||
|
echo "uv not found on PATH. Install uv first: https://docs.astral.sh/uv/" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! command -v apt-get >/dev/null 2>&1; then
|
||||||
|
echo "This setup script requires apt-get (Debian/Ubuntu). Install python3-gi,"
|
||||||
|
echo "gir1.2-gtk-3.0, and gir1.2-webkit2-4.1 (or WebKit2 4.0) manually." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -x "$SYS_PY" ]]; then
|
||||||
|
echo "System Python not found at $SYS_PY" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
packages=(python3-gi gir1.2-gtk-3.0)
|
||||||
|
if apt-cache show gir1.2-webkit2-4.1 >/dev/null 2>&1; then
|
||||||
|
packages+=(gir1.2-webkit2-4.1)
|
||||||
|
elif apt-cache show gir1.2-webkit2-4.0 >/dev/null 2>&1; then
|
||||||
|
packages+=(gir1.2-webkit2-4.0)
|
||||||
|
else
|
||||||
|
echo "Neither gir1.2-webkit2-4.1 nor gir1.2-webkit2-4.0 is available." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
missing=()
|
||||||
|
for package in "${packages[@]}"; do
|
||||||
|
if ! dpkg-query -W -f='${db:Status-Status}' "$package" 2>/dev/null | grep -qx installed; then
|
||||||
|
missing+=("$package")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if ((${#missing[@]})); then
|
||||||
|
echo "Installing GTK/WebKitGTK requirements: ${missing[*]}"
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y "${missing[@]}"
|
||||||
|
else
|
||||||
|
echo "GTK/WebKitGTK requirements already installed."
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! "$SYS_PY" -c 'import gi' >/dev/null 2>&1; then
|
||||||
|
echo "System $SYS_PY cannot import gi. Install python3-gi." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
enable_system_site_packages() {
|
||||||
|
local cfg=.venv/pyvenv.cfg
|
||||||
|
if [[ ! -f "$cfg" ]]; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if grep -q '^include-system-site-packages' "$cfg"; then
|
||||||
|
sed -i 's/^include-system-site-packages = .*/include-system-site-packages = true/' "$cfg"
|
||||||
|
else
|
||||||
|
printf '\ninclude-system-site-packages = true\n' >> "$cfg"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ ! -x .venv/bin/python ]] || ! .venv/bin/python -c 'import gi' >/dev/null 2>&1; then
|
||||||
|
echo "Creating venv with the system Python and system site packages..."
|
||||||
|
rm -rf .venv
|
||||||
|
uv venv --python /usr/bin/python3 --no-managed-python --system-site-packages
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Syncing dependencies..."
|
||||||
|
# Pin the same interpreter so uv does not honor .python-version (3.12) and
|
||||||
|
# recreate a managed venv without apt gi (python3-gi).
|
||||||
|
uv sync --python /usr/bin/python3 --no-managed-python
|
||||||
|
|
||||||
|
if ! .venv/bin/python -c 'import gi' >/dev/null 2>&1; then
|
||||||
|
echo "Restoring system site packages on .venv so apt gi is importable..."
|
||||||
|
enable_system_site_packages
|
||||||
|
fi
|
||||||
|
|
||||||
|
venv_ver="$(.venv/bin/python -c 'import sys; print("%d.%d" % sys.version_info[:2])')"
|
||||||
|
sys_ver="$("$SYS_PY" -c 'import sys; print("%d.%d" % sys.version_info[:2])')"
|
||||||
|
if [[ "$venv_ver" != "$sys_ver" ]]; then
|
||||||
|
echo "venv Python $venv_ver does not match system Python $sys_ver at $SYS_PY." >&2
|
||||||
|
echo "uv likely honored .python-version instead of the system interpreter." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Verifying GTK and WebKit2 bindings..."
|
||||||
|
.venv/bin/python -c '
|
||||||
|
import gi
|
||||||
|
gi.require_version("Gtk", "3.0")
|
||||||
|
try:
|
||||||
|
gi.require_version("WebKit2", "4.1")
|
||||||
|
except ValueError:
|
||||||
|
gi.require_version("WebKit2", "4.0")
|
||||||
|
from gi.repository import Gtk, WebKit2
|
||||||
|
print("GTK/WebKit2 bindings available")
|
||||||
|
'
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Done. Launch with:"
|
||||||
|
echo " .venv/bin/python -m xlsx_clean.gui_app"
|
||||||
|
echo "Create your own shortcut to that command."
|
||||||
BIN
desktop/xlsx-clean.ico
Normal file
BIN
desktop/xlsx-clean.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
BIN
desktop/xlsx-clean.png
Normal file
BIN
desktop/xlsx-clean.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
95
packaging/xlsx_clean.spec
Normal file
95
packaging/xlsx_clean.spec
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
# -*- mode: python ; coding: utf-8 -*-
|
||||||
|
"""PyInstaller spec for a double-clickable New QC Sheet executable.
|
||||||
|
|
||||||
|
Build on Windows (recommended for shop-floor PCs):
|
||||||
|
desktop\\build_windows_exe.bat
|
||||||
|
|
||||||
|
Or manually:
|
||||||
|
pyinstaller packaging/xlsx_clean.spec
|
||||||
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
from PyInstaller.utils.hooks import collect_all
|
||||||
|
|
||||||
|
block_cipher = None
|
||||||
|
|
||||||
|
# SPECPATH is set by PyInstaller to the folder containing this spec file
|
||||||
|
ROOT_DIR = os.path.abspath(os.path.join(SPECPATH, ".."))
|
||||||
|
|
||||||
|
datas = [
|
||||||
|
(os.path.join(ROOT_DIR, "src", "xlsx_clean", "file_data.csv"), "xlsx_clean"),
|
||||||
|
(os.path.join(ROOT_DIR, "src", "xlsx_clean", "strings.txt"), "xlsx_clean"),
|
||||||
|
(os.path.join(ROOT_DIR, "src", "xlsx_clean", "fonts"), "xlsx_clean/fonts"),
|
||||||
|
(os.path.join(ROOT_DIR, "src", "xlsx_clean", "ui"), "xlsx_clean/ui"),
|
||||||
|
]
|
||||||
|
binaries = []
|
||||||
|
hiddenimports = [
|
||||||
|
"xlsx_clean",
|
||||||
|
"xlsx_clean.core",
|
||||||
|
"xlsx_clean.gui_app",
|
||||||
|
"xlsx_clean.clean_cells",
|
||||||
|
"xlsx_clean.ooxml_backend",
|
||||||
|
"xlsx_clean.com_backend",
|
||||||
|
"xlsx_clean.paths",
|
||||||
|
]
|
||||||
|
|
||||||
|
webview_ret = collect_all("webview")
|
||||||
|
datas += webview_ret[0]
|
||||||
|
binaries += webview_ret[1]
|
||||||
|
hiddenimports += webview_ret[2]
|
||||||
|
|
||||||
|
if sys.platform == "win32":
|
||||||
|
clr_ret = collect_all("clr_loader")
|
||||||
|
datas += clr_ret[0]
|
||||||
|
binaries += clr_ret[1]
|
||||||
|
hiddenimports += clr_ret[2]
|
||||||
|
hiddenimports += ["clr", "clr_loader", "pythonnet"]
|
||||||
|
|
||||||
|
a = Analysis(
|
||||||
|
[os.path.join(ROOT_DIR, "src", "xlsx_clean", "gui_app.py")],
|
||||||
|
pathex=[ROOT_DIR],
|
||||||
|
binaries=binaries,
|
||||||
|
datas=datas,
|
||||||
|
hiddenimports=hiddenimports,
|
||||||
|
hookspath=[],
|
||||||
|
hooksconfig={},
|
||||||
|
runtime_hooks=[],
|
||||||
|
excludes=[],
|
||||||
|
win_no_prefer_redirects=False,
|
||||||
|
win_private_assemblies=False,
|
||||||
|
cipher=block_cipher,
|
||||||
|
noarchive=False,
|
||||||
|
)
|
||||||
|
|
||||||
|
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
|
||||||
|
|
||||||
|
exe = EXE(
|
||||||
|
pyz,
|
||||||
|
a.scripts,
|
||||||
|
[],
|
||||||
|
exclude_binaries=True,
|
||||||
|
name="New QC Sheet",
|
||||||
|
debug=False,
|
||||||
|
bootloader_ignore_signals=False,
|
||||||
|
strip=False,
|
||||||
|
upx=True,
|
||||||
|
console=False,
|
||||||
|
disable_windowed_traceback=False,
|
||||||
|
argv_emulation=False,
|
||||||
|
target_arch=None,
|
||||||
|
codesign_identity=None,
|
||||||
|
entitlements_file=None,
|
||||||
|
icon=os.path.join(ROOT_DIR, "desktop", "xlsx-clean.ico"),
|
||||||
|
)
|
||||||
|
|
||||||
|
coll = COLLECT(
|
||||||
|
exe,
|
||||||
|
a.binaries,
|
||||||
|
a.zipfiles,
|
||||||
|
a.datas,
|
||||||
|
strip=False,
|
||||||
|
upx=True,
|
||||||
|
upx_exclude=[],
|
||||||
|
name="New QC Sheet",
|
||||||
|
)
|
||||||
@@ -1,31 +1,66 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "xlsx-clean"
|
name = "xlsx-clean"
|
||||||
version = "0.1.0"
|
version = "1.0.0"
|
||||||
description = "Add your description here"
|
description = "Create a new QC datasheet from the latest matching workbook"
|
||||||
authors = [
|
authors = [
|
||||||
{ name = "Diaco Soltanpour", email = "dyaco8464@yahoo.com" }
|
{ name = "Diaco Soltanpour", email = "dyaco8464@yahoo.com" }
|
||||||
]
|
]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"beaupy>=3.8.2",
|
"beaupy>=3.12.0",
|
||||||
"pandas>=2.2.2",
|
"pywebview>=5.0",
|
||||||
"pywin32>=306; sys_platform == 'win32'",
|
"pywin32>=312; sys_platform == 'win32'",
|
||||||
]
|
]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">= 3.12"
|
requires-python = ">=3.12"
|
||||||
|
|
||||||
[project.scripts]
|
[project.scripts]
|
||||||
xlsx-clean = "xlsx_clean.clean_cells:main"
|
xlsx-clean = "xlsx_clean.clean_cells:main"
|
||||||
|
xlsx-clean-gui = "xlsx_clean.gui_app:main"
|
||||||
|
|
||||||
|
[project.optional-dependencies]
|
||||||
|
desktop = [
|
||||||
|
"pyinstaller>=6.21.0",
|
||||||
|
]
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["hatchling"]
|
requires = ["hatchling"]
|
||||||
build-backend = "hatchling.build"
|
build-backend = "hatchling.build"
|
||||||
|
|
||||||
[tool.rye]
|
|
||||||
managed = true
|
|
||||||
dev-dependencies = []
|
|
||||||
|
|
||||||
[tool.hatch.metadata]
|
[tool.hatch.metadata]
|
||||||
allow-direct-references = true
|
allow-direct-references = true
|
||||||
|
|
||||||
[tool.hatch.build.targets.wheel]
|
[tool.hatch.build.targets.wheel]
|
||||||
packages = ["src/xlsx_clean"]
|
packages = ["src/xlsx_clean"]
|
||||||
|
|
||||||
|
[tool.hatch.build.targets.wheel.force-include]
|
||||||
|
"src/xlsx_clean/file_data.csv" = "xlsx_clean/file_data.csv"
|
||||||
|
"src/xlsx_clean/strings.txt" = "xlsx_clean/strings.txt"
|
||||||
|
"src/xlsx_clean/new_xslx.bat" = "xlsx_clean/new_xslx.bat"
|
||||||
|
|
||||||
|
[dependency-groups]
|
||||||
|
test = [
|
||||||
|
"pytest>=8.0",
|
||||||
|
]
|
||||||
|
|
||||||
|
[tool.pytest.ini_options]
|
||||||
|
testpaths = ["tests"]
|
||||||
|
|
||||||
|
[tool.uv]
|
||||||
|
package = true
|
||||||
|
default-groups = ["test"]
|
||||||
|
|
||||||
|
# Version bumps: `uvx bump-my-version bump patch|minor|major`
|
||||||
|
# current_version falls back to [project].version above.
|
||||||
|
[tool.bumpversion]
|
||||||
|
commit = false
|
||||||
|
tag = false
|
||||||
|
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
||||||
|
serialize = ["{major}.{minor}.{patch}"]
|
||||||
|
message = "Bump version: {current_version} → {new_version}"
|
||||||
|
tag_name = "v{new_version}"
|
||||||
|
tag_message = "Bump version: {current_version} → {new_version}"
|
||||||
|
|
||||||
|
[[tool.bumpversion.files]]
|
||||||
|
filename = "pyproject.toml"
|
||||||
|
search = 'version = "{current_version}"'
|
||||||
|
replace = 'version = "{new_version}"'
|
||||||
|
|||||||
@@ -1,42 +0,0 @@
|
|||||||
# generated by rye
|
|
||||||
# use `rye lock` or `rye sync` to update this lockfile
|
|
||||||
#
|
|
||||||
# last locked with the following flags:
|
|
||||||
# pre: false
|
|
||||||
# features: []
|
|
||||||
# all-features: false
|
|
||||||
# with-sources: false
|
|
||||||
|
|
||||||
-e file:.
|
|
||||||
beaupy==3.8.2
|
|
||||||
# via xlsx-clean
|
|
||||||
emoji==2.11.0
|
|
||||||
# via beaupy
|
|
||||||
markdown-it-py==3.0.0
|
|
||||||
# via rich
|
|
||||||
mdurl==0.1.2
|
|
||||||
# via markdown-it-py
|
|
||||||
numpy==1.26.4
|
|
||||||
# via pandas
|
|
||||||
pandas==2.2.2
|
|
||||||
# via xlsx-clean
|
|
||||||
pygments==2.17.2
|
|
||||||
# via rich
|
|
||||||
python-dateutil==2.9.0.post0
|
|
||||||
# via pandas
|
|
||||||
python-yakh==0.3.2
|
|
||||||
# via beaupy
|
|
||||||
# via questo
|
|
||||||
pytz==2024.1
|
|
||||||
# via pandas
|
|
||||||
pywin32==306
|
|
||||||
# via xlsx-clean; Windows-only (sys_platform == 'win32')
|
|
||||||
questo==0.2.3
|
|
||||||
# via beaupy
|
|
||||||
rich==13.7.1
|
|
||||||
# via beaupy
|
|
||||||
# via questo
|
|
||||||
six==1.16.0
|
|
||||||
# via python-dateutil
|
|
||||||
tzdata==2024.1
|
|
||||||
# via pandas
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
# generated by rye
|
|
||||||
# use `rye lock` or `rye sync` to update this lockfile
|
|
||||||
#
|
|
||||||
# last locked with the following flags:
|
|
||||||
# pre: false
|
|
||||||
# features: []
|
|
||||||
# all-features: false
|
|
||||||
# with-sources: false
|
|
||||||
|
|
||||||
-e file:.
|
|
||||||
beaupy==3.8.2
|
|
||||||
# via xlsx-clean
|
|
||||||
emoji==2.11.0
|
|
||||||
# via beaupy
|
|
||||||
markdown-it-py==3.0.0
|
|
||||||
# via rich
|
|
||||||
mdurl==0.1.2
|
|
||||||
# via markdown-it-py
|
|
||||||
numpy==1.26.4
|
|
||||||
# via pandas
|
|
||||||
pandas==2.2.2
|
|
||||||
# via xlsx-clean
|
|
||||||
pygments==2.17.2
|
|
||||||
# via rich
|
|
||||||
python-dateutil==2.9.0.post0
|
|
||||||
# via pandas
|
|
||||||
python-yakh==0.3.2
|
|
||||||
# via beaupy
|
|
||||||
# via questo
|
|
||||||
pytz==2024.1
|
|
||||||
# via pandas
|
|
||||||
pywin32==306
|
|
||||||
# via xlsx-clean; Windows-only (sys_platform == 'win32')
|
|
||||||
questo==0.2.3
|
|
||||||
# via beaupy
|
|
||||||
rich==13.7.1
|
|
||||||
# via beaupy
|
|
||||||
# via questo
|
|
||||||
six==1.16.0
|
|
||||||
# via python-dateutil
|
|
||||||
tzdata==2024.1
|
|
||||||
# via pandas
|
|
||||||
50
src/xlsx_clean/app_logging.py
Normal file
50
src/xlsx_clean/app_logging.py
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
"""Append-only file logging for QC datasheet creation."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import logging
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
_LOGGER_NAME = "xlsx_clean.create"
|
||||||
|
_configured = False
|
||||||
|
|
||||||
|
|
||||||
|
def default_log_path() -> Path:
|
||||||
|
"""Resolve the log file path.
|
||||||
|
|
||||||
|
Order:
|
||||||
|
1. ``XLSX_CLEAN_LOG`` env var (file path)
|
||||||
|
2. Next to the frozen executable (PyInstaller)
|
||||||
|
3. ``~/.xlsx-clean/xlsx-clean.log``
|
||||||
|
"""
|
||||||
|
env = os.environ.get("XLSX_CLEAN_LOG")
|
||||||
|
if env:
|
||||||
|
return Path(env)
|
||||||
|
|
||||||
|
if getattr(sys, "frozen", False):
|
||||||
|
return Path(sys.executable).resolve().parent / "xlsx-clean.log"
|
||||||
|
|
||||||
|
return Path.home() / ".xlsx-clean" / "xlsx-clean.log"
|
||||||
|
|
||||||
|
|
||||||
|
def get_logger() -> logging.Logger:
|
||||||
|
"""Return a logger that appends timestamped lines to the log file."""
|
||||||
|
global _configured
|
||||||
|
logger = logging.getLogger(_LOGGER_NAME)
|
||||||
|
if not _configured:
|
||||||
|
log_path = default_log_path()
|
||||||
|
log_path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
handler = logging.FileHandler(log_path, encoding="utf-8")
|
||||||
|
handler.setFormatter(
|
||||||
|
logging.Formatter(
|
||||||
|
fmt="%(asctime)s %(levelname)s %(message)s",
|
||||||
|
datefmt="%Y-%m-%d %H:%M:%S",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
logger.addHandler(handler)
|
||||||
|
logger.setLevel(logging.INFO)
|
||||||
|
logger.propagate = False
|
||||||
|
_configured = True
|
||||||
|
return logger
|
||||||
@@ -1,57 +1,19 @@
|
|||||||
"""Interactive CLI: copy latest QC workbook, clear cells, stamp serial."""
|
"""Interactive CLI: select set/ink/serial, create a cleaned QC workbook."""
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import shutil
|
|
||||||
import sys
|
|
||||||
import tempfile
|
|
||||||
from datetime import datetime
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
import pandas
|
|
||||||
from beaupy import prompt, select
|
from beaupy import prompt, select
|
||||||
from rich.console import Console
|
from rich.console import Console
|
||||||
|
|
||||||
from xlsx_clean.paths import (
|
from xlsx_clean.core import (
|
||||||
default_backend,
|
create_datasheet,
|
||||||
get_opencloud_root,
|
list_ink_colors,
|
||||||
package_file,
|
list_sets,
|
||||||
remap_opencloud_path,
|
load_config,
|
||||||
resolve_backend,
|
|
||||||
)
|
)
|
||||||
|
from xlsx_clean.paths import default_backend, resolve_backend
|
||||||
NEW_VALUE = ""
|
|
||||||
|
|
||||||
|
|
||||||
def find_last_workbook(files: list[str]) -> str:
|
|
||||||
return sorted(files)[-1]
|
|
||||||
|
|
||||||
|
|
||||||
def get_workbook_names(
|
|
||||||
files: list[str],
|
|
||||||
batch_serial: str,
|
|
||||||
source_dir: Path,
|
|
||||||
pattern: str,
|
|
||||||
) -> tuple[str, Path]:
|
|
||||||
last_workbook = find_last_workbook(files)
|
|
||||||
path_of_the_year = Path(str(source_dir).replace("2025", str(datetime.now().year)))
|
|
||||||
return last_workbook, path_of_the_year / pattern.replace(
|
|
||||||
"[SERIAL]", batch_serial.split("/")[0]
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def load_config() -> tuple[list[str], pandas.DataFrame]:
|
|
||||||
strings_path = package_file("strings.txt")
|
|
||||||
with open(strings_path, encoding="utf-8") as f:
|
|
||||||
content = [line.strip() for line in f.readlines()]
|
|
||||||
|
|
||||||
path_df = pandas.read_csv(package_file("file_data.csv"))
|
|
||||||
root = get_opencloud_root()
|
|
||||||
path_df["dir"] = [
|
|
||||||
str(remap_opencloud_path(path, root)) for path in path_df["dir"]
|
|
||||||
]
|
|
||||||
return content, path_df
|
|
||||||
|
|
||||||
|
|
||||||
def parse_args(argv: list[str] | None = None) -> argparse.Namespace:
|
def parse_args(argv: list[str] | None = None) -> argparse.Namespace:
|
||||||
@@ -67,93 +29,73 @@ def parse_args(argv: list[str] | None = None) -> argparse.Namespace:
|
|||||||
default=None,
|
default=None,
|
||||||
help=(
|
help=(
|
||||||
"Excel edit backend: 'com' (Windows Excel + add-ins) or "
|
"Excel edit backend: 'com' (Windows Excel + add-ins) or "
|
||||||
f"'ooxml' (surgical zip edit). Default: {default_backend()}."
|
f"'ooxml' (surgical zip edit). Default: {default_backend()} (Overrides config.toml)."
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--root",
|
||||||
|
type=str,
|
||||||
|
default=None,
|
||||||
|
help="Override the root directory for the selected set.",
|
||||||
|
)
|
||||||
return parser.parse_args(argv)
|
return parser.parse_args(argv)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def run(argv: list[str] | None = None) -> int:
|
def run(argv: list[str] | None = None) -> int:
|
||||||
|
from pathlib import Path
|
||||||
args = parse_args(argv)
|
args = parse_args(argv)
|
||||||
backend = resolve_backend(args.backend)
|
|
||||||
content, path_df = load_config()
|
content, rows, config = load_config()
|
||||||
|
|
||||||
|
# Validate early so CLI fails fast on unsupported COM.
|
||||||
|
try:
|
||||||
|
backend = resolve_backend(args.backend, config.get("backend"))
|
||||||
|
except (ValueError, RuntimeError) as exc:
|
||||||
|
Console().print(f"[red]{exc}[/red]")
|
||||||
|
return 1
|
||||||
|
|
||||||
|
|
||||||
q1, q2, q3 = content[0], content[1], content[2]
|
q1, q2, q3 = content[0], content[1], content[2]
|
||||||
addin_paths = content[3:5] if len(content) >= 5 else []
|
addin_paths = content[3:5] if len(content) >= 5 else []
|
||||||
|
|
||||||
parent_path = list(
|
|
||||||
path_df.drop_duplicates(subset=["set_name"], keep="first")["set_name"]
|
|
||||||
)
|
|
||||||
|
|
||||||
console = Console()
|
console = Console()
|
||||||
console.print(q1)
|
console.print(q1)
|
||||||
selected_set = select(parent_path, cursor_style="cyan")
|
selected_set = select(list_sets(rows), cursor_style="cyan")
|
||||||
|
|
||||||
console.print(q2)
|
console.print(q2)
|
||||||
selected_dir = select(
|
selected_dir = select(list_ink_colors(rows, selected_set))
|
||||||
[
|
|
||||||
Path(path).stem
|
|
||||||
for path in list(path_df[path_df["set_name"] == selected_set]["dir"])
|
|
||||||
]
|
|
||||||
)
|
|
||||||
console.print(f"Selected: {selected_dir}")
|
console.print(f"Selected: {selected_dir}")
|
||||||
|
|
||||||
row = path_df[
|
if args.root:
|
||||||
(path_df["set_name"] == selected_set)
|
for r in rows:
|
||||||
& (path_df["dir"].str.endswith(selected_dir))
|
if r["set_name"] == selected_set:
|
||||||
].iloc[0]
|
r["dir"] = str(Path(args.root) / r["rel_dir"])
|
||||||
path_ = Path(row["dir"])
|
|
||||||
pattern = row["pattern"]
|
|
||||||
search_pattern = pattern.replace("[SERIAL]", "*")
|
|
||||||
files = [str(x) for x in path_.glob(search_pattern) if x.is_file()]
|
|
||||||
if not files:
|
|
||||||
console.print(f"[red]No workbooks matching {search_pattern!r} in {path_}[/red]")
|
|
||||||
return 1
|
|
||||||
|
|
||||||
batch_serial = prompt(q3, target_type=str)
|
batch_serial = prompt(q3, target_type=str)
|
||||||
ref_workbook_name, new_workbook_name = get_workbook_names(
|
result = create_datasheet(
|
||||||
files, batch_serial, path_, pattern
|
selected_set=selected_set,
|
||||||
|
selected_dir=selected_dir,
|
||||||
|
batch_serial=batch_serial,
|
||||||
|
backend=backend,
|
||||||
|
rows=rows,
|
||||||
|
addin_paths=addin_paths,
|
||||||
|
config=config,
|
||||||
)
|
)
|
||||||
console.print(f"Selected: {Path(ref_workbook_name).stem}")
|
|
||||||
console.print(f"Backend: {backend}")
|
|
||||||
|
|
||||||
if new_workbook_name.is_file():
|
if result.template is not None:
|
||||||
console.print(f"[yellow]Destination already exists, skipping: {new_workbook_name}[/yellow]")
|
console.print(f"Selected: {result.template.stem}")
|
||||||
|
if result.backend is not None:
|
||||||
|
console.print(f"Backend: {result.backend}")
|
||||||
|
|
||||||
|
if result.skipped:
|
||||||
|
console.print(f"[yellow]{result.message}[/yellow]")
|
||||||
return 0
|
return 0
|
||||||
|
if not result.ok:
|
||||||
|
console.print(f"[red]{result.message}[/red]")
|
||||||
|
return 1
|
||||||
|
|
||||||
cells_to_clear = row["cells_to_clear"]
|
console.print(f"[green]{result.message}[/green]")
|
||||||
notes_cell = row["notes_cell"]
|
|
||||||
serial_cell = row["serial_cell"]
|
|
||||||
|
|
||||||
if backend == "com":
|
|
||||||
from xlsx_clean.com_backend import clean_workbook_com
|
|
||||||
|
|
||||||
with tempfile.TemporaryDirectory(prefix="xlsx_clean_") as tmp:
|
|
||||||
temp_workbook = Path(tmp) / "temp_workbook.xlsx"
|
|
||||||
shutil.copyfile(ref_workbook_name, temp_workbook)
|
|
||||||
clean_workbook_com(
|
|
||||||
source=temp_workbook,
|
|
||||||
destination=new_workbook_name,
|
|
||||||
cells_to_clear=cells_to_clear,
|
|
||||||
notes_cell=notes_cell,
|
|
||||||
serial_cell=serial_cell,
|
|
||||||
batch_serial=batch_serial,
|
|
||||||
addin_paths=addin_paths,
|
|
||||||
notes_value=NEW_VALUE,
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
from xlsx_clean.ooxml_backend import clean_workbook_ooxml
|
|
||||||
|
|
||||||
clean_workbook_ooxml(
|
|
||||||
source=ref_workbook_name,
|
|
||||||
destination=new_workbook_name,
|
|
||||||
cells_to_clear=cells_to_clear,
|
|
||||||
notes_cell=notes_cell,
|
|
||||||
serial_cell=serial_cell,
|
|
||||||
batch_serial=batch_serial,
|
|
||||||
notes_value=NEW_VALUE,
|
|
||||||
)
|
|
||||||
|
|
||||||
console.print(f"[green]Wrote {new_workbook_name}[/green]")
|
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,108 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import logging
|
||||||
|
import shutil
|
||||||
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
# Excel xlMaximized — avoid win32.constants when gen_py early-binding cache is corrupt.
|
||||||
|
_XL_MAXIMIZED = -4137
|
||||||
|
|
||||||
|
_log = logging.getLogger("xlsx_clean.create")
|
||||||
|
|
||||||
|
|
||||||
|
def _is_gen_py_cache_error(exc: BaseException) -> bool:
|
||||||
|
"""True for the known corrupt gen_py AttributeError (CLSIDTo*Map missing)."""
|
||||||
|
if not isinstance(exc, AttributeError):
|
||||||
|
return False
|
||||||
|
msg = str(exc)
|
||||||
|
return "CLSIDToClassMap" in msg or "CLSIDToPackageMap" in msg
|
||||||
|
|
||||||
|
|
||||||
|
def _clear_gen_py_cache() -> Path | None:
|
||||||
|
"""Remove win32com's generated typelib cache and drop it from sys.modules."""
|
||||||
|
import win32com
|
||||||
|
|
||||||
|
gen_path = Path(win32com.__gen_path__)
|
||||||
|
for name in [m for m in sys.modules if m.startswith("win32com.gen_py")]:
|
||||||
|
del sys.modules[name]
|
||||||
|
if gen_path.is_dir():
|
||||||
|
shutil.rmtree(gen_path, ignore_errors=True)
|
||||||
|
return gen_path
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _excel_application():
|
||||||
|
"""Return Excel.Application, recovering from a corrupt win32com gen_py cache.
|
||||||
|
|
||||||
|
``gencache.EnsureDispatch`` writes early-binding wrappers under ``%TEMP%\\gen_py``.
|
||||||
|
Interrupted or partial writes leave modules without ``CLSIDToClassMap`` /
|
||||||
|
``CLSIDToPackageMap``; deleting that folder and retrying fixes it (same as the
|
||||||
|
manual workaround). Falls back to late-bound ``Dispatch`` if rebuild still fails.
|
||||||
|
"""
|
||||||
|
import win32com.client as win32
|
||||||
|
|
||||||
|
try:
|
||||||
|
return win32.gencache.EnsureDispatch("Excel.Application")
|
||||||
|
except AttributeError as exc:
|
||||||
|
if not _is_gen_py_cache_error(exc):
|
||||||
|
raise
|
||||||
|
cleared = _clear_gen_py_cache()
|
||||||
|
_log.warning(
|
||||||
|
"Corrupt win32com gen_py cache (%s); cleared %s and retrying",
|
||||||
|
exc,
|
||||||
|
cleared or "(missing)",
|
||||||
|
)
|
||||||
|
try:
|
||||||
|
return win32.gencache.EnsureDispatch("Excel.Application")
|
||||||
|
except AttributeError as retry_exc:
|
||||||
|
if not _is_gen_py_cache_error(retry_exc):
|
||||||
|
raise
|
||||||
|
_log.warning(
|
||||||
|
"EnsureDispatch still failing after cache clear (%s); using late-bound Dispatch",
|
||||||
|
retry_exc,
|
||||||
|
)
|
||||||
|
return win32.Dispatch("Excel.Application")
|
||||||
|
|
||||||
|
|
||||||
|
def _bring_excel_to_front(excel, workbook) -> None:
|
||||||
|
"""Maximize and force Excel ahead of other windows (e.g. NiceGUI)."""
|
||||||
|
import win32con
|
||||||
|
import win32gui
|
||||||
|
|
||||||
|
excel.Visible = True
|
||||||
|
excel.WindowState = _XL_MAXIMIZED
|
||||||
|
try:
|
||||||
|
workbook.Activate()
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
|
hwnd = int(excel.Hwnd)
|
||||||
|
win32gui.ShowWindow(hwnd, win32con.SW_RESTORE)
|
||||||
|
win32gui.ShowWindow(hwnd, win32con.SW_MAXIMIZE)
|
||||||
|
# Allow SetForegroundWindow to succeed when another app has focus.
|
||||||
|
try:
|
||||||
|
import win32api
|
||||||
|
import win32process
|
||||||
|
|
||||||
|
fg = win32gui.GetForegroundWindow()
|
||||||
|
fg_tid, _ = win32process.GetWindowThreadProcessId(fg)
|
||||||
|
our_tid = win32api.GetCurrentThreadId()
|
||||||
|
if fg_tid != our_tid:
|
||||||
|
win32process.AttachThreadInput(our_tid, fg_tid, True)
|
||||||
|
try:
|
||||||
|
win32gui.SetForegroundWindow(hwnd)
|
||||||
|
finally:
|
||||||
|
win32process.AttachThreadInput(our_tid, fg_tid, False)
|
||||||
|
else:
|
||||||
|
win32gui.SetForegroundWindow(hwnd)
|
||||||
|
except Exception:
|
||||||
|
win32gui.SetForegroundWindow(hwnd)
|
||||||
|
except Exception:
|
||||||
|
# Focus stealing can fail under some Windows policies; create still succeeded.
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def clean_workbook_com(
|
def clean_workbook_com(
|
||||||
source: Path | str,
|
source: Path | str,
|
||||||
@@ -18,16 +118,12 @@ def clean_workbook_com(
|
|||||||
maximize: bool = True,
|
maximize: bool = True,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Clear/set cells via Excel COM, SaveAs destination, leave Excel open."""
|
"""Clear/set cells via Excel COM, SaveAs destination, leave Excel open."""
|
||||||
# Lazy import so Linux never loads pywin32.
|
# Lazy import so Linux never loads pywin32 (only needed if callers import helpers).
|
||||||
import win32com.client as win32
|
|
||||||
|
|
||||||
source = Path(source)
|
source = Path(source)
|
||||||
destination = Path(destination)
|
destination = Path(destination)
|
||||||
destination.parent.mkdir(parents=True, exist_ok=True)
|
destination.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
# AttributeError: ... has no attribute 'CLSIDToClassMap'
|
excel = _excel_application()
|
||||||
# https://stackoverflow.com/questions/52889704
|
|
||||||
excel = win32.gencache.EnsureDispatch("Excel.Application")
|
|
||||||
excel.Visible = visible
|
excel.Visible = visible
|
||||||
|
|
||||||
workbook = excel.Workbooks.Open(str(source.resolve()))
|
workbook = excel.Workbooks.Open(str(source.resolve()))
|
||||||
@@ -60,5 +156,5 @@ def clean_workbook_com(
|
|||||||
worksheet.Range(a1).Value = batch_serial
|
worksheet.Range(a1).Value = batch_serial
|
||||||
|
|
||||||
workbook.SaveAs(str(destination.resolve()))
|
workbook.SaveAs(str(destination.resolve()))
|
||||||
if maximize:
|
if maximize or visible:
|
||||||
excel.WindowState = win32.constants.xlMaximized
|
_bring_excel_to_front(excel, workbook)
|
||||||
|
|||||||
316
src/xlsx_clean/core.py
Normal file
316
src/xlsx_clean/core.py
Normal file
@@ -0,0 +1,316 @@
|
|||||||
|
"""Core business logic for xlsx_clean."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import csv
|
||||||
|
import shutil
|
||||||
|
import tempfile
|
||||||
|
from dataclasses import dataclass
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import tomllib
|
||||||
|
|
||||||
|
from xlsx_clean.app_logging import get_logger
|
||||||
|
from xlsx_clean.paths import (
|
||||||
|
default_config_path,
|
||||||
|
package_file,
|
||||||
|
resolve_backend,
|
||||||
|
)
|
||||||
|
|
||||||
|
DEFAULT_CONFIG_CONTENT = """\
|
||||||
|
# Configuration for xlsx_clean
|
||||||
|
|
||||||
|
# backend options:
|
||||||
|
# - "com": Use Microsoft Excel COM (Windows only, keeps Excel visible)
|
||||||
|
# - "ooxml": Surgical zip edit (Cross-platform, very fast, preserves non-worksheet data)
|
||||||
|
backend = "com"
|
||||||
|
|
||||||
|
[sets]
|
||||||
|
"Kimia Razi" = "D:\\\\OpenCloud\\\\Kimia Razi"
|
||||||
|
"inco" = "D:\\\\OpenCloud\\\\inco"
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
NEW_VALUE = ""
|
||||||
|
YEAR_TOKEN = "[YEAR]"
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass(frozen=True)
|
||||||
|
class CreateResult:
|
||||||
|
ok: bool
|
||||||
|
message: str
|
||||||
|
template: Path | None = None
|
||||||
|
destination: Path | None = None
|
||||||
|
backend: str | None = None
|
||||||
|
skipped: bool = False
|
||||||
|
|
||||||
|
|
||||||
|
def find_last_workbook(files: list[str]) -> str:
|
||||||
|
return sorted(files)[-1]
|
||||||
|
|
||||||
|
|
||||||
|
def _split_year_placeholder(dir_with_placeholder: Path) -> tuple[Path, tuple[str, ...]] | None:
|
||||||
|
parts = dir_with_placeholder.parts
|
||||||
|
if YEAR_TOKEN not in parts:
|
||||||
|
return None
|
||||||
|
idx = parts.index(YEAR_TOKEN)
|
||||||
|
return Path(*parts[:idx]), parts[idx + 1 :]
|
||||||
|
|
||||||
|
|
||||||
|
def _digit_year_dirs(base: Path) -> list[Path]:
|
||||||
|
if not base.is_dir():
|
||||||
|
return []
|
||||||
|
return [c for c in base.iterdir() if c.is_dir() and c.name.isdigit()]
|
||||||
|
|
||||||
|
|
||||||
|
def resolve_year_dir(dir_with_placeholder: Path, pattern: str) -> Path:
|
||||||
|
"""Largest digit year dir that has matching template sheets for this ink."""
|
||||||
|
split = _split_year_placeholder(dir_with_placeholder)
|
||||||
|
if split is None:
|
||||||
|
return dir_with_placeholder
|
||||||
|
base, suffix = split
|
||||||
|
search_pattern = pattern.replace("[SERIAL]", "*")
|
||||||
|
years: list[int] = []
|
||||||
|
for child in _digit_year_dirs(base):
|
||||||
|
ink_dir = child.joinpath(*suffix) if suffix else child
|
||||||
|
if any(p.is_file() for p in ink_dir.glob(search_pattern)):
|
||||||
|
years.append(int(child.name))
|
||||||
|
if not years:
|
||||||
|
raise FileNotFoundError(
|
||||||
|
f"No year directory under {base} with workbooks matching {search_pattern!r}"
|
||||||
|
)
|
||||||
|
resolved = base / str(max(years))
|
||||||
|
return resolved.joinpath(*suffix) if suffix else resolved
|
||||||
|
|
||||||
|
|
||||||
|
def resolve_write_year_dir(dir_with_placeholder: Path) -> Path:
|
||||||
|
"""Largest digit year dir under the QC parent (existence only, no sheet check)."""
|
||||||
|
split = _split_year_placeholder(dir_with_placeholder)
|
||||||
|
if split is None:
|
||||||
|
return dir_with_placeholder
|
||||||
|
base, suffix = split
|
||||||
|
years = [int(c.name) for c in _digit_year_dirs(base)]
|
||||||
|
if not years:
|
||||||
|
raise FileNotFoundError(f"No year directory under {base}")
|
||||||
|
resolved = base / str(max(years))
|
||||||
|
return resolved.joinpath(*suffix) if suffix else resolved
|
||||||
|
|
||||||
|
|
||||||
|
def get_workbook_names(
|
||||||
|
files: list[str],
|
||||||
|
batch_serial: str,
|
||||||
|
dest_dir: Path,
|
||||||
|
pattern: str,
|
||||||
|
) -> tuple[str, Path]:
|
||||||
|
last_workbook = find_last_workbook(files)
|
||||||
|
return last_workbook, dest_dir / pattern.replace(
|
||||||
|
"[SERIAL]", batch_serial.split("/")[0]
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def load_config() -> tuple[list[str], list[dict], dict]:
|
||||||
|
config_path = default_config_path()
|
||||||
|
if not config_path.exists():
|
||||||
|
config_path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
config_path.write_text(DEFAULT_CONFIG_CONTENT, encoding="utf-8")
|
||||||
|
|
||||||
|
with open(config_path, "rb") as f:
|
||||||
|
config = tomllib.load(f)
|
||||||
|
|
||||||
|
strings_path = package_file("strings.txt")
|
||||||
|
with open(strings_path, encoding="utf-8") as f:
|
||||||
|
content = [line.strip() for line in f.readlines()]
|
||||||
|
|
||||||
|
csv_path = package_file("file_data.csv")
|
||||||
|
rows = []
|
||||||
|
set_roots = config.get("sets", {})
|
||||||
|
with open(csv_path, encoding="utf-8") as f:
|
||||||
|
reader = csv.DictReader(f)
|
||||||
|
for row in reader:
|
||||||
|
set_name = row["set_name"]
|
||||||
|
rel_dir = row["dir"].replace("\\", "/")
|
||||||
|
row["rel_dir"] = rel_dir
|
||||||
|
root_str = set_roots.get(set_name, "")
|
||||||
|
if root_str:
|
||||||
|
row["dir"] = str(Path(root_str) / rel_dir)
|
||||||
|
else:
|
||||||
|
row["dir"] = str(Path(rel_dir))
|
||||||
|
rows.append(row)
|
||||||
|
|
||||||
|
return content, rows, config
|
||||||
|
|
||||||
|
|
||||||
|
def list_sets(rows: list[dict]) -> list[str]:
|
||||||
|
return list(dict.fromkeys(r["set_name"] for r in rows))
|
||||||
|
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
|
def _sort_key(name: str):
|
||||||
|
match = re.search(r'\d+', name)
|
||||||
|
num = int(match.group()) if match else 0
|
||||||
|
return (num, name)
|
||||||
|
|
||||||
|
def list_ink_colors(rows: list[dict], selected_set: str) -> list[str]:
|
||||||
|
inks = (Path(r["dir"]).stem for r in rows if r["set_name"] == selected_set)
|
||||||
|
return sorted(inks, key=_sort_key)
|
||||||
|
|
||||||
|
|
||||||
|
def create_datasheet(
|
||||||
|
selected_set: str,
|
||||||
|
selected_dir: str,
|
||||||
|
batch_serial: str,
|
||||||
|
backend: str | None = None,
|
||||||
|
rows: list[dict] | None = None,
|
||||||
|
addin_paths: list[str] | None = None,
|
||||||
|
config: dict | None = None,
|
||||||
|
) -> CreateResult:
|
||||||
|
log = get_logger()
|
||||||
|
ctx = f"set={selected_set!r} ink={selected_dir!r} serial={batch_serial!r}"
|
||||||
|
|
||||||
|
if not selected_set:
|
||||||
|
message = "Select a set."
|
||||||
|
log.error("Create failed: %s (%s)", message, ctx)
|
||||||
|
return CreateResult(ok=False, message=message)
|
||||||
|
if not selected_dir:
|
||||||
|
message = "Select an ink color."
|
||||||
|
log.error("Create failed: %s (%s)", message, ctx)
|
||||||
|
return CreateResult(ok=False, message=message)
|
||||||
|
if not batch_serial or not str(batch_serial).strip():
|
||||||
|
message = "Enter a serial."
|
||||||
|
log.error("Create failed: %s (%s)", message, ctx)
|
||||||
|
return CreateResult(ok=False, message=message)
|
||||||
|
|
||||||
|
batch_serial = str(batch_serial).strip()
|
||||||
|
ctx = f"set={selected_set!r} ink={selected_dir!r} serial={batch_serial!r}"
|
||||||
|
if config is None:
|
||||||
|
content, loaded_rows, config = load_config()
|
||||||
|
if rows is None:
|
||||||
|
rows = loaded_rows
|
||||||
|
if addin_paths is None:
|
||||||
|
addin_paths = content[3:5] if len(content) >= 5 else []
|
||||||
|
|
||||||
|
try:
|
||||||
|
resolved_backend = resolve_backend(backend, config.get("backend"))
|
||||||
|
except (ValueError, RuntimeError) as exc:
|
||||||
|
log.error("Create failed: %s (%s)", exc, ctx)
|
||||||
|
return CreateResult(ok=False, message=str(exc))
|
||||||
|
|
||||||
|
ctx = f"{ctx} backend={resolved_backend}"
|
||||||
|
|
||||||
|
matches = [r for r in rows if r["set_name"] == selected_set and r["dir"].endswith(selected_dir)]
|
||||||
|
if not matches:
|
||||||
|
message = f"No config row for set={selected_set!r} ink={selected_dir!r}."
|
||||||
|
log.error("Create failed: %s (%s)", message, ctx)
|
||||||
|
return CreateResult(ok=False, message=message)
|
||||||
|
|
||||||
|
row = matches[0]
|
||||||
|
pattern = row["pattern"]
|
||||||
|
placeholder_dir = Path(row["dir"])
|
||||||
|
try:
|
||||||
|
read_dir = resolve_year_dir(placeholder_dir, pattern)
|
||||||
|
write_dir = resolve_write_year_dir(placeholder_dir)
|
||||||
|
except FileNotFoundError as exc:
|
||||||
|
message = str(exc)
|
||||||
|
log.error("Create failed: %s (%s)", message, ctx)
|
||||||
|
return CreateResult(ok=False, message=message, backend=resolved_backend)
|
||||||
|
search_pattern = pattern.replace("[SERIAL]", "*")
|
||||||
|
files = [str(x) for x in read_dir.glob(search_pattern) if x.is_file()]
|
||||||
|
|
||||||
|
if not files:
|
||||||
|
message = f"No workbooks matching {search_pattern!r} in {read_dir}"
|
||||||
|
log.error("Create failed: %s (%s)", message, ctx)
|
||||||
|
return CreateResult(
|
||||||
|
ok=False,
|
||||||
|
message=message,
|
||||||
|
backend=resolved_backend,
|
||||||
|
)
|
||||||
|
|
||||||
|
ref_workbook_name, new_workbook_name = get_workbook_names(
|
||||||
|
files, batch_serial, write_dir, pattern
|
||||||
|
)
|
||||||
|
template = Path(ref_workbook_name)
|
||||||
|
|
||||||
|
if new_workbook_name.is_file():
|
||||||
|
message = f"Destination already exists, skipped: {new_workbook_name}"
|
||||||
|
log.info(
|
||||||
|
"Create skipped: %s (template=%s destination=%s %s)",
|
||||||
|
message,
|
||||||
|
template,
|
||||||
|
new_workbook_name,
|
||||||
|
ctx,
|
||||||
|
)
|
||||||
|
return CreateResult(
|
||||||
|
ok=True,
|
||||||
|
skipped=True,
|
||||||
|
message=message,
|
||||||
|
template=template,
|
||||||
|
destination=new_workbook_name,
|
||||||
|
backend=resolved_backend,
|
||||||
|
)
|
||||||
|
|
||||||
|
cells_to_clear = row["cells_to_clear"]
|
||||||
|
notes_cell = row["notes_cell"]
|
||||||
|
serial_cell = row["serial_cell"]
|
||||||
|
|
||||||
|
try:
|
||||||
|
if resolved_backend == "com":
|
||||||
|
from xlsx_clean.com_backend import clean_workbook_com
|
||||||
|
|
||||||
|
with tempfile.TemporaryDirectory(prefix="xlsx_clean_") as tmp:
|
||||||
|
temp_workbook = Path(tmp) / "temp_workbook.xlsx"
|
||||||
|
shutil.copyfile(ref_workbook_name, temp_workbook)
|
||||||
|
clean_workbook_com(
|
||||||
|
source=temp_workbook,
|
||||||
|
destination=new_workbook_name,
|
||||||
|
cells_to_clear=cells_to_clear,
|
||||||
|
notes_cell=notes_cell,
|
||||||
|
serial_cell=serial_cell,
|
||||||
|
batch_serial=batch_serial,
|
||||||
|
addin_paths=addin_paths or [],
|
||||||
|
notes_value=NEW_VALUE,
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
from xlsx_clean.ooxml_backend import clean_workbook_ooxml
|
||||||
|
|
||||||
|
clean_workbook_ooxml(
|
||||||
|
source=ref_workbook_name,
|
||||||
|
destination=new_workbook_name,
|
||||||
|
cells_to_clear=cells_to_clear,
|
||||||
|
notes_cell=notes_cell,
|
||||||
|
serial_cell=serial_cell,
|
||||||
|
batch_serial=batch_serial,
|
||||||
|
notes_value=NEW_VALUE,
|
||||||
|
)
|
||||||
|
except Exception as exc: # noqa: BLE001 - surface to CLI/UI
|
||||||
|
message = f"Failed to create workbook: {exc}"
|
||||||
|
log.exception(
|
||||||
|
"Create failed: %s (template=%s destination=%s %s)",
|
||||||
|
message,
|
||||||
|
template,
|
||||||
|
new_workbook_name,
|
||||||
|
ctx,
|
||||||
|
)
|
||||||
|
return CreateResult(
|
||||||
|
ok=False,
|
||||||
|
message=message,
|
||||||
|
template=template,
|
||||||
|
destination=new_workbook_name,
|
||||||
|
backend=resolved_backend,
|
||||||
|
)
|
||||||
|
|
||||||
|
message = f"Wrote {new_workbook_name}"
|
||||||
|
log.info(
|
||||||
|
"Create succeeded: %s (template=%s destination=%s %s)",
|
||||||
|
message,
|
||||||
|
template,
|
||||||
|
new_workbook_name,
|
||||||
|
ctx,
|
||||||
|
)
|
||||||
|
return CreateResult(
|
||||||
|
ok=True,
|
||||||
|
message=message,
|
||||||
|
template=template,
|
||||||
|
destination=new_workbook_name,
|
||||||
|
backend=resolved_backend,
|
||||||
|
)
|
||||||
@@ -1,25 +1,25 @@
|
|||||||
dir,pattern,set_name,cells_to_clear,serial_cell,notes_cell
|
dir,pattern,set_name,cells_to_clear,serial_cell,notes_cell
|
||||||
"D:\OpenCloud\Kimia Razi\Production\QC Datasheet\1403\KRCY1100T Blue","KRCY1100T Blue [SERIAL].xlsx","Kimia Razi","Batch!F2:F3,Batch!E12:G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11","Batch!D3","Batch!D25"
|
Production\QC Datasheet\[YEAR]\KRCY1100T Blue,KRCY1100T Blue [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!E12:G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11",Batch!D3,Batch!D25
|
||||||
"D:\OpenCloud\Kimia Razi\Production\QC Datasheet\1403\KRBK1300T Black","KRBK1300T Black [SERIAL].xlsx","Kimia Razi","Batch!F2:F3,Batch!E12:G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11","Batch!D3","Batch!D25"
|
Production\QC Datasheet\[YEAR]\KRBK1300T Black,KRBK1300T Black [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!E12:G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11",Batch!D3,Batch!D25
|
||||||
"D:\OpenCloud\Kimia Razi\Production\QC Datasheet\1403\KRBK1314T Black","KRBK1314T Black [SERIAL].xlsx","Kimia Razi","Batch!F2:F3,Batch!G12:I12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11","Batch!D3","Batch!D25"
|
Production\QC Datasheet\[YEAR]\KRBK1314T Black,KRBK1314T Black [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!G12:I12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11",Batch!D3,Batch!D25
|
||||||
"D:\OpenCloud\Kimia Razi\Production\QC Datasheet\1403\KRBR1200T Brown","KRBR1200T Brown [SERIAL].xlsx","Kimia Razi","Batch!F2:F3,Batch!E12:G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11","Batch!D3","Batch!D25"
|
Production\QC Datasheet\[YEAR]\KRBR1200T Brown,KRBR1200T Brown [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!E12:G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11",Batch!D3,Batch!D25
|
||||||
"D:\OpenCloud\Kimia Razi\Production\QC Datasheet\1403\KRBR1201T Brown","KRBR1201T Brown [SERIAL].xlsx","Kimia Razi","Batch!F2:F3,Batch!E12:G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11","Batch!D3","Batch!D25"
|
Production\QC Datasheet\[YEAR]\KRBR1201T Brown,KRBR1201T Brown [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!E12:G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11",Batch!D3,Batch!D25
|
||||||
"D:\OpenCloud\Kimia Razi\Production\QC Datasheet\1403\KRYL1400T Yellow","KRYL1400T Yellow [SERIAL].xlsx","Kimia Razi","Batch!F2:F3,Batch!G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11","Batch!D3","Batch!D25"
|
Production\QC Datasheet\[YEAR]\KRYL1400T Yellow,KRYL1400T Yellow [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11",Batch!D3,Batch!D25
|
||||||
"D:\OpenCloud\Kimia Razi\Production\QC Datasheet\1403\KRYL1401T Yellow","KRYL1401T Yellow [SERIAL].xlsx","Kimia Razi","Batch!F2:F3,Batch!E12:G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11","Batch!D3","Batch!D25"
|
Production\QC Datasheet\[YEAR]\KRYL1401T Yellow,KRYL1401T Yellow [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!E12:G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11",Batch!D3,Batch!D25
|
||||||
"D:\OpenCloud\Kimia Razi\Production\QC Datasheet\1403\KRBG1600T Beige","KRBG1600T Beige [SERIAL].xlsx","Kimia Razi","Batch!F2:F3,Batch!G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11","Batch!D3","Batch!D25"
|
Production\QC Datasheet\[YEAR]\KRBG1600T Beige,KRBG1600T Beige [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11",Batch!D3,Batch!D25
|
||||||
"D:\OpenCloud\Kimia Razi\Production\QC Datasheet\1403\KRPK1500T Pink","KRPK1500T Pink [SERIAL].xlsx","Kimia Razi","Batch!F2:F3,Batch!G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11","Batch!D3","Batch!D25"
|
Production\QC Datasheet\[YEAR]\KRPK1500T Pink,KRPK1500T Pink [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11",Batch!D3,Batch!D25
|
||||||
"D:\OpenCloud\Kimia Razi\Production\QC Datasheet\1403\KRHN1700T Honey","KRHN1700T Honey [SERIAL].xlsx","Kimia Razi","Batch!F2:F3,Batch!G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11","Batch!D3","Batch!D25"
|
Production\QC Datasheet\[YEAR]\KRHN1700T Honey,KRHN1700T Honey [SERIAL].xlsx,Kimia Razi,"Batch!F2:F3,Batch!G12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11",Batch!D3,Batch!D25
|
||||||
"D:\OpenCloud\inco\Quality control data sheet\2025\ICJ108 Beige","ICJ_108 op. [SERIAL].xlsx","inco","Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11","Batch!D3","Batch!D25"
|
Quality control data sheet\[YEAR]\ICJ108 Beige,ICJ_108 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
|
||||||
"D:\OpenCloud\inco\Quality control data sheet\2026\ICJ610 Black","ICJ_610 op. [SERIAL].xlsx","inco","Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11","Batch!D3","Batch!D25"
|
Quality control data sheet\[YEAR]\ICJ610 Black,ICJ_610 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
|
||||||
"D:\OpenCloud\inco\Quality control data sheet\2026\ICJ308 Blue","ICJ_308 op. [SERIAL].xlsx","inco","Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11","Batch!D3","Batch!D25"
|
Quality control data sheet\[YEAR]\ICJ308 Blue,ICJ_308 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
|
||||||
"D:\OpenCloud\inco\Quality control data sheet\2026\ICJEH680 Black","ICJ_EH680 op. [SERIAL].xlsx","inco","Batch!F2:F3,Batch!I12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11","Batch!D3","Batch!D25"
|
Quality control data sheet\[YEAR]\ICJEH680 Black,ICJ_EH680 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!I12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
|
||||||
"D:\OpenCloud\inco\Quality control data sheet\2026\ICJEH630 Black","ICJ_EH630 op. [SERIAL].xlsx","inco","Batch!F2:F3,Batch!I12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11","Batch!D3","Batch!D25"
|
Quality control data sheet\[YEAR]\ICJEH630 Black,ICJ_EH630 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!I12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
|
||||||
"D:\OpenCloud\inco\Quality control data sheet\2025\ICJEH600 Black","ICJ_EH600 op. [SERIAL].xlsx","inco","Batch!F2:F3,Batch!I12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11","Batch!D3","Batch!D25"
|
Quality control data sheet\[YEAR]\ICJEH600 Black,ICJ_EH600 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!I12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
|
||||||
"D:\OpenCloud\inco\Quality control data sheet\2025\ICJ407 Brown","ICJ_407 op. [SERIAL].xlsx","inco","Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11","Batch!D3","Batch!D24"
|
Quality control data sheet\[YEAR]\ICJ407 Brown,ICJ_407 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D24
|
||||||
"D:\OpenCloud\inco\Quality control data sheet\2025\ICJ408 Brown","ICJ_408 op. [SERIAL].xlsx","inco","Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11","Batch!D3","Batch!D24"
|
Quality control data sheet\[YEAR]\ICJ408 Brown,ICJ_408 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D24
|
||||||
"D:\OpenCloud\inco\Quality control data sheet\2026\ICJ435 Beige","ICJ_435 op. [SERIAL].xlsx","inco","Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11","Batch!D3","Batch!D24"
|
Quality control data sheet\[YEAR]\ICJ435 Beige,ICJ_435 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D24
|
||||||
"D:\OpenCloud\inco\Quality control data sheet\2025\ICJ107 Yellow","ICJ_107 yellow op. [SERIAL].xlsx","inco","Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11","Batch!D3","Batch!D25"
|
Quality control data sheet\[YEAR]\ICJ107 Yellow,ICJ_107 yellow op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
|
||||||
"D:\OpenCloud\inco\Quality control data sheet\2025\ICJ703 Pink","ICJ_703 op. [SERIAL].xlsx","inco","Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11","Batch!D3","Batch!D25"
|
Quality control data sheet\[YEAR]\ICJ703 Pink,ICJ_703 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
|
||||||
"D:\OpenCloud\inco\Quality control data sheet\2024\ICJ309 Cyan","ICJ_309 cyan op. [SERIAL].xlsx","inco","Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11","Batch!D3","Batch!D25"
|
Quality control data sheet\[YEAR]\ICJ309 Cyan,ICJ_309 cyan op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D19:J22,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
|
||||||
"D:\OpenCloud\inco\Quality control data sheet\2025\ICJ109 Golden Yellow","ICJ_109 op. [SERIAL].xlsx","inco","Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11","Batch!D3","Batch!D25"
|
Quality control data sheet\[YEAR]\ICJ109 Golden Yellow,ICJ_109 op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!E12:F12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
|
||||||
"D:\OpenCloud\inco\Quality control data sheet\2026\ICJ152 Yellow","ICJ_152 yellow op. [SERIAL].xlsx","inco","Batch!F2:F3,Batch!I12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11","Batch!D3","Batch!D25"
|
Quality control data sheet\[YEAR]\ICJ152 Yellow,ICJ_152 yellow op. [SERIAL].xlsx,inco,"Batch!F2:F3,Batch!I12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D20:J23,'KW'!C3:C4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11,Mix!B3:D11",Batch!D3,Batch!D25
|
||||||
|
|||||||
|
BIN
src/xlsx_clean/fonts/Inter-Bold.ttf
Normal file
BIN
src/xlsx_clean/fonts/Inter-Bold.ttf
Normal file
Binary file not shown.
BIN
src/xlsx_clean/fonts/Inter-Regular.ttf
Normal file
BIN
src/xlsx_clean/fonts/Inter-Regular.ttf
Normal file
Binary file not shown.
139
src/xlsx_clean/gui_app.py
Normal file
139
src/xlsx_clean/gui_app.py
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
"""PyWebView desktop GUI for New QC Sheet."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import argparse
|
||||||
|
from importlib.metadata import PackageNotFoundError, version as package_version
|
||||||
|
|
||||||
|
import webview
|
||||||
|
|
||||||
|
from xlsx_clean.core import create_datasheet, list_ink_colors, list_sets, load_config
|
||||||
|
from xlsx_clean.app_logging import get_logger
|
||||||
|
from xlsx_clean.paths import package_file
|
||||||
|
|
||||||
|
try:
|
||||||
|
_VERSION = package_version("xlsx-clean")
|
||||||
|
except PackageNotFoundError:
|
||||||
|
_VERSION = "dev"
|
||||||
|
|
||||||
|
|
||||||
|
class Api:
|
||||||
|
"""Python functions exposed to JavaScript via ``window.pywebview.api``."""
|
||||||
|
|
||||||
|
def __init__(self) -> None:
|
||||||
|
self.rows: list[dict] = []
|
||||||
|
self.addin_paths: list[str] = []
|
||||||
|
self.config: dict = {}
|
||||||
|
self._initial_data: dict | None = None
|
||||||
|
self._initialization_error: Exception | None = None
|
||||||
|
|
||||||
|
def initialize(self) -> None:
|
||||||
|
"""Load configuration before the local frontend is opened."""
|
||||||
|
if self._initial_data is not None or self._initialization_error is not None:
|
||||||
|
return
|
||||||
|
try:
|
||||||
|
content, self.rows, self.config = load_config()
|
||||||
|
sets = list_sets(self.rows)
|
||||||
|
self.addin_paths = content[3:5] if len(content) >= 5 else []
|
||||||
|
self._initial_data = {
|
||||||
|
"sets": sets,
|
||||||
|
"inks": list_ink_colors(self.rows, sets[0]) if sets else [],
|
||||||
|
"labels": {
|
||||||
|
"set": content[0] if len(content) > 0 else "Select Set",
|
||||||
|
"ink": content[1] if len(content) > 1 else "Select Ink Color",
|
||||||
|
"serial": content[2] if len(content) > 2 else "Serial:",
|
||||||
|
},
|
||||||
|
"version": _VERSION,
|
||||||
|
}
|
||||||
|
except Exception as exc: # noqa: BLE001 - serialize bridge failures to JS
|
||||||
|
self._initialization_error = exc
|
||||||
|
|
||||||
|
def get_initial_data(self) -> dict:
|
||||||
|
"""Return configuration-derived values for the initial page render."""
|
||||||
|
self.initialize()
|
||||||
|
if self._initialization_error is not None:
|
||||||
|
raise self._initialization_error
|
||||||
|
assert self._initial_data is not None
|
||||||
|
return self._initial_data
|
||||||
|
|
||||||
|
def get_inks(self, selected_set: str) -> list[str]:
|
||||||
|
"""Return ink colors for a selected set."""
|
||||||
|
return list_ink_colors(self.rows, selected_set)
|
||||||
|
|
||||||
|
def create(
|
||||||
|
self, selected_set: str, selected_dir: str, batch_serial: str
|
||||||
|
) -> dict:
|
||||||
|
"""Create a datasheet and return a JSON-safe result.
|
||||||
|
|
||||||
|
Unexpected exceptions are serialized into the result contract so the
|
||||||
|
frontend always sees the same shape, regardless of platform-specific
|
||||||
|
bridge behavior.
|
||||||
|
"""
|
||||||
|
log = get_logger()
|
||||||
|
try:
|
||||||
|
result = create_datasheet(
|
||||||
|
selected_set=selected_set,
|
||||||
|
selected_dir=selected_dir,
|
||||||
|
batch_serial=batch_serial,
|
||||||
|
backend=None,
|
||||||
|
rows=self.rows,
|
||||||
|
addin_paths=self.addin_paths,
|
||||||
|
config=self.config,
|
||||||
|
)
|
||||||
|
except Exception as exc: # noqa: BLE001 - serialize bridge failures to JS
|
||||||
|
log.exception(
|
||||||
|
"Unexpected error in Api.create(set=%r, dir=%r, serial=%r)",
|
||||||
|
selected_set,
|
||||||
|
selected_dir,
|
||||||
|
batch_serial,
|
||||||
|
)
|
||||||
|
return {
|
||||||
|
"ok": False,
|
||||||
|
"skipped": False,
|
||||||
|
"message": f"Unexpected error: {exc}",
|
||||||
|
"template": None,
|
||||||
|
"destination": None,
|
||||||
|
"backend": None,
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
"ok": result.ok,
|
||||||
|
"skipped": result.skipped,
|
||||||
|
"message": result.message,
|
||||||
|
"template": str(result.template) if result.template is not None else None,
|
||||||
|
"destination": (
|
||||||
|
str(result.destination) if result.destination is not None else None
|
||||||
|
),
|
||||||
|
"backend": result.backend,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def parse_args(argv: list[str] | None = None) -> argparse.Namespace:
|
||||||
|
"""Parse GUI dimensions without changing process-global arguments."""
|
||||||
|
parser = argparse.ArgumentParser(
|
||||||
|
description="Start the New QC Sheet PyWebView interface."
|
||||||
|
)
|
||||||
|
parser.add_argument("--width", type=int, default=800, help="Window width")
|
||||||
|
parser.add_argument("--height", type=int, default=600, help="Window height")
|
||||||
|
return parser.parse_args(argv)
|
||||||
|
|
||||||
|
|
||||||
|
def main(argv: list[str] | None = None) -> None:
|
||||||
|
"""Open the native PyWebView window."""
|
||||||
|
args = parse_args(argv)
|
||||||
|
api = Api()
|
||||||
|
api.initialize()
|
||||||
|
index_html = package_file("ui/index.html")
|
||||||
|
webview.create_window(
|
||||||
|
title=f"New QC Sheet · v{_VERSION}",
|
||||||
|
url=index_html.as_uri(),
|
||||||
|
js_api=api,
|
||||||
|
width=args.width,
|
||||||
|
height=args.height,
|
||||||
|
min_size=(450, 400),
|
||||||
|
background_color="#0b0e14",
|
||||||
|
)
|
||||||
|
webview.start()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
@@ -6,54 +6,42 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
PACKAGE_DIR = Path(__file__).resolve().parent
|
|
||||||
|
|
||||||
# Historical Windows root used in file_data.csv
|
def _package_dir() -> Path:
|
||||||
DEFAULT_OPENCLOUD_ROOT = Path(r"D:\OpenCloud")
|
"""Directory containing package data (CSV/txt), including PyInstaller bundles."""
|
||||||
OPENCLOUD_MARKER = "OpenCloud"
|
if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"):
|
||||||
|
bundled = Path(sys._MEIPASS) / "xlsx_clean"
|
||||||
|
if bundled.is_dir():
|
||||||
|
return bundled
|
||||||
|
return Path(sys._MEIPASS)
|
||||||
|
return Path(__file__).resolve().parent
|
||||||
|
|
||||||
|
|
||||||
|
PACKAGE_DIR = _package_dir()
|
||||||
|
|
||||||
def package_file(name: str) -> Path:
|
def package_file(name: str) -> Path:
|
||||||
return PACKAGE_DIR / name
|
return PACKAGE_DIR / name
|
||||||
|
|
||||||
|
def default_config_path() -> Path:
|
||||||
def get_opencloud_root() -> Path:
|
"""Resolve the default location for the TOML configuration file."""
|
||||||
"""Workbook tree root from XLSX_CLEAN_ROOT, else D:\\OpenCloud on Windows."""
|
if getattr(sys, "frozen", False):
|
||||||
env = os.environ.get("XLSX_CLEAN_ROOT")
|
return Path(sys.executable).resolve().parent / "config.toml"
|
||||||
if env:
|
return Path.home() / ".xlsx-clean" / "config.toml"
|
||||||
return Path(env)
|
|
||||||
return DEFAULT_OPENCLOUD_ROOT
|
|
||||||
|
|
||||||
|
|
||||||
def remap_opencloud_path(path_str: str, root: Path | None = None) -> Path:
|
|
||||||
"""Map a CSV path under OpenCloud onto the configured root.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
D:\\OpenCloud\\inco\\... + root=/data -> /data/inco/...
|
|
||||||
Relative paths without OpenCloud are returned as-is (Path).
|
|
||||||
"""
|
|
||||||
if root is None:
|
|
||||||
root = get_opencloud_root()
|
|
||||||
|
|
||||||
normalized = path_str.replace("\\", "/")
|
|
||||||
# Case-insensitive marker search
|
|
||||||
lower = normalized.lower()
|
|
||||||
marker = f"{OPENCLOUD_MARKER.lower()}/"
|
|
||||||
idx = lower.find(marker)
|
|
||||||
if idx != -1:
|
|
||||||
rel = normalized[idx + len(marker) :]
|
|
||||||
return root / rel
|
|
||||||
|
|
||||||
# Already relative to root-style path without drive
|
|
||||||
return Path(path_str)
|
|
||||||
|
|
||||||
|
|
||||||
def default_backend() -> str:
|
def default_backend() -> str:
|
||||||
return "com" if sys.platform == "win32" else "ooxml"
|
return "com" if sys.platform == "win32" else "ooxml"
|
||||||
|
|
||||||
|
|
||||||
def resolve_backend(requested: str | None) -> str:
|
def resolve_backend(requested: str | None, config_backend: str | None = None) -> str:
|
||||||
backend = (requested or default_backend()).lower()
|
"""Resolve backend using explicitly requested, config file, or system default."""
|
||||||
|
if requested:
|
||||||
|
backend = requested.lower()
|
||||||
|
elif config_backend:
|
||||||
|
backend = config_backend.lower()
|
||||||
|
else:
|
||||||
|
backend = default_backend().lower()
|
||||||
|
|
||||||
if backend not in {"com", "ooxml"}:
|
if backend not in {"com", "ooxml"}:
|
||||||
raise ValueError(f"Unknown backend {backend!r}; use 'com' or 'ooxml'")
|
raise ValueError(f"Unknown backend {backend!r}; use 'com' or 'ooxml'")
|
||||||
if backend == "com" and sys.platform != "win32":
|
if backend == "com" and sys.platform != "win32":
|
||||||
|
|||||||
766
src/xlsx_clean/ui/index.html
Normal file
766
src/xlsx_clean/ui/index.html
Normal file
@@ -0,0 +1,766 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title>New QC Sheet</title>
|
||||||
|
<script>
|
||||||
|
try {
|
||||||
|
if (localStorage.getItem("xlsx-clean-theme") === "light") {
|
||||||
|
document.documentElement.setAttribute("data-theme", "light");
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
/* localStorage may be unavailable in some WebView embeds */
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
@font-face {
|
||||||
|
font-family: "Inter";
|
||||||
|
src: url("../fonts/Inter-Regular.ttf") format("truetype");
|
||||||
|
font-weight: 400;
|
||||||
|
font-style: normal;
|
||||||
|
font-display: swap;
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: "Inter";
|
||||||
|
src: url("../fonts/Inter-Bold.ttf") format("truetype");
|
||||||
|
font-weight: 700;
|
||||||
|
font-style: normal;
|
||||||
|
font-display: swap;
|
||||||
|
}
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--primary: #e54d5e;
|
||||||
|
--primary-hover: #c93d4e;
|
||||||
|
--accent: #6366f1;
|
||||||
|
--accent-2: #8b5cf6;
|
||||||
|
--accent-3: #a855f7;
|
||||||
|
--success: #22c55e;
|
||||||
|
--warning: #f59e0b;
|
||||||
|
--error: #ef4444;
|
||||||
|
--bg: #0b0e14;
|
||||||
|
--bg-alt: #111520;
|
||||||
|
--surface: #161b22;
|
||||||
|
--surface-2: #1c2230;
|
||||||
|
--border: rgba(255, 255, 255, 0.08);
|
||||||
|
--border-strong: rgba(255, 255, 255, 0.14);
|
||||||
|
--grid-line: rgba(255, 255, 255, 0.06);
|
||||||
|
--grid-size: 32px;
|
||||||
|
--text: #e6e6ef;
|
||||||
|
--text-muted: #8b8b9e;
|
||||||
|
--text-dim: #5a5a6e;
|
||||||
|
--grad-brand: linear-gradient(135deg, var(--primary), var(--accent-3));
|
||||||
|
--grad-soft: linear-gradient(135deg, rgba(229, 77, 94, 0.12), rgba(168, 85, 247, 0.12));
|
||||||
|
--font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
|
||||||
|
--font-mono: ui-monospace, "JetBrains Mono", "Fira Code", "SF Mono", monospace;
|
||||||
|
--radius: 14px;
|
||||||
|
--radius-sm: 9px;
|
||||||
|
--ease: cubic-bezier(0.22, 1, 0.36, 1);
|
||||||
|
--status-ready: transparent;
|
||||||
|
--status-success: rgba(34, 197, 94, 0.12);
|
||||||
|
--status-skipped: rgba(245, 158, 11, 0.12);
|
||||||
|
--status-error: rgba(239, 68, 68, 0.12);
|
||||||
|
--label-bg: rgba(11, 14, 20, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
html[data-theme="light"] {
|
||||||
|
--bg: #f9f9fb;
|
||||||
|
--bg-alt: #f0f0f5;
|
||||||
|
--surface: #ffffff;
|
||||||
|
--surface-2: #f5f5fa;
|
||||||
|
--border: rgba(0, 0, 0, 0.08);
|
||||||
|
--border-strong: rgba(0, 0, 0, 0.14);
|
||||||
|
--grid-line: rgba(0, 0, 0, 0.07);
|
||||||
|
--text: #1a1a2e;
|
||||||
|
--text-muted: #71717a;
|
||||||
|
--text-dim: #9a9aa5;
|
||||||
|
--grad-soft: linear-gradient(135deg, rgba(229, 77, 94, 0.08), rgba(168, 85, 247, 0.08));
|
||||||
|
--status-success: rgba(34, 197, 94, 0.1);
|
||||||
|
--status-skipped: rgba(245, 158, 11, 0.12);
|
||||||
|
--status-error: rgba(239, 68, 68, 0.1);
|
||||||
|
--label-bg: rgba(249, 249, 251, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
* { box-sizing: border-box; }
|
||||||
|
|
||||||
|
body {
|
||||||
|
min-height: 100vh;
|
||||||
|
margin: 0;
|
||||||
|
background: var(--bg);
|
||||||
|
color: var(--text);
|
||||||
|
font-family: var(--font-sans);
|
||||||
|
font-size: 15px;
|
||||||
|
line-height: 1.5;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
}
|
||||||
|
|
||||||
|
body::before {
|
||||||
|
content: "";
|
||||||
|
position: fixed;
|
||||||
|
inset: 0;
|
||||||
|
z-index: -1;
|
||||||
|
pointer-events: none;
|
||||||
|
background-image:
|
||||||
|
linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
|
||||||
|
linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
|
||||||
|
background-size: var(--grid-size) var(--grid-size);
|
||||||
|
}
|
||||||
|
|
||||||
|
.page {
|
||||||
|
display: flex;
|
||||||
|
min-height: 100vh;
|
||||||
|
padding: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: min(100%, 36rem);
|
||||||
|
margin: auto;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.heading-row {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-toggle {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-shrink: 0;
|
||||||
|
min-width: 52px;
|
||||||
|
height: 28px;
|
||||||
|
margin-top: 2px;
|
||||||
|
padding: 0 8px;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
background: var(--surface-2);
|
||||||
|
color: var(--text);
|
||||||
|
cursor: pointer;
|
||||||
|
font: inherit;
|
||||||
|
font-size: 0.7rem;
|
||||||
|
font-weight: 700;
|
||||||
|
letter-spacing: 0.04em;
|
||||||
|
text-transform: uppercase;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-toggle:hover {
|
||||||
|
background: var(--bg-alt);
|
||||||
|
border-color: var(--border-strong);
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-toggle:focus-visible {
|
||||||
|
outline: 2px solid var(--accent-3);
|
||||||
|
outline-offset: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.eyebrow {
|
||||||
|
margin: 0 0 8px;
|
||||||
|
color: var(--primary);
|
||||||
|
font-size: 0.75rem;
|
||||||
|
font-weight: 700;
|
||||||
|
letter-spacing: 0.08em;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
margin: 0;
|
||||||
|
color: var(--text);
|
||||||
|
font-size: 1.875rem;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1.15;
|
||||||
|
letter-spacing: -0.02em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subtitle {
|
||||||
|
margin: 8px 0 22px;
|
||||||
|
color: var(--text-muted);
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fields { display: grid; gap: 18px; }
|
||||||
|
|
||||||
|
.field {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.field-label {
|
||||||
|
z-index: 1;
|
||||||
|
margin-left: 4px;
|
||||||
|
padding: 0 4px;
|
||||||
|
background: var(--label-bg);
|
||||||
|
color: var(--primary);
|
||||||
|
font-size: 0.75rem;
|
||||||
|
line-height: 1.2;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
select, input {
|
||||||
|
width: 100%;
|
||||||
|
align-self: stretch;
|
||||||
|
min-height: 54px;
|
||||||
|
padding: 16px 12px;
|
||||||
|
border: 1px solid var(--border-strong);
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
outline: none;
|
||||||
|
background: var(--surface-2);
|
||||||
|
color: var(--text);
|
||||||
|
font: inherit;
|
||||||
|
transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
|
||||||
|
}
|
||||||
|
|
||||||
|
.combobox-input {
|
||||||
|
padding-right: 36px;
|
||||||
|
cursor: text;
|
||||||
|
}
|
||||||
|
|
||||||
|
.combobox { position: relative; }
|
||||||
|
|
||||||
|
.combobox > select {
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
|
padding: 0;
|
||||||
|
margin: -1px;
|
||||||
|
overflow: hidden;
|
||||||
|
clip: rect(0 0 0 0);
|
||||||
|
white-space: nowrap;
|
||||||
|
border: 0;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.combobox-caret {
|
||||||
|
position: absolute;
|
||||||
|
right: 12px;
|
||||||
|
bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
height: 54px;
|
||||||
|
color: var(--text-muted);
|
||||||
|
pointer-events: none;
|
||||||
|
font-size: 0.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.combobox-panel {
|
||||||
|
position: absolute;
|
||||||
|
top: calc(100% + 4px);
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 5;
|
||||||
|
max-height: 220px;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding: 4px 0;
|
||||||
|
background: var(--surface-2);
|
||||||
|
border: 1px solid var(--border-strong);
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
box-shadow: 0 12px 32px rgb(0 0 0 / 35%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.combobox-panel[hidden] { display: none; }
|
||||||
|
|
||||||
|
.combobox-option {
|
||||||
|
padding: 8px 12px;
|
||||||
|
cursor: pointer;
|
||||||
|
color: var(--text);
|
||||||
|
line-height: 1.25;
|
||||||
|
}
|
||||||
|
|
||||||
|
.combobox-option[aria-selected="true"],
|
||||||
|
.combobox-option:hover {
|
||||||
|
background: var(--grad-soft);
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.combobox-option[hidden] { display: none; }
|
||||||
|
|
||||||
|
.combobox-empty {
|
||||||
|
padding: 8px 12px;
|
||||||
|
color: var(--text-muted);
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
select:focus, input:focus,
|
||||||
|
.combobox-input:focus {
|
||||||
|
border-color: var(--accent);
|
||||||
|
box-shadow: 0 0 0 3px rgb(99 102 241 / 28%);
|
||||||
|
}
|
||||||
|
|
||||||
|
select:disabled, input:disabled,
|
||||||
|
.combobox-input:disabled {
|
||||||
|
cursor: not-allowed;
|
||||||
|
background: var(--bg-alt);
|
||||||
|
color: var(--text-dim);
|
||||||
|
}
|
||||||
|
|
||||||
|
.divider {
|
||||||
|
height: 1px;
|
||||||
|
margin: 22px 0;
|
||||||
|
background: var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
|
#create-button {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 44px;
|
||||||
|
border: 0;
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
background: var(--grad-brand);
|
||||||
|
color: #fff;
|
||||||
|
cursor: pointer;
|
||||||
|
font: inherit;
|
||||||
|
font-size: 0.875rem;
|
||||||
|
font-weight: 700;
|
||||||
|
letter-spacing: 0.04em;
|
||||||
|
text-transform: uppercase;
|
||||||
|
box-shadow: 0 8px 22px -10px var(--primary);
|
||||||
|
transition: transform 150ms var(--ease), box-shadow 150ms var(--ease), filter 150ms var(--ease);
|
||||||
|
}
|
||||||
|
|
||||||
|
#create-button:hover:not(:disabled) {
|
||||||
|
filter: brightness(1.06);
|
||||||
|
box-shadow: 0 10px 26px -8px var(--primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
#create-button:focus-visible {
|
||||||
|
outline: 2px solid var(--accent-3);
|
||||||
|
outline-offset: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#create-button:disabled { cursor: not-allowed; opacity: 0.65; }
|
||||||
|
|
||||||
|
.status {
|
||||||
|
min-height: 48px;
|
||||||
|
margin-top: 16px;
|
||||||
|
padding: 12px;
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: var(--radius-sm);
|
||||||
|
color: var(--text-muted);
|
||||||
|
font-family: var(--font-mono);
|
||||||
|
font-size: 0.8rem;
|
||||||
|
line-height: 1.45;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status::before {
|
||||||
|
content: "$ ";
|
||||||
|
color: var(--primary);
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-ready { background: var(--status-ready); }
|
||||||
|
.status-success { background: var(--status-success); color: var(--success); }
|
||||||
|
.status-skipped { background: var(--status-skipped); color: var(--warning); }
|
||||||
|
.status-error { background: var(--status-error); color: var(--error); }
|
||||||
|
|
||||||
|
.version {
|
||||||
|
margin-top: 16px;
|
||||||
|
color: var(--text-dim);
|
||||||
|
font-family: var(--font-mono);
|
||||||
|
font-size: 0.75rem;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 480px) {
|
||||||
|
.page { padding: 14px; }
|
||||||
|
h1 { font-size: 1.5rem; }
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<main class="page">
|
||||||
|
<section class="panel" aria-labelledby="heading">
|
||||||
|
<div class="heading-row">
|
||||||
|
<div>
|
||||||
|
<p class="eyebrow">QC datasheet</p>
|
||||||
|
<h1 id="heading">New QC Sheet</h1>
|
||||||
|
</div>
|
||||||
|
<button
|
||||||
|
id="theme-toggle"
|
||||||
|
class="theme-toggle"
|
||||||
|
type="button"
|
||||||
|
aria-label="Switch to light theme"
|
||||||
|
title="Switch theme">
|
||||||
|
Aa
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<p class="subtitle">Create a new QC datasheet from the latest matching workbook.</p>
|
||||||
|
|
||||||
|
<form id="create-form">
|
||||||
|
<div class="fields">
|
||||||
|
<label class="field combobox" for="set-dropdown-input">
|
||||||
|
<span id="set-label" class="field-label">Select Set</span>
|
||||||
|
<input
|
||||||
|
id="set-dropdown-input"
|
||||||
|
class="combobox-input"
|
||||||
|
type="text"
|
||||||
|
autocomplete="off"
|
||||||
|
spellcheck="false"
|
||||||
|
role="combobox"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-controls="set-dropdown-panel"
|
||||||
|
aria-autocomplete="list"
|
||||||
|
aria-labelledby="set-label"
|
||||||
|
placeholder=" ">
|
||||||
|
<select id="set-dropdown" aria-labelledby="set-label" tabindex="-1"></select>
|
||||||
|
<span class="combobox-caret" aria-hidden="true">▾</span>
|
||||||
|
<div id="set-dropdown-panel" class="combobox-panel" role="listbox" aria-labelledby="set-label" hidden></div>
|
||||||
|
</label>
|
||||||
|
<label class="field combobox" for="ink-dropdown-input">
|
||||||
|
<span id="ink-label" class="field-label">Select Ink Color</span>
|
||||||
|
<input
|
||||||
|
id="ink-dropdown-input"
|
||||||
|
class="combobox-input"
|
||||||
|
type="text"
|
||||||
|
autocomplete="off"
|
||||||
|
spellcheck="false"
|
||||||
|
role="combobox"
|
||||||
|
aria-expanded="false"
|
||||||
|
aria-controls="ink-dropdown-panel"
|
||||||
|
aria-autocomplete="list"
|
||||||
|
aria-labelledby="ink-label"
|
||||||
|
placeholder=" ">
|
||||||
|
<select id="ink-dropdown" aria-labelledby="ink-label" tabindex="-1"></select>
|
||||||
|
<span class="combobox-caret" aria-hidden="true">▾</span>
|
||||||
|
<div id="ink-dropdown-panel" class="combobox-panel" role="listbox" aria-labelledby="ink-label" hidden></div>
|
||||||
|
</label>
|
||||||
|
<label class="field" for="serial-input">
|
||||||
|
<span id="serial-label" class="field-label">Serial:</span>
|
||||||
|
<input id="serial-input" type="text" placeholder="e.g. 1234/A" aria-labelledby="serial-label">
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="divider"></div>
|
||||||
|
<button id="create-button" type="submit">Create datasheet</button>
|
||||||
|
</form>
|
||||||
|
<div id="status" class="status status-ready" role="status">Loading configuration...</div>
|
||||||
|
<p id="version" class="version"></p>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const setDropdown = document.getElementById("set-dropdown");
|
||||||
|
const inkDropdown = document.getElementById("ink-dropdown");
|
||||||
|
const setInput = document.getElementById("set-dropdown-input");
|
||||||
|
const inkInput = document.getElementById("ink-dropdown-input");
|
||||||
|
const setPanel = document.getElementById("set-dropdown-panel");
|
||||||
|
const inkPanel = document.getElementById("ink-dropdown-panel");
|
||||||
|
const serialInput = document.getElementById("serial-input");
|
||||||
|
const createForm = document.getElementById("create-form");
|
||||||
|
const createBtn = document.getElementById("create-button");
|
||||||
|
const status = document.getElementById("status");
|
||||||
|
const themeToggle = document.getElementById("theme-toggle");
|
||||||
|
|
||||||
|
function isLightTheme() {
|
||||||
|
return document.documentElement.getAttribute("data-theme") === "light";
|
||||||
|
}
|
||||||
|
|
||||||
|
function syncThemeToggle() {
|
||||||
|
const light = isLightTheme();
|
||||||
|
themeToggle.setAttribute(
|
||||||
|
"aria-label",
|
||||||
|
light ? "Switch to dark theme" : "Switch to light theme"
|
||||||
|
);
|
||||||
|
themeToggle.textContent = light ? "Dark" : "Light";
|
||||||
|
}
|
||||||
|
|
||||||
|
function applyTheme(theme) {
|
||||||
|
if (theme === "light") {
|
||||||
|
document.documentElement.setAttribute("data-theme", "light");
|
||||||
|
} else {
|
||||||
|
document.documentElement.removeAttribute("data-theme");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
localStorage.setItem("xlsx-clean-theme", theme);
|
||||||
|
} catch (error) {
|
||||||
|
/* ignore quota / privacy mode */
|
||||||
|
}
|
||||||
|
syncThemeToggle();
|
||||||
|
}
|
||||||
|
|
||||||
|
themeToggle.addEventListener("click", () => {
|
||||||
|
applyTheme(isLightTheme() ? "dark" : "light");
|
||||||
|
});
|
||||||
|
syncThemeToggle();
|
||||||
|
|
||||||
|
// Builds a searchable combobox. The underlying <select> stays as the
|
||||||
|
// semantic source of truth; the visible widget is a text <input> plus a
|
||||||
|
// listbox panel that filters options as the user types.
|
||||||
|
function createCombobox(selectEl, inputEl, panelEl) {
|
||||||
|
let openState = false;
|
||||||
|
let inputDirty = false;
|
||||||
|
|
||||||
|
const visibleOptions = () =>
|
||||||
|
Array.from(panelEl.querySelectorAll(".combobox-option")).filter(
|
||||||
|
(node) => !node.hidden
|
||||||
|
);
|
||||||
|
|
||||||
|
const open = () => {
|
||||||
|
if (openState || inputEl.disabled) return;
|
||||||
|
openState = true;
|
||||||
|
panelEl.hidden = false;
|
||||||
|
inputEl.setAttribute("aria-expanded", "true");
|
||||||
|
filter();
|
||||||
|
};
|
||||||
|
|
||||||
|
const close = () => {
|
||||||
|
if (!openState) return;
|
||||||
|
openState = false;
|
||||||
|
panelEl.hidden = true;
|
||||||
|
inputEl.setAttribute("aria-expanded", "false");
|
||||||
|
inputEl.removeAttribute("aria-activedescendant");
|
||||||
|
for (const node of panelEl.querySelectorAll(".combobox-option")) {
|
||||||
|
node.setAttribute("aria-selected", "false");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const setActive = (idx) => {
|
||||||
|
const options = visibleOptions();
|
||||||
|
for (const node of panelEl.querySelectorAll(".combobox-option")) {
|
||||||
|
node.setAttribute("aria-selected", "false");
|
||||||
|
}
|
||||||
|
if (idx < 0 || idx >= options.length) {
|
||||||
|
inputEl.removeAttribute("aria-activedescendant");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const node = options[idx];
|
||||||
|
node.setAttribute("aria-selected", "true");
|
||||||
|
node.scrollIntoView({ block: "nearest" });
|
||||||
|
inputEl.setAttribute("aria-activedescendant", node.id);
|
||||||
|
};
|
||||||
|
|
||||||
|
const filter = () => {
|
||||||
|
const needle = inputDirty ? inputEl.value.trim().toLowerCase() : "";
|
||||||
|
let firstVisible = -1;
|
||||||
|
let count = 0;
|
||||||
|
for (const node of panelEl.querySelectorAll(".combobox-option")) {
|
||||||
|
const value = (node.dataset.value || "").toLowerCase();
|
||||||
|
const match = !needle || value.includes(needle);
|
||||||
|
node.hidden = !match;
|
||||||
|
if (match) {
|
||||||
|
if (firstVisible === -1) firstVisible = count;
|
||||||
|
count += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const empty = panelEl.querySelector(".combobox-empty");
|
||||||
|
if (empty) empty.hidden = count > 0;
|
||||||
|
setActive(firstVisible === -1 ? -1 : 0);
|
||||||
|
};
|
||||||
|
|
||||||
|
const selectValue = (value) => {
|
||||||
|
if (selectEl.value !== value) {
|
||||||
|
selectEl.value = value;
|
||||||
|
selectEl.dispatchEvent(new Event("change", { bubbles: true }));
|
||||||
|
}
|
||||||
|
inputEl.value = value;
|
||||||
|
inputDirty = false;
|
||||||
|
close();
|
||||||
|
inputEl.focus();
|
||||||
|
};
|
||||||
|
|
||||||
|
const syncDisabled = () => {
|
||||||
|
inputEl.disabled = selectEl.disabled;
|
||||||
|
if (selectEl.disabled) close();
|
||||||
|
};
|
||||||
|
|
||||||
|
const rebuild = () => {
|
||||||
|
panelEl.replaceChildren();
|
||||||
|
const values = Array.from(selectEl.options).map((o) => o.value);
|
||||||
|
for (const value of values) {
|
||||||
|
const node = document.createElement("div");
|
||||||
|
node.className = "combobox-option";
|
||||||
|
node.id = `${selectEl.id}-opt-${CSS.escape(value)}`;
|
||||||
|
node.setAttribute("role", "option");
|
||||||
|
node.setAttribute("aria-selected", "false");
|
||||||
|
node.dataset.value = value;
|
||||||
|
node.textContent = value;
|
||||||
|
node.addEventListener("mousedown", (event) => {
|
||||||
|
// mousedown (not click) so we beat the input's blur handler.
|
||||||
|
event.preventDefault();
|
||||||
|
selectValue(value);
|
||||||
|
});
|
||||||
|
panelEl.append(node);
|
||||||
|
}
|
||||||
|
const empty = document.createElement("div");
|
||||||
|
empty.className = "combobox-empty";
|
||||||
|
empty.textContent = "No matches";
|
||||||
|
empty.hidden = true;
|
||||||
|
panelEl.append(empty);
|
||||||
|
inputEl.value = selectEl.value || "";
|
||||||
|
inputDirty = false;
|
||||||
|
syncDisabled();
|
||||||
|
};
|
||||||
|
|
||||||
|
inputEl.addEventListener("focus", open);
|
||||||
|
inputEl.addEventListener("mousedown", () => {
|
||||||
|
open();
|
||||||
|
});
|
||||||
|
inputEl.addEventListener("input", () => {
|
||||||
|
inputDirty = true;
|
||||||
|
if (!openState) open();
|
||||||
|
filter();
|
||||||
|
});
|
||||||
|
inputEl.addEventListener("blur", () => {
|
||||||
|
// Defer close so a mousedown on a panel option can fire first.
|
||||||
|
setTimeout(() => {
|
||||||
|
if (inputEl.value !== selectEl.value) {
|
||||||
|
inputEl.value = selectEl.value || "";
|
||||||
|
inputDirty = false;
|
||||||
|
}
|
||||||
|
close();
|
||||||
|
}, 0);
|
||||||
|
});
|
||||||
|
inputEl.addEventListener("keydown", (event) => {
|
||||||
|
const options = visibleOptions();
|
||||||
|
if (event.key === "ArrowDown") {
|
||||||
|
event.preventDefault();
|
||||||
|
if (!openState) open();
|
||||||
|
const idx = options.findIndex(
|
||||||
|
(n) => n.getAttribute("aria-selected") === "true"
|
||||||
|
);
|
||||||
|
setActive(Math.min(idx + 1, options.length - 1));
|
||||||
|
} else if (event.key === "ArrowUp") {
|
||||||
|
event.preventDefault();
|
||||||
|
if (!openState) open();
|
||||||
|
const idx = options.findIndex(
|
||||||
|
(n) => n.getAttribute("aria-selected") === "true"
|
||||||
|
);
|
||||||
|
setActive(Math.max(idx - 1, 0));
|
||||||
|
} else if (event.key === "Home") {
|
||||||
|
if (openState) {
|
||||||
|
event.preventDefault();
|
||||||
|
setActive(0);
|
||||||
|
}
|
||||||
|
} else if (event.key === "End") {
|
||||||
|
if (openState) {
|
||||||
|
event.preventDefault();
|
||||||
|
setActive(options.length - 1);
|
||||||
|
}
|
||||||
|
} else if (event.key === "Enter") {
|
||||||
|
if (openState) {
|
||||||
|
event.preventDefault();
|
||||||
|
const node = panelEl.querySelector(
|
||||||
|
'.combobox-option[aria-selected="true"]'
|
||||||
|
);
|
||||||
|
if (node) selectValue(node.dataset.value);
|
||||||
|
}
|
||||||
|
} else if (event.key === "Escape") {
|
||||||
|
if (openState) {
|
||||||
|
event.preventDefault();
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Click outside closes the panel.
|
||||||
|
document.addEventListener("mousedown", (event) => {
|
||||||
|
if (!openState) return;
|
||||||
|
if (!inputEl.parentElement.contains(event.target)) close();
|
||||||
|
});
|
||||||
|
|
||||||
|
return { rebuild, syncDisabled };
|
||||||
|
}
|
||||||
|
|
||||||
|
const setCombobox = createCombobox(setDropdown, setInput, setPanel);
|
||||||
|
const inkCombobox = createCombobox(inkDropdown, inkInput, inkPanel);
|
||||||
|
|
||||||
|
function populateDropdown(dropdown, combobox, values) {
|
||||||
|
dropdown.replaceChildren();
|
||||||
|
for (const value of values) {
|
||||||
|
const option = document.createElement("option");
|
||||||
|
option.value = value;
|
||||||
|
option.textContent = value;
|
||||||
|
dropdown.append(option);
|
||||||
|
}
|
||||||
|
dropdown.disabled = values.length === 0;
|
||||||
|
combobox.rebuild();
|
||||||
|
}
|
||||||
|
|
||||||
|
function populateDropdowns(sets, inks) {
|
||||||
|
populateDropdown(setDropdown, setCombobox, sets);
|
||||||
|
populateDropdown(inkDropdown, inkCombobox, inks);
|
||||||
|
}
|
||||||
|
|
||||||
|
function populateInkDropdown(inks) {
|
||||||
|
populateDropdown(inkDropdown, inkCombobox, inks);
|
||||||
|
}
|
||||||
|
|
||||||
|
function setLabels(labels) {
|
||||||
|
document.getElementById("set-label").textContent = labels.set;
|
||||||
|
document.getElementById("ink-label").textContent = labels.ink;
|
||||||
|
document.getElementById("serial-label").textContent = labels.serial;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setVersion(version) {
|
||||||
|
document.getElementById("version").textContent = `v${version}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function showStatus(result) {
|
||||||
|
const details = [result.message];
|
||||||
|
if (result.template) details.push(`Template: ${result.template}`);
|
||||||
|
if (result.destination) details.push(`Output: ${result.destination}`);
|
||||||
|
if (result.backend) details.push(`Backend: ${result.backend}`);
|
||||||
|
status.textContent = details.join("\n");
|
||||||
|
status.className = "status";
|
||||||
|
if (result.skipped) {
|
||||||
|
status.classList.add("status-skipped");
|
||||||
|
} else if (result.ok) {
|
||||||
|
status.classList.add("status-success");
|
||||||
|
} else {
|
||||||
|
status.classList.add("status-error");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function initialize() {
|
||||||
|
try {
|
||||||
|
const data = await window.pywebview.api.get_initial_data();
|
||||||
|
populateDropdowns(data.sets, data.inks);
|
||||||
|
setLabels(data.labels);
|
||||||
|
setVersion(data.version);
|
||||||
|
showStatus({ message: "Ready.", ok: true, skipped: false });
|
||||||
|
} catch (error) {
|
||||||
|
showStatus({ message: `Failed to load configuration: ${error}`, ok: false, skipped: false });
|
||||||
|
createBtn.disabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setDropdown.addEventListener("change", async () => {
|
||||||
|
try {
|
||||||
|
const inks = await window.pywebview.api.get_inks(setDropdown.value);
|
||||||
|
populateInkDropdown(inks);
|
||||||
|
} catch (error) {
|
||||||
|
showStatus({ message: `Failed to load ink colors: ${error}`, ok: false, skipped: false });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
async function createDatasheet() {
|
||||||
|
createBtn.disabled = true;
|
||||||
|
try {
|
||||||
|
const result = await window.pywebview.api.create(
|
||||||
|
setDropdown.value, inkDropdown.value, serialInput.value
|
||||||
|
);
|
||||||
|
showStatus(result);
|
||||||
|
} catch (error) {
|
||||||
|
showStatus({ message: `Failed to create datasheet: ${error}`, ok: false, skipped: false });
|
||||||
|
} finally {
|
||||||
|
createBtn.disabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
createForm.addEventListener("submit", async (event) => {
|
||||||
|
event.preventDefault();
|
||||||
|
await createDatasheet();
|
||||||
|
});
|
||||||
|
|
||||||
|
window.addEventListener("pywebviewready", initialize);
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
105
tests/test_com_backend.py
Normal file
105
tests/test_com_backend.py
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
"""Tests for win32com gen_py cache recovery (no real Excel required)."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import sys
|
||||||
|
from types import ModuleType, SimpleNamespace
|
||||||
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
from xlsx_clean.com_backend import (
|
||||||
|
_clear_gen_py_cache,
|
||||||
|
_excel_application,
|
||||||
|
_is_gen_py_cache_error,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def _install_fake_win32com(*, ensure, dispatch=None, gen_path="/tmp/gen_py"):
|
||||||
|
"""Put fake win32com + win32com.client modules into sys.modules."""
|
||||||
|
win32com = ModuleType("win32com")
|
||||||
|
win32com.__gen_path__ = gen_path
|
||||||
|
client = ModuleType("win32com.client")
|
||||||
|
client.gencache = SimpleNamespace(EnsureDispatch=ensure)
|
||||||
|
client.Dispatch = dispatch if dispatch is not None else MagicMock()
|
||||||
|
return patch.dict(sys.modules, {"win32com": win32com, "win32com.client": client})
|
||||||
|
|
||||||
|
|
||||||
|
def test_is_gen_py_cache_error_matches_known_messages():
|
||||||
|
assert _is_gen_py_cache_error(
|
||||||
|
AttributeError(
|
||||||
|
"module 'win32com.gen_py.00020813-0000-0000-C000-000000000046x0x1x9' "
|
||||||
|
"has no attribute 'CLSIDToPackageMap'"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
assert _is_gen_py_cache_error(
|
||||||
|
AttributeError("... has no attribute 'CLSIDToClassMap'")
|
||||||
|
)
|
||||||
|
assert not _is_gen_py_cache_error(AttributeError("something else"))
|
||||||
|
assert not _is_gen_py_cache_error(RuntimeError("CLSIDToPackageMap"))
|
||||||
|
|
||||||
|
|
||||||
|
def test_clear_gen_py_cache_removes_modules_and_directory(tmp_path):
|
||||||
|
gen_root = tmp_path / "gen_py"
|
||||||
|
bad = gen_root / "00020813-0000-0000-C000-000000000046x0x1x9"
|
||||||
|
bad.mkdir(parents=True)
|
||||||
|
(bad / "__init__.py").write_text("# corrupt", encoding="utf-8")
|
||||||
|
|
||||||
|
mod_name = "win32com.gen_py.00020813-0000-0000-C000-000000000046x0x1x9"
|
||||||
|
fake_mod = ModuleType(mod_name)
|
||||||
|
fake_win32com = ModuleType("win32com")
|
||||||
|
fake_win32com.__gen_path__ = str(gen_root)
|
||||||
|
|
||||||
|
with patch.dict(sys.modules, {"win32com": fake_win32com, mod_name: fake_mod}):
|
||||||
|
cleared = _clear_gen_py_cache()
|
||||||
|
assert cleared == gen_root
|
||||||
|
assert not gen_root.exists()
|
||||||
|
assert mod_name not in sys.modules
|
||||||
|
|
||||||
|
|
||||||
|
def test_excel_application_clears_cache_and_retries_ensure_dispatch():
|
||||||
|
excel = object()
|
||||||
|
ensure = MagicMock(
|
||||||
|
side_effect=[
|
||||||
|
AttributeError(
|
||||||
|
"module 'win32com.gen_py.00020813x0x1x9' has no attribute 'CLSIDToPackageMap'"
|
||||||
|
),
|
||||||
|
excel,
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
with (
|
||||||
|
_install_fake_win32com(ensure=ensure),
|
||||||
|
patch("xlsx_clean.com_backend._clear_gen_py_cache", return_value=None) as clear,
|
||||||
|
):
|
||||||
|
result = _excel_application()
|
||||||
|
|
||||||
|
assert result is excel
|
||||||
|
assert ensure.call_count == 2
|
||||||
|
clear.assert_called_once_with()
|
||||||
|
|
||||||
|
|
||||||
|
def test_excel_application_falls_back_to_dispatch_after_second_failure():
|
||||||
|
excel = object()
|
||||||
|
err = AttributeError("has no attribute 'CLSIDToClassMap'")
|
||||||
|
ensure = MagicMock(side_effect=[err, err])
|
||||||
|
dispatch = MagicMock(return_value=excel)
|
||||||
|
|
||||||
|
with (
|
||||||
|
_install_fake_win32com(ensure=ensure, dispatch=dispatch),
|
||||||
|
patch("xlsx_clean.com_backend._clear_gen_py_cache", return_value=None),
|
||||||
|
):
|
||||||
|
result = _excel_application()
|
||||||
|
|
||||||
|
assert result is excel
|
||||||
|
dispatch.assert_called_once_with("Excel.Application")
|
||||||
|
|
||||||
|
|
||||||
|
def test_excel_application_rethrows_unrelated_attribute_error():
|
||||||
|
ensure = MagicMock(side_effect=AttributeError("unrelated"))
|
||||||
|
|
||||||
|
with (
|
||||||
|
_install_fake_win32com(ensure=ensure),
|
||||||
|
pytest.raises(AttributeError, match="unrelated"),
|
||||||
|
):
|
||||||
|
_excel_application()
|
||||||
79
tests/test_core.py
Normal file
79
tests/test_core.py
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
from xlsx_clean.core import resolve_write_year_dir, resolve_year_dir
|
||||||
|
|
||||||
|
|
||||||
|
def _touch(path: Path) -> None:
|
||||||
|
path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
path.write_bytes(b"")
|
||||||
|
|
||||||
|
|
||||||
|
def test_resolve_year_picks_largest_dir_with_matching_sheet(tmp_path: Path):
|
||||||
|
pattern = "ICJ_108 op. [SERIAL].xlsx"
|
||||||
|
_touch(tmp_path / "2025" / "ICJ108 Beige" / "ICJ_108 op. 1.xlsx")
|
||||||
|
_touch(tmp_path / "2026" / "ICJ108 Beige" / "ICJ_108 op. 2.xlsx")
|
||||||
|
placeholder = tmp_path / "[YEAR]" / "ICJ108 Beige"
|
||||||
|
assert resolve_year_dir(placeholder, pattern) == tmp_path / "2026" / "ICJ108 Beige"
|
||||||
|
|
||||||
|
|
||||||
|
def test_resolve_year_ignores_larger_empty_year(tmp_path: Path):
|
||||||
|
pattern = "ICJ_108 op. [SERIAL].xlsx"
|
||||||
|
_touch(tmp_path / "2025" / "ICJ108 Beige" / "ICJ_108 op. 1.xlsx")
|
||||||
|
(tmp_path / "2026" / "ICJ108 Beige").mkdir(parents=True)
|
||||||
|
placeholder = tmp_path / "[YEAR]" / "ICJ108 Beige"
|
||||||
|
assert resolve_year_dir(placeholder, pattern) == tmp_path / "2025" / "ICJ108 Beige"
|
||||||
|
|
||||||
|
|
||||||
|
def test_resolve_year_jalali_style(tmp_path: Path):
|
||||||
|
pattern = "KRCY1100T Blue [SERIAL].xlsx"
|
||||||
|
_touch(tmp_path / "1402" / "KRCY1100T Blue" / "KRCY1100T Blue 1.xlsx")
|
||||||
|
_touch(tmp_path / "1403" / "KRCY1100T Blue" / "KRCY1100T Blue 2.xlsx")
|
||||||
|
placeholder = tmp_path / "[YEAR]" / "KRCY1100T Blue"
|
||||||
|
assert resolve_year_dir(placeholder, pattern) == tmp_path / "1403" / "KRCY1100T Blue"
|
||||||
|
|
||||||
|
|
||||||
|
def test_resolve_year_passthrough_without_token(tmp_path: Path):
|
||||||
|
path = tmp_path / "2025" / "ICJ108 Beige"
|
||||||
|
assert resolve_year_dir(path, "x [SERIAL].xlsx") == path
|
||||||
|
|
||||||
|
|
||||||
|
def test_resolve_year_fails_when_no_sheets(tmp_path: Path):
|
||||||
|
(tmp_path / "2026" / "ICJ108 Beige").mkdir(parents=True)
|
||||||
|
with pytest.raises(FileNotFoundError, match="No year directory"):
|
||||||
|
resolve_year_dir(tmp_path / "[YEAR]" / "ICJ108 Beige", "ICJ_108 op. [SERIAL].xlsx")
|
||||||
|
|
||||||
|
|
||||||
|
def test_resolve_write_year_picks_largest_even_if_empty(tmp_path: Path):
|
||||||
|
_touch(tmp_path / "2025" / "ICJ108 Beige" / "ICJ_108 op. 1.xlsx")
|
||||||
|
(tmp_path / "2026").mkdir()
|
||||||
|
placeholder = tmp_path / "[YEAR]" / "ICJ108 Beige"
|
||||||
|
assert resolve_write_year_dir(placeholder) == tmp_path / "2026" / "ICJ108 Beige"
|
||||||
|
|
||||||
|
|
||||||
|
def test_resolve_write_year_jalali_style(tmp_path: Path):
|
||||||
|
(tmp_path / "1402").mkdir()
|
||||||
|
(tmp_path / "1403").mkdir()
|
||||||
|
placeholder = tmp_path / "[YEAR]" / "KRCY1100T Blue"
|
||||||
|
assert resolve_write_year_dir(placeholder) == tmp_path / "1403" / "KRCY1100T Blue"
|
||||||
|
|
||||||
|
|
||||||
|
def test_resolve_write_year_passthrough_without_token(tmp_path: Path):
|
||||||
|
path = tmp_path / "2025" / "ICJ108 Beige"
|
||||||
|
assert resolve_write_year_dir(path) == path
|
||||||
|
|
||||||
|
|
||||||
|
def test_resolve_write_year_fails_when_no_digit_dirs(tmp_path: Path):
|
||||||
|
(tmp_path / "notes").mkdir()
|
||||||
|
with pytest.raises(FileNotFoundError, match="No year directory"):
|
||||||
|
resolve_write_year_dir(tmp_path / "[YEAR]" / "ICJ108 Beige")
|
||||||
|
|
||||||
|
|
||||||
|
def test_read_and_write_year_differ_when_sheets_only_in_older(tmp_path: Path):
|
||||||
|
pattern = "ICJ_108 op. [SERIAL].xlsx"
|
||||||
|
_touch(tmp_path / "2025" / "ICJ108 Beige" / "ICJ_108 op. 1.xlsx")
|
||||||
|
(tmp_path / "2026").mkdir()
|
||||||
|
placeholder = tmp_path / "[YEAR]" / "ICJ108 Beige"
|
||||||
|
assert resolve_year_dir(placeholder, pattern) == tmp_path / "2025" / "ICJ108 Beige"
|
||||||
|
assert resolve_write_year_dir(placeholder) == tmp_path / "2026" / "ICJ108 Beige"
|
||||||
127
tests/test_gui_app.py
Normal file
127
tests/test_gui_app.py
Normal file
@@ -0,0 +1,127 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
from types import SimpleNamespace
|
||||||
|
from unittest.mock import patch
|
||||||
|
|
||||||
|
from xlsx_clean.gui_app import Api
|
||||||
|
|
||||||
|
|
||||||
|
def test_initial_data_stores_state_and_uses_first_set_inks():
|
||||||
|
rows = [{"set_name": "Set A"}]
|
||||||
|
config = {"backend": "ooxml"}
|
||||||
|
with patch(
|
||||||
|
"xlsx_clean.gui_app.load_config",
|
||||||
|
return_value=(["Set", "Ink", "Serial", "addin-a", "addin-b"], rows, config),
|
||||||
|
), patch("xlsx_clean.gui_app.list_sets", return_value=["Set A"]), patch(
|
||||||
|
"xlsx_clean.gui_app.list_ink_colors", return_value=["Blue"]
|
||||||
|
) as inks:
|
||||||
|
api = Api()
|
||||||
|
data = api.get_initial_data()
|
||||||
|
|
||||||
|
assert data["sets"] == ["Set A"]
|
||||||
|
assert data["inks"] == ["Blue"]
|
||||||
|
assert data["labels"] == {"set": "Set", "ink": "Ink", "serial": "Serial"}
|
||||||
|
assert api.rows == rows
|
||||||
|
assert api.addin_paths == ["addin-a", "addin-b"]
|
||||||
|
assert api.config == config
|
||||||
|
inks.assert_called_once_with(rows, "Set A")
|
||||||
|
|
||||||
|
|
||||||
|
def test_initial_data_uses_safe_label_fallbacks_and_empty_inks():
|
||||||
|
with (
|
||||||
|
patch("xlsx_clean.gui_app.load_config", return_value=([], [], {})),
|
||||||
|
patch("xlsx_clean.gui_app.list_sets", return_value=[]),
|
||||||
|
patch("xlsx_clean.gui_app.list_ink_colors") as inks,
|
||||||
|
):
|
||||||
|
data = Api().get_initial_data()
|
||||||
|
|
||||||
|
assert data["labels"] == {
|
||||||
|
"set": "Select Set",
|
||||||
|
"ink": "Select Ink Color",
|
||||||
|
"serial": "Serial:",
|
||||||
|
}
|
||||||
|
assert data["inks"] == []
|
||||||
|
inks.assert_not_called()
|
||||||
|
|
||||||
|
|
||||||
|
def test_get_inks_uses_initialized_rows():
|
||||||
|
api = Api()
|
||||||
|
api.rows = [{"set_name": "Set A"}]
|
||||||
|
with patch("xlsx_clean.gui_app.list_ink_colors", return_value=["Blue"]) as inks:
|
||||||
|
assert api.get_inks("Set A") == ["Blue"]
|
||||||
|
|
||||||
|
inks.assert_called_once_with(api.rows, "Set A")
|
||||||
|
|
||||||
|
|
||||||
|
def test_create_passes_core_arguments_and_serializes_paths():
|
||||||
|
api = Api()
|
||||||
|
api.rows = [{"set_name": "Set A"}]
|
||||||
|
api.addin_paths = ["addin-a"]
|
||||||
|
api.config = {"backend": "ooxml"}
|
||||||
|
result = SimpleNamespace(
|
||||||
|
ok=True,
|
||||||
|
skipped=False,
|
||||||
|
message="Wrote workbook",
|
||||||
|
template=Path("template.xlsx"),
|
||||||
|
destination=Path("output.xlsx"),
|
||||||
|
backend="ooxml",
|
||||||
|
)
|
||||||
|
with patch("xlsx_clean.gui_app.create_datasheet", return_value=result) as create:
|
||||||
|
response = api.create("Set A", "Blue", "1234/A")
|
||||||
|
|
||||||
|
create.assert_called_once_with(
|
||||||
|
selected_set="Set A",
|
||||||
|
selected_dir="Blue",
|
||||||
|
batch_serial="1234/A",
|
||||||
|
backend=None,
|
||||||
|
rows=api.rows,
|
||||||
|
addin_paths=api.addin_paths,
|
||||||
|
config=api.config,
|
||||||
|
)
|
||||||
|
assert response == {
|
||||||
|
"ok": True,
|
||||||
|
"skipped": False,
|
||||||
|
"message": "Wrote workbook",
|
||||||
|
"template": "template.xlsx",
|
||||||
|
"destination": "output.xlsx",
|
||||||
|
"backend": "ooxml",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def test_create_serializes_missing_paths_for_error_or_skipped_result():
|
||||||
|
api = Api()
|
||||||
|
result = SimpleNamespace(
|
||||||
|
ok=False,
|
||||||
|
skipped=False,
|
||||||
|
message="Select a set.",
|
||||||
|
template=None,
|
||||||
|
destination=None,
|
||||||
|
backend=None,
|
||||||
|
)
|
||||||
|
with patch("xlsx_clean.gui_app.create_datasheet", return_value=result):
|
||||||
|
response = api.create("", "", "")
|
||||||
|
|
||||||
|
assert response["template"] is None
|
||||||
|
assert response["destination"] is None
|
||||||
|
assert response["ok"] is False
|
||||||
|
|
||||||
|
|
||||||
|
def test_create_serializes_unexpected_exceptions_into_result_contract():
|
||||||
|
api = Api()
|
||||||
|
api.rows = [{"set_name": "Set A"}]
|
||||||
|
api.addin_paths = []
|
||||||
|
api.config = {"backend": "ooxml"}
|
||||||
|
|
||||||
|
def boom(**kwargs):
|
||||||
|
raise RuntimeError("backend exploded")
|
||||||
|
|
||||||
|
with patch("xlsx_clean.gui_app.create_datasheet", side_effect=boom):
|
||||||
|
response = api.create("Set A", "Blue", "1234/A")
|
||||||
|
|
||||||
|
assert response == {
|
||||||
|
"ok": False,
|
||||||
|
"skipped": False,
|
||||||
|
"message": "Unexpected error: backend exploded",
|
||||||
|
"template": None,
|
||||||
|
"destination": None,
|
||||||
|
"backend": None,
|
||||||
|
}
|
||||||
44
tests/test_gui_entrypoint.py
Normal file
44
tests/test_gui_entrypoint.py
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
|
from xlsx_clean import gui_app
|
||||||
|
|
||||||
|
|
||||||
|
def test_parse_args_uses_default_dimensions():
|
||||||
|
args = gui_app.parse_args([])
|
||||||
|
assert (args.width, args.height) == (800, 600)
|
||||||
|
|
||||||
|
|
||||||
|
def test_main_initializes_api_before_opening_window():
|
||||||
|
index_html = Path("/tmp/index.html")
|
||||||
|
events = []
|
||||||
|
api = MagicMock()
|
||||||
|
|
||||||
|
def create_window(**kwargs):
|
||||||
|
events.append(("create_window", kwargs))
|
||||||
|
|
||||||
|
with (
|
||||||
|
patch("xlsx_clean.gui_app.Api", return_value=api),
|
||||||
|
patch("xlsx_clean.gui_app.package_file", return_value=index_html) as package_file,
|
||||||
|
patch("xlsx_clean.gui_app.webview.create_window", side_effect=create_window),
|
||||||
|
patch("xlsx_clean.gui_app.webview.start", side_effect=lambda: events.append(("start",))),
|
||||||
|
):
|
||||||
|
gui_app.main(["--width", "900", "--height", "700"])
|
||||||
|
|
||||||
|
package_file.assert_called_once_with("ui/index.html")
|
||||||
|
api.initialize.assert_called_once_with()
|
||||||
|
assert events == [
|
||||||
|
(
|
||||||
|
"create_window",
|
||||||
|
{
|
||||||
|
"title": f"New QC Sheet · v{gui_app._VERSION}",
|
||||||
|
"url": index_html.as_uri(),
|
||||||
|
"js_api": api,
|
||||||
|
"width": 900,
|
||||||
|
"height": 700,
|
||||||
|
"min_size": (450, 400),
|
||||||
|
"background_color": "#0b0e14",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
("start",),
|
||||||
|
]
|
||||||
14
tests/test_packaging.py
Normal file
14
tests/test_packaging.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
|
def test_pyinstaller_spec_collects_webview_and_local_assets():
|
||||||
|
spec = Path("packaging/xlsx_clean.spec").read_text(encoding="utf-8")
|
||||||
|
|
||||||
|
assert 'collect_all("webview")' in spec
|
||||||
|
assert 'collect_all("dearpygui")' not in spec
|
||||||
|
assert '"ui"), "xlsx_clean/ui")' in spec
|
||||||
|
assert '"fonts"), "xlsx_clean/fonts")' in spec
|
||||||
|
assert 'if sys.platform == "win32":' in spec
|
||||||
|
assert 'collect_all("clr_loader")' in spec
|
||||||
|
for hidden_import in ('"clr"', '"clr_loader"', '"pythonnet"'):
|
||||||
|
assert hidden_import in spec
|
||||||
19
tests/test_setup_linux.py
Normal file
19
tests/test_setup_linux.py
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
|
def test_setup_linux_pins_system_python_for_uv_sync():
|
||||||
|
script = Path("desktop/setup_linux.sh").read_text(encoding="utf-8")
|
||||||
|
|
||||||
|
assert "uv venv --python /usr/bin/python3 --no-managed-python --system-site-packages" in script
|
||||||
|
|
||||||
|
sync_lines = [
|
||||||
|
line.strip()
|
||||||
|
for line in script.splitlines()
|
||||||
|
if line.strip().startswith("uv sync")
|
||||||
|
]
|
||||||
|
assert sync_lines == [
|
||||||
|
"uv sync --python /usr/bin/python3 --no-managed-python"
|
||||||
|
]
|
||||||
|
assert "--python-preference" not in script
|
||||||
|
assert "uv sync --active" not in script
|
||||||
|
assert "include-system-site-packages = true" in script
|
||||||
66
tests/test_ui_assets.py
Normal file
66
tests/test_ui_assets.py
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
import re
|
||||||
|
from html.parser import HTMLParser
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
from xlsx_clean.paths import package_file
|
||||||
|
|
||||||
|
|
||||||
|
class StrictHtmlParser(HTMLParser):
|
||||||
|
def error(self, message):
|
||||||
|
raise AssertionError(message)
|
||||||
|
|
||||||
|
|
||||||
|
def test_ui_asset_exists_and_has_required_bridge_content():
|
||||||
|
html_path = package_file("ui/index.html")
|
||||||
|
assert html_path.is_file()
|
||||||
|
content = html_path.read_text(encoding="utf-8")
|
||||||
|
|
||||||
|
for expected in (
|
||||||
|
"New QC Sheet",
|
||||||
|
"Create a new QC datasheet from the latest matching workbook.",
|
||||||
|
'id="set-label"',
|
||||||
|
'id="ink-label"',
|
||||||
|
'id="serial-label"',
|
||||||
|
'id="create-form"',
|
||||||
|
'id="create-button" type="submit"',
|
||||||
|
"Create datasheet",
|
||||||
|
"status-ready",
|
||||||
|
"status-success",
|
||||||
|
"status-skipped",
|
||||||
|
"status-error",
|
||||||
|
'id="version"',
|
||||||
|
"pywebviewready",
|
||||||
|
"get_initial_data()",
|
||||||
|
"get_inks(setDropdown.value)",
|
||||||
|
"api.create(",
|
||||||
|
'createForm.addEventListener("submit"',
|
||||||
|
"finally",
|
||||||
|
'inputEl.value = selectEl.value || ""',
|
||||||
|
'inputEl.addEventListener("mousedown", () => {\n open();\n });',
|
||||||
|
):
|
||||||
|
assert expected in content
|
||||||
|
|
||||||
|
assert "tailwind" not in content.lower()
|
||||||
|
assert "quasar" not in content.lower()
|
||||||
|
assert "cdn" not in content.lower()
|
||||||
|
assert not re.search(r"https?://", content)
|
||||||
|
assert "#0b0e14" in content
|
||||||
|
assert "#e54d5e" in content
|
||||||
|
assert "background-size: var(--grid-size) var(--grid-size)" in content
|
||||||
|
assert "background: transparent" in content
|
||||||
|
assert "tl-red" not in content
|
||||||
|
assert 'class="chrome"' not in content
|
||||||
|
StrictHtmlParser().feed(content)
|
||||||
|
|
||||||
|
|
||||||
|
def test_ui_font_sources_are_bundled_locally():
|
||||||
|
content = package_file("ui/index.html").read_text(encoding="utf-8")
|
||||||
|
font_urls = re.findall(r'url\("([^\"]+\.ttf)"\)', content)
|
||||||
|
|
||||||
|
assert font_urls == ["../fonts/Inter-Regular.ttf", "../fonts/Inter-Bold.ttf"]
|
||||||
|
for font_url in font_urls:
|
||||||
|
assert (package_file("ui") / font_url).resolve().is_file()
|
||||||
|
|
||||||
|
|
||||||
|
def test_demo_html_is_not_shipped():
|
||||||
|
assert not Path("desktop/demo.html").exists()
|
||||||
521
uv.lock
generated
Normal file
521
uv.lock
generated
Normal file
@@ -0,0 +1,521 @@
|
|||||||
|
version = 1
|
||||||
|
revision = 3
|
||||||
|
requires-python = ">=3.12"
|
||||||
|
resolution-markers = [
|
||||||
|
"python_full_version >= '3.14' and sys_platform == 'win32'",
|
||||||
|
"python_full_version >= '3.14' and sys_platform == 'emscripten'",
|
||||||
|
"python_full_version >= '3.14' and sys_platform != 'emscripten' and sys_platform != 'win32'",
|
||||||
|
"python_full_version < '3.14' and sys_platform == 'win32'",
|
||||||
|
"python_full_version < '3.14' and sys_platform == 'emscripten'",
|
||||||
|
"python_full_version < '3.14' and sys_platform != 'emscripten' and sys_platform != 'win32'",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "altgraph"
|
||||||
|
version = "0.17.5"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/7e/f8/97fdf103f38fed6792a1601dbc16cc8aac56e7459a9fff08c812d8ae177a/altgraph-0.17.5.tar.gz", hash = "sha256:c87b395dd12fabde9c99573a9749d67da8d29ef9de0125c7f536699b4a9bc9e7", size = 48428, upload-time = "2025-11-21T20:35:50.583Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/a9/ba/000a1996d4308bc65120167c21241a3b205464a2e0b58deda26ae8ac21d1/altgraph-0.17.5-py2.py3-none-any.whl", hash = "sha256:f3a22400bce1b0c701683820ac4f3b159cd301acab067c51c653e06961600597", size = 21228, upload-time = "2025-11-21T20:35:49.444Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "beaupy"
|
||||||
|
version = "3.12.0"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "emoji" },
|
||||||
|
{ name = "python-yakh" },
|
||||||
|
{ name = "questo" },
|
||||||
|
{ name = "rich" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/80/65/6e501a432db02adb3c974473d73360880878797fbe25405c08024fa76bce/beaupy-3.12.0.tar.gz", hash = "sha256:e0ca6d2356b611ae734c8cf97b28ed9e3bb941d3207af2426e182da836a385d6", size = 16671, upload-time = "2026-05-21T19:10:01.649Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/5f/91/645739784ac1cda4eb4dfaeb7b31aa0fe949499e517c0a9616341bb8201d/beaupy-3.12.0-py3-none-any.whl", hash = "sha256:b3c1451c81ae329f91b27688faac0ae0f7ccbefc5ee97967a888582000d477c9", size = 15007, upload-time = "2026-05-21T19:10:00.595Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bottle"
|
||||||
|
version = "0.13.4"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/7a/71/cca6167c06d00c81375fd668719df245864076d284f7cb46a694cbeb5454/bottle-0.13.4.tar.gz", hash = "sha256:787e78327e12b227938de02248333d788cfe45987edca735f8f88e03472c3f47", size = 98717, upload-time = "2025-06-15T10:08:59.439Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/83/f6/b55ec74cfe68c6584163faa311503c20b0da4c09883a41e8e00d6726c954/bottle-0.13.4-py2.py3-none-any.whl", hash = "sha256:045684fbd2764eac9cdeb824861d1551d113e8b683d8d26e296898d3dd99a12e", size = 103807, upload-time = "2025-06-15T10:08:57.691Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cffi"
|
||||||
|
version = "2.1.1"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "pycparser", marker = "implementation_name != 'PyPy'" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/9e/ef/008a1939e372c06329a3fce4279c02f328488f3526744906eeec3da7ad5f/cffi-2.1.1.tar.gz", hash = "sha256:dd31f52ea1086513bb9df30f8fcee9b8918323ae067a3d5b78bc826a000712be", size = 530807, upload-time = "2026-08-03T21:21:18.939Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/80/fb/0bb75b7039588c074b37ae99f40d9bfddf990ecb2fbc346ebccd2e56b9be/cffi-2.1.1-cp312-cp312-win32.whl", hash = "sha256:046bfc24911b37851ee1b51aab8bffe713d89c68c6a057b09484ce9fd5f69b4e", size = 175292, upload-time = "2026-08-03T21:19:55.566Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/d9/79/615cc094e2fb508cade7de88d3b4f6c4ec2bab695c97bce9153dc65aadf5/cffi-2.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:f53e442b08449d42821fa4a4fba000095af9f62742a500f978a9f557ec44339a", size = 185919, upload-time = "2026-08-03T21:19:56.89Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/70/c6/d0ea84713fe46b243a436a18fcd47d639732747e21635c8a27191b06dc30/cffi-2.1.1-cp312-cp312-win_arm64.whl", hash = "sha256:7bde5e4cc5c10140859842b9d383af292b22639a4dffb725314baf45968cef80", size = 180093, upload-time = "2026-08-03T21:19:58.155Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/9d/f4/035513d4117049066b4779dc3b7c0c0fdad175fa13731c9f4003f1cd1478/cffi-2.1.1-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:b5bdfd1c873d4e093aabc0ca84c4ca6dbc4f752afb5c86f146d9742580c9da2e", size = 194248, upload-time = "2026-08-03T21:19:59.399Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/76/af/2aeb4dbb5fc41a04161ae9ff1518de7cec08e164f44a8ce6a4cf7fd2cd1d/cffi-2.1.1-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:31348097ff5bbe827ccc41795d4dd099d9f0625e7def00ee653c137a490c2a6c", size = 196908, upload-time = "2026-08-03T21:20:00.746Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/70/ea/839b50531021a647fb5e929f72cf97bc1ff702b5472166164b5b6e76b851/cffi-2.1.1-cp313-cp313-win32.whl", hash = "sha256:334644fbac4eff73d985a17a91226df55d0f394160c4cfb880e084c8f7161cac", size = 175263, upload-time = "2026-08-03T21:20:13.559Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/60/a6/8b149b2c3f2e11aaa1618ef64500b45f50f22c57a977a4dff1aff1f91042/cffi-2.1.1-cp313-cp313-win_amd64.whl", hash = "sha256:1aa5645c30469b09530c4ebca77ebf8f17618293c58f8549cb1a543a50236e7d", size = 185688, upload-time = "2026-08-03T21:20:14.69Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/01/9a/11f687cb39d6a3504060d5242f04f48c735afb4d3d533958a20594890cb2/cffi-2.1.1-cp313-cp313-win_arm64.whl", hash = "sha256:63bbfd5ded17c4840ac07cd8f1c21ba9d9708141f840b324f422f41b207e3973", size = 180078, upload-time = "2026-08-03T21:20:15.917Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/d3/7b/d6bbf82b8b96e7391438898c42f5bd96dd02030fd5b64937d248220003e2/cffi-2.1.1-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:7dbb61fe3a7699468030f71bbe5f8a0e326a151daa91beb11a6fc1f980c55e1c", size = 194064, upload-time = "2026-08-03T21:20:17.148Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/94/e6/bcc91b283be94735e268487a054004f0aa19947b6348fa367db53230abc8/cffi-2.1.1-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:f24fb43132a4c6b4cb4eb029492919b2db645be6808d738f244fd146c03c32cb", size = 196720, upload-time = "2026-08-03T21:20:18.268Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/0b/e9/d0061c364cde06ee43168a0d076ac1da512cbc380d44767b844ba34fe2b6/cffi-2.1.1-cp314-cp314-win32.whl", hash = "sha256:1a18a57b58cfb21fc28d72e876acf10eaed67a1ed96226f92af4df681d571c4c", size = 177682, upload-time = "2026-08-03T21:20:44.288Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/a7/06/1c3e01e3ba14c39f6d10bfbac52753b7e22259e38088e5cfe1d704918690/cffi-2.1.1-cp314-cp314-win_amd64.whl", hash = "sha256:3222ba5d678f80a030e6afbcc33dc1ae5cb45facabb61cee2c7016b8432fde48", size = 187949, upload-time = "2026-08-03T21:20:45.623Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/87/5b/da4e39efe18eeb89cf580ea9cfc66b6a7c3eadb808fc0cc1d3a295cb5a5d/cffi-2.1.1-cp314-cp314-win_arm64.whl", hash = "sha256:ab36d55f9ed2d067327667c2fea18dda018eb628dd6347aa01dda6cf1f5d3836", size = 182947, upload-time = "2026-08-03T21:20:46.955Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/eb/d2/3b7176cb570a1d3e27faf67b72f591af508036e0d8b2be2ef9af9e8c84bb/cffi-2.1.1-cp314-cp314t-win32.whl", hash = "sha256:8ef53b2de9bcb9197d31854256575d59dbac0cba72ac627bb291ef5eceb74be4", size = 182868, upload-time = "2026-08-03T21:20:40.388Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/56/78/31f00c1bcd97c9bbf55f1bfdf5bc809a5de8887473e90bb9960dca825e80/cffi-2.1.1-cp314-cp314t-win_amd64.whl", hash = "sha256:616f097f2fe415bc92a247f02e11f634e1f9e9a83d327e3c915c15089c87869e", size = 194104, upload-time = "2026-08-03T21:20:41.725Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/7b/1b/58496f2ed0a35de575250c02a43ab3cc2c04d494a88fed31c1cabc0fd176/cffi-2.1.1-cp314-cp314t-win_arm64.whl", hash = "sha256:ad2c86c495b899d862ea0f4b42891b8713a3bd45dd4105c7fd51c2a72f39f3a5", size = 186402, upload-time = "2026-08-03T21:20:43.042Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/c1/8f/9ebe220eab48a093d1a5a5e339ab0dc7316eef3bb04d63c42f0251b61f50/cffi-2.1.1-cp315-cp315-ios_13_0_arm64_iphoneos.whl", hash = "sha256:dddad92b554513a31f272570678ba307fb9f618f05e3d4a5eacafff9eae03e1d", size = 194043, upload-time = "2026-08-03T21:20:48.179Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/ff/69/844bad3ece306c4782c2ecb93597035b6690d48704b803914c199da1e8b3/cffi-2.1.1-cp315-cp315-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:da0e573f9f97159390c89d9f1a9e41908b66d408cc5b58d08cf3847d844c531b", size = 196737, upload-time = "2026-08-03T21:20:49.457Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/f8/7e/8debeb04f1ab9fe2a6963964cd6f1aaf7192627b83926586a6a4e089c9fa/cffi-2.1.1-cp315-cp315-win32.whl", hash = "sha256:4f42141fc14250de6dde5ee7ea4432be017252d91f19c5ad043c084cea629cac", size = 177683, upload-time = "2026-08-03T21:21:14.901Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/e0/31/5158704cc474ab65c1647932e88be78dc0873f47130e253be38bcaf13d01/cffi-2.1.1-cp315-cp315-win_amd64.whl", hash = "sha256:e6e8cff14d6fb0be70a09c0bdc58096f501952d04624ebf867e0e56da2df8960", size = 187897, upload-time = "2026-08-03T21:21:16.108Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/cc/4b/b3a2da8570c704ffc0f9762cdc3ec0f02c8573798e0b5cf7f11c82bbb70f/cffi-2.1.1-cp315-cp315-win_arm64.whl", hash = "sha256:27350daa11d4f10c540e6e89dada4c54feb7256ad03e9a4dc075ebad7ba360d1", size = 182935, upload-time = "2026-08-03T21:21:17.271Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/6d/cd/a361394c94b2129d604bb846f624a8e88255a3ee33129c434a00d715e64f/cffi-2.1.1-cp315-cp315t-win32.whl", hash = "sha256:06c72bb76605a4b0cd0aad6930b69d4baf7dd5d806cfc409b824191099700e66", size = 182707, upload-time = "2026-08-03T21:21:11.226Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/9b/b5/ba2b299993c26577d529b6ae29841f9e15b9fcf004d65f423f4fcf94ade9/cffi-2.1.1-cp315-cp315t-win_amd64.whl", hash = "sha256:d9c275eaacd24aa73f94ffd6de08fc3f932424d8b6c376f4bed7cde376fe7bc3", size = 193772, upload-time = "2026-08-03T21:21:12.39Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/aa/29/35e016098c814cd93de9cd320c66b5bfba14dc6ecedd3cb518fa7c408c69/cffi-2.1.1-cp315-cp315t-win_arm64.whl", hash = "sha256:d18e5ac0f2f03f4f518d3e23db0f0cad7faa1da8620e9c09461d443bbf6e6692", size = 186360, upload-time = "2026-08-03T21:21:13.636Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "clr-loader"
|
||||||
|
version = "0.3.1"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "cffi" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/e4/46/7eea92b6aa2d68af78e049cbecec5f757f1aad44ecdecdc16bbad7eead51/clr_loader-0.3.1.tar.gz", hash = "sha256:2e073e9aaf49d1ae2f56ecba27987ad5fb68be4bcd9dd34a5bed8f0e4e128366", size = 86805, upload-time = "2026-04-18T17:49:44.287Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/5e/da/ec1a6e36624000b6df0dd61183c42342ee5814c073315e802cadaad04d2f/clr_loader-0.3.1-py3-none-any.whl", hash = "sha256:cbad189de20d202a7d621956b0fc38049e13c9bf7ca2923441eff725cd121aa1", size = 55730, upload-time = "2026-04-18T17:49:42.99Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "colorama"
|
||||||
|
version = "0.4.6"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "emoji"
|
||||||
|
version = "2.15.0"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/a2/78/0d2db9382c92a163d7095fc08efff7800880f830a152cfced40161e7638d/emoji-2.15.0.tar.gz", hash = "sha256:eae4ab7d86456a70a00a985125a03263a5eac54cd55e51d7e184b1ed3b6757e4", size = 615483, upload-time = "2025-09-21T12:13:02.755Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/e1/5e/4b5aaaabddfacfe36ba7768817bd1f71a7a810a43705e531f3ae4c690767/emoji-2.15.0-py3-none-any.whl", hash = "sha256:205296793d66a89d88af4688fa57fd6496732eb48917a87175a023c8138995eb", size = 608433, upload-time = "2025-09-21T12:13:01.197Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "iniconfig"
|
||||||
|
version = "2.3.0"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "macholib"
|
||||||
|
version = "1.16.4"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "altgraph" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/10/2f/97589876ea967487978071c9042518d28b958d87b17dceb7cdc1d881f963/macholib-1.16.4.tar.gz", hash = "sha256:f408c93ab2e995cd2c46e34fe328b130404be143469e41bc366c807448979362", size = 59427, upload-time = "2025-11-22T08:28:38.373Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/c7/d1/a9f36f8ecdf0fb7c9b1e78c8d7af12b8c8754e74851ac7b94a8305540fc7/macholib-1.16.4-py2.py3-none-any.whl", hash = "sha256:da1a3fa8266e30f0ce7e97c6a54eefaae8edd1e5f86f3eb8b95457cae90265ea", size = 38117, upload-time = "2025-11-22T08:28:36.939Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "markdown-it-py"
|
||||||
|
version = "4.2.0"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "mdurl" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/06/ff/7841249c247aa650a76b9ee4bbaeae59370dc8bfd2f6c01f3630c35eb134/markdown_it_py-4.2.0.tar.gz", hash = "sha256:04a21681d6fbb623de53f6f364d352309d4094dd4194040a10fd51833e418d49", size = 82454, upload-time = "2026-05-07T12:08:28.36Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/b3/81/4da04ced5a082363ecfa159c010d200ecbd959ae410c10c0264a38cac0f5/markdown_it_py-4.2.0-py3-none-any.whl", hash = "sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a", size = 91687, upload-time = "2026-05-07T12:08:27.182Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "mdurl"
|
||||||
|
version = "0.1.2"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729, upload-time = "2022-08-14T12:40:10.846Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "packaging"
|
||||||
|
version = "26.2"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/d7/f1/e7a6dd94a8d4a5626c03e4e99c87f241ba9e350cd9e6d75123f992427270/packaging-26.2.tar.gz", hash = "sha256:ff452ff5a3e828ce110190feff1178bb1f2ea2281fa2075aadb987c2fb221661", size = 228134, upload-time = "2026-04-24T20:15:23.917Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/df/b2/87e62e8c3e2f4b32e5fe99e0b86d576da1312593b39f47d8ceef365e95ed/packaging-26.2-py3-none-any.whl", hash = "sha256:5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e", size = 100195, upload-time = "2026-04-24T20:15:22.081Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pefile"
|
||||||
|
version = "2024.8.26"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/03/4f/2750f7f6f025a1507cd3b7218691671eecfd0bbebebe8b39aa0fe1d360b8/pefile-2024.8.26.tar.gz", hash = "sha256:3ff6c5d8b43e8c37bb6e6dd5085658d658a7a0bdcd20b6a07b1fcfc1c4e9d632", size = 76008, upload-time = "2024-08-26T20:58:38.155Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/54/16/12b82f791c7f50ddec566873d5bdd245baa1491bac11d15ffb98aecc8f8b/pefile-2024.8.26-py3-none-any.whl", hash = "sha256:76f8b485dcd3b1bb8166f1128d395fa3d87af26360c2358fb75b80019b957c6f", size = 74766, upload-time = "2024-08-26T21:01:02.632Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pluggy"
|
||||||
|
version = "1.6.0"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "proxy-tools"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/f2/cf/77d3e19b7fabd03895caca7857ef51e4c409e0ca6b37ee6e9f7daa50b642/proxy_tools-0.1.0.tar.gz", hash = "sha256:ccb3751f529c047e2d8a58440d86b205303cf0fe8146f784d1cbcd94f0a28010", size = 2978, upload-time = "2014-05-05T21:02:24.606Z" }
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pycparser"
|
||||||
|
version = "3.0"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/1b/7d/92392ff7815c21062bea51aa7b87d45576f649f16458d78b7cf94b9ab2e6/pycparser-3.0.tar.gz", hash = "sha256:600f49d217304a5902ac3c37e1281c9fe94e4d0489de643a9504c5cdfdfc6b29", size = 103492, upload-time = "2026-01-21T14:26:51.89Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/0c/c3/44f3fbbfa403ea2a7c779186dc20772604442dde72947e7d01069cbe98e3/pycparser-3.0-py3-none-any.whl", hash = "sha256:b727414169a36b7d524c1c3e31839a521725078d7b2ff038656844266160a992", size = 48172, upload-time = "2026-01-21T14:26:50.693Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pygments"
|
||||||
|
version = "2.20.0"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/c3/b2/bc9c9196916376152d655522fdcebac55e66de6603a76a02bca1b6414f6c/pygments-2.20.0.tar.gz", hash = "sha256:6757cd03768053ff99f3039c1a36d6c0aa0b263438fcab17520b30a303a82b5f", size = 4955991, upload-time = "2026-03-29T13:29:33.898Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/f4/7e/a72dd26f3b0f4f2bf1dd8923c85f7ceb43172af56d63c7383eb62b332364/pygments-2.20.0-py3-none-any.whl", hash = "sha256:81a9e26dd42fd28a23a2d169d86d7ac03b46e2f8b59ed4698fb4785f946d0176", size = 1231151, upload-time = "2026-03-29T13:29:30.038Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pyinstaller"
|
||||||
|
version = "6.21.0"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "altgraph" },
|
||||||
|
{ name = "macholib", marker = "sys_platform == 'darwin'" },
|
||||||
|
{ name = "packaging" },
|
||||||
|
{ name = "pefile", marker = "sys_platform == 'win32'" },
|
||||||
|
{ name = "pyinstaller-hooks-contrib" },
|
||||||
|
{ name = "pywin32-ctypes", marker = "sys_platform == 'win32'" },
|
||||||
|
{ name = "setuptools" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/d5/4d/ec706c3fcf39e26888c35b39615ff4d5865d184069666c47492cff1fbe50/pyinstaller-6.21.0.tar.gz", hash = "sha256:bb9fab705983e393a2d1cac77d6972513057ad800215fd861dc15ff5272e98fd", size = 4061519, upload-time = "2026-06-13T14:15:06.25Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/0c/4a/53cf98bf66daed012dc9cd78c8203f19a675d696f2fc12afcf8c5049a0e0/pyinstaller-6.21.0-py3-none-macosx_10_13_universal2.whl", hash = "sha256:327d132389f37912609e01be62810cf96b5aa95b613903e4b8692e0d12fb0eda", size = 1052350, upload-time = "2026-06-13T14:13:55.88Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/30/83/b591295c352ef464c50b4c6ffff1c4f771d875c9e833f578d1b9f564f6b3/pyinstaller-6.21.0-py3-none-manylinux2014_aarch64.whl", hash = "sha256:7071d4b094d5b40deeef5fa3d3b98a1b846087f7562b49209663d5f9281fe251", size = 748477, upload-time = "2026-06-13T14:14:00.327Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/3d/8f/88fff4e403873b1e22286911350e75ff00db014aa08e57045da9d4328993/pyinstaller-6.21.0-py3-none-manylinux2014_i686.whl", hash = "sha256:6b6374d652107dd4a2eeece903ff82bb4045bb5e1006c5a158a6dcdbefe84bf2", size = 760877, upload-time = "2026-06-13T14:14:04.836Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/8a/13/f0e48fbdfd1d05d948157121cea8b1b823dcb89efe6934b71fdd8bdb3f0f/pyinstaller-6.21.0-py3-none-manylinux2014_ppc64le.whl", hash = "sha256:4e3108b3f02384560da70e39b8bf22b0ad597d02bd68a40d76ea91c1cfa00cad", size = 759194, upload-time = "2026-06-13T14:14:10.61Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/dd/d5/ea7878cf9924ed30d946d8288777424e6d069d94f5bde56b4d0890069664/pyinstaller-6.21.0-py3-none-manylinux2014_s390x.whl", hash = "sha256:697532279f535ad572bda613db4f821540e235c7854ca6da4d3bf0373f4415ee", size = 754979, upload-time = "2026-06-13T14:14:15.226Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/9f/09/51b8905714b733bac66dbc041a7821372d70d888d273ae474c4037d4202d/pyinstaller-6.21.0-py3-none-manylinux2014_x86_64.whl", hash = "sha256:605169523a6b5ace39f13dfbff21add9f2bc43df99c7daf9394fefb2c45e8b6f", size = 754812, upload-time = "2026-06-13T14:14:20.264Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/4b/43/d77779439d8c6c2e27a77bcfbd1d5cc0f568ebb611bb472b11af81b5f177/pyinstaller-6.21.0-py3-none-musllinux_1_1_aarch64.whl", hash = "sha256:5fa56746c1e76f93634d018502301378a2d0c382553d37d8c3c34ff436c12dd1", size = 753887, upload-time = "2026-06-13T14:14:25.268Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/51/8f/c22df1f6837784ac349057ba693f08e7b1ca7a0e06f9c33c63bc6280007b/pyinstaller-6.21.0-py3-none-musllinux_1_1_x86_64.whl", hash = "sha256:42395ec76df8e8120c36b13339d9db8cab83e316a12839ee303cc00fc941bb74", size = 753779, upload-time = "2026-06-13T14:14:29.445Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/c9/76/1ce8a27ce62ba8cf3a87c9ce6d575610f4e55d7cb0123e7512fc3f4b921a/pyinstaller-6.21.0-py3-none-win32.whl", hash = "sha256:c6b28d30d8fd99ce162ff3aab5013ed44dbfb747566b1f01b9bed7964d7c14e9", size = 1336462, upload-time = "2026-06-13T14:14:35.785Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/c1/fa/ca1d7e5257dd8566a9dfc0dfb02f8a8075eeb53d4b2d3c579f1276759042/pyinstaller-6.21.0-py3-none-win_amd64.whl", hash = "sha256:7fae06c494ce0ebfe6bd3055c0e409def884f63af2e3705d06bd431ad9237fc7", size = 1397487, upload-time = "2026-06-13T14:14:42.328Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/dc/75/21b51523ce8d96629b71311775a0a65f5f5a872124ab0de33e5c848f8bff/pyinstaller-6.21.0-py3-none-win_arm64.whl", hash = "sha256:f13c95c9c03fb567217135919f93815c305813126780b0ed6e0123cb8acaf025", size = 1346094, upload-time = "2026-06-13T14:14:48.914Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pyinstaller-hooks-contrib"
|
||||||
|
version = "2026.6"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "packaging" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/94/5b/c9fe0db5e83ee1c39b2258fa21d23b15e1a60786b6c5990ee5074ead8bb6/pyinstaller_hooks_contrib-2026.6.tar.gz", hash = "sha256:bef5002c32f4f50bd55b005da12cff64eca8783e7eaf86a06a62410164bab725", size = 173354, upload-time = "2026-06-08T22:37:16.152Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/e7/31/f2d7343d8ed5f7c4678377886f6ce533e6eaaa131b252ce950114c2a7efa/pyinstaller_hooks_contrib-2026.6-py3-none-any.whl", hash = "sha256:fd13b8ac126b35361175edacd41a0d97080b75dd5f4b594ecefefff969509dd3", size = 457159, upload-time = "2026-06-08T22:37:14.722Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pyobjc-core"
|
||||||
|
version = "12.2.2"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/a5/78/abc4ce5920305780aeb36b4067a86253378b36e29ba96673a3deb02eb03a/pyobjc_core-12.2.2.tar.gz", hash = "sha256:3906452339cd06a3bb07df103c2511d4cb0f7a22d8771c0b802eba15d9a642b6", size = 1067701, upload-time = "2026-08-11T19:43:39.059Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/86/b2/bbf7f049880ab40d110e66f25122342a1f6c98d6fe3c59bb98985503c660/pyobjc_core-12.2.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:122e6ad302a2abf5d4d4adb0156db751600ddf2768441696cba17b31323085e7", size = 6427637, upload-time = "2026-08-11T14:51:36.038Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/1b/ed/a8bf040caf3704023d74086b7fb96cf4ed2e844e24bd94e5248ba214b700/pyobjc_core-12.2.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:950bd2d9c74634398c4e3d24ef2f213d4e23d705083697464fa67afedc53c1ad", size = 6427113, upload-time = "2026-08-11T15:04:39.424Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/e7/5a/760f8b9e116edd43c57e33844dc17619158fbdd311250d4209910192d72d/pyobjc_core-12.2.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:3772b406edb3ff78171530a17cda1c4a7817f87b87ded0d8715b3fa664df16db", size = 6666817, upload-time = "2026-08-11T19:30:17.01Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/13/37/486d38a173b0b8dce973a3e13c74cf402ed1b8621586b5963bc9efd49a48/pyobjc_core-12.2.2-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:2062e8ad30a310441cd022544a897553408bebeaa7820d5edba3c96fd7fd693b", size = 6421184, upload-time = "2026-08-11T19:30:21.081Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/04/f1/d138fd9b9a66ea8db56a8138b77d3413b85da3defe13363a19f364f85529/pyobjc_core-12.2.2-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:2c7ef3d2f865b4b3ebb14ec3556f7a3e8abb6d130c67275cd9daa08dbd6e4e4e", size = 6671824, upload-time = "2026-08-11T19:30:25.005Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/d5/85/577e2265cccf59daf48c460f0a8deeaf7dbe2991227a8859ab1eeab4945e/pyobjc_core-12.2.2-cp315-cp315-macosx_10_15_universal2.whl", hash = "sha256:89acc6bc13aaa6e3f52b0ce652ede7e201edb6bf062741b246b0c5a44582f25f", size = 6477694, upload-time = "2026-08-11T19:30:28.821Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/77/0a/bd9f830c64c6f334530831e75c01bfe0a770a3fbb00fddc70329223118b3/pyobjc_core-12.2.2-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:59a77038ebe0ab1240f61c341e7fb67b8674f2b4cd41bc71a6472511a12b50f7", size = 6712233, upload-time = "2026-08-11T19:30:33.032Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pyobjc-framework-cocoa"
|
||||||
|
version = "12.2.2"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "pyobjc-core" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/75/76/49c6da2c6a831020b4854ba20079d5a1030474bffc776b7b73c2eeff8c15/pyobjc_framework_cocoa-12.2.2.tar.gz", hash = "sha256:c96c0ef69a71afbbb0e6a7d594b455c5fe47d62e0db376ee7a2b4b828c16ace9", size = 3132831, upload-time = "2026-08-11T19:44:02.288Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/fd/2f/b67e73d8bc367e03fe7861cd9c49fff9dcfa6db83bc0630c0adcfb25b7fa/pyobjc_framework_cocoa-12.2.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:e106f395531e67694376b0f1184612cbeea3ec8b9bf56b55ef41d026171d2a2d", size = 388117, upload-time = "2026-08-11T19:32:43.161Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/db/e1/5d9b04ebb60042b9cb49adc2d33115e2f2c2e4ff7d548017bfaff8b7f536/pyobjc_framework_cocoa-12.2.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:600b1723184ca094931330e79355274949965460e23de38628d601b5a967baf9", size = 388181, upload-time = "2026-08-11T19:32:44.537Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/b4/25/2a343357d5fe09bbe9c0e294dc03450866a0d6c1792fad36b6bcc00174c0/pyobjc_framework_cocoa-12.2.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:875f2aad73963faa81a6b36ae674fd494a4658d6d999e1075e0e2aca3d2391df", size = 392275, upload-time = "2026-08-11T19:32:45.631Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/1f/1a/b99521999b9f54b89aad928ddff0faad507abfe33bc46599454bfa48a4b2/pyobjc_framework_cocoa-12.2.2-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:889d7bbd4ba2d4941078bfbbfb882138e51dbead27df006abfe0f2e0d49b5b2e", size = 388368, upload-time = "2026-08-11T19:32:46.781Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/6d/26/0c697dbc73dcc76bc0f68ea5aeed25bf7b05217df5102659e878501b2d5f/pyobjc_framework_cocoa-12.2.2-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:de69c5933750f3a4599ed962eccd92b6a71914c7e4318dacc7895738a8ae60d7", size = 392404, upload-time = "2026-08-11T19:32:47.918Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/df/82/502f740fd8f4e9ef741c9d40ba67467ab2c8196f2c09dcba12936d28a4fd/pyobjc_framework_cocoa-12.2.2-cp315-cp315-macosx_10_15_universal2.whl", hash = "sha256:0e8ace0d44a00d281281a723d17fcd05eea7544a38a6a512e1fd018ddb7aece2", size = 388585, upload-time = "2026-08-11T19:32:49.171Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/7d/3b/07ce3c0ab8d1e9e1bed74fea1bf1cce73527a365a7a23c755051d3be9865/pyobjc_framework_cocoa-12.2.2-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:8fe5b2e79c9530f667b4e58a87a3a15ea62f86a5d19eec405517ecbd4f454868", size = 392693, upload-time = "2026-08-11T19:32:50.283Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pyobjc-framework-quartz"
|
||||||
|
version = "12.2.2"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "pyobjc-core" },
|
||||||
|
{ name = "pyobjc-framework-cocoa" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/35/b1/426a37c7ae37280b3ffca2571fb48f211946aee2f4ca31a603ed1943c4a7/pyobjc_framework_quartz-12.2.2.tar.gz", hash = "sha256:810f97b210cfd93704d240860286dfd6df09f9f1c52525fc5c2166723aea3f9e", size = 3218295, upload-time = "2026-08-11T19:45:15.189Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/ed/e4/8be95d2ff850f82fb55b44c63333a00a920bf8a73642e7d9c2f3638a26d2/pyobjc_framework_quartz-12.2.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:7f668979d0c7320bf8f7ed6e030da578f93ab0f5dd619b295ec735cd8d5faa34", size = 219003, upload-time = "2026-08-11T19:40:24.425Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/bb/ae/b515852dbe491171f2f2e2eb7739588a5eb7f36720a739545337b8c0d706/pyobjc_framework_quartz-12.2.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:0ec9751904ef975bf0789d760dc4fadcb400edc4ffe4a736eb54971968babe5c", size = 219404, upload-time = "2026-08-11T19:40:25.461Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/ff/5f/c7ee66f4483385396d91f65036c62f3dd20bccaa07354643ef17b259aa75/pyobjc_framework_quartz-12.2.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:63f6f0f3233dcf650aac1374781e78961b0b17b33e3351953bacf8bd0c430593", size = 224462, upload-time = "2026-08-11T19:40:26.647Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/b1/33/230ae7777b0909fe2c24f28413c51c860faebf762d824b097a0e2fb48304/pyobjc_framework_quartz-12.2.2-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:1f7f3d9010e38f03ea1fa266664c10ea349cd7492bd603b403584f49d713dbed", size = 219773, upload-time = "2026-08-11T19:40:27.64Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/25/eb/7482fdd384521916e98a6164be220494b1f7794792b1d60fa3f5207d84a4/pyobjc_framework_quartz-12.2.2-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:ebf8167ca2096cf3a05199decfa517be0df4c56048f49cf132bd6b1a6ab9c086", size = 224726, upload-time = "2026-08-11T19:40:28.718Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/33/67/b4b0ffc486b08492bfef4b33731d044b295f1696c8fb7d119c8367079139/pyobjc_framework_quartz-12.2.2-cp315-cp315-macosx_10_15_universal2.whl", hash = "sha256:cee63b891c2b6b7ccf98f233175411529f3e80286f58438793b3634af79858f1", size = 219827, upload-time = "2026-08-11T19:40:29.764Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/aa/eb/5fb627c2457046883c6fd12d25c44db40c12bcde4622dc0f30851108e106/pyobjc_framework_quartz-12.2.2-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:8f58c589b5a76ba98f186b1f3b19fb1c8b730e82351f81fb62e6194f64a71622", size = 224767, upload-time = "2026-08-11T19:40:30.991Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pyobjc-framework-security"
|
||||||
|
version = "12.2.2"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "pyobjc-core" },
|
||||||
|
{ name = "pyobjc-framework-cocoa" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/c2/92/c304b7fc3a0fe7484a2a3cf25711e70c8fa2b6969d82f4010e35b9af2164/pyobjc_framework_security-12.2.2.tar.gz", hash = "sha256:33efab1ff7d18570148f8f3ddd44eca305f733aee00b9115d5263bef81018f65", size = 181827, upload-time = "2026-08-11T19:45:24.042Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/15/59/79722efbbb5cf6a313d364bb4faff39f9c165740e46acaa4d0a3d71c0f8c/pyobjc_framework_security-12.2.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:266f41995f2fc80660c8451bdb199a7e259a6cad02fbc1e0e2f69dd5576e2203", size = 41298, upload-time = "2026-08-11T19:41:27.54Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/f1/7f/cef885aaf57f7b8c1a5c141dc118094d07558f6c289fabd63690abf30059/pyobjc_framework_security-12.2.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ca580d5f56e1222d63f1322a4fbf63be0bad77e77cca084290310df007b3fdde", size = 41303, upload-time = "2026-08-11T19:41:28.427Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/87/4b/22e787fa03f44386d559a5bffca4e56f9d125c8616d13fb8c798b5968119/pyobjc_framework_security-12.2.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:67655616bd0b9e05bd6a18fa353c5a7bc1743f79f1774644dbb180a2c62bf65b", size = 42175, upload-time = "2026-08-11T19:41:29.188Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/47/b5/4040d093b67a155041325b518148cc432fe17de9968d4ed6f0279140b2a3/pyobjc_framework_security-12.2.2-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:c4726b41c96a611fa13880bcfcb38a32ac9256239adb5b48d559dc4d0c9d0b99", size = 41372, upload-time = "2026-08-11T19:41:30.101Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/f9/3b/0b02750d476dc5c05497f71cdd8f12a02f9a4db00c65d084abf651f4a057/pyobjc_framework_security-12.2.2-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:54b9b7a03f2e4a7e1ac182239d63cb94bc3628293f39637c17d3ececd495a619", size = 42930, upload-time = "2026-08-11T19:41:31.062Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/00/37/7fff93e2e36185b77ad824b00b9ea28ab95dfed110bd36710cc744a93916/pyobjc_framework_security-12.2.2-cp315-cp315-macosx_10_15_universal2.whl", hash = "sha256:786da49c319318bb4cf168755d4a9324a6b3720a3dd7503990249c2a27b661ee", size = 41376, upload-time = "2026-08-11T19:41:31.907Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/04/36/0dd489faa827bc56d2cf0de0e27a8bdba5267549e8f442a2407166be0f51/pyobjc_framework_security-12.2.2-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:f5afda32efbfdef150e921563b94a799ea104e575f4a95b8c5cd71a2322413a8", size = 42944, upload-time = "2026-08-11T19:41:32.694Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pyobjc-framework-uniformtypeidentifiers"
|
||||||
|
version = "12.2.2"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "pyobjc-core" },
|
||||||
|
{ name = "pyobjc-framework-cocoa" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/70/c6/31ac40c4d918baa36ca06d196bfec0f47f804a74684988cf424060469d98/pyobjc_framework_uniformtypeidentifiers-12.2.2.tar.gz", hash = "sha256:12f8ba77dcc949ffb9f0f48743cae326aebec8e69cb1ac55a1d1e04dca7bd59a", size = 20848, upload-time = "2026-08-11T19:45:37.634Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/79/c3/45ec69ed9fdcde5d0f229a031b610127c592d2c4674c3ff0e184d7f2741b/pyobjc_framework_uniformtypeidentifiers-12.2.2-py2.py3-none-any.whl", hash = "sha256:1dc6a538df07c410e4bfd6457adcb0b663a5e0df331905dbe135bcfd3f89ae57", size = 5045, upload-time = "2026-08-11T19:42:56.598Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pyobjc-framework-webkit"
|
||||||
|
version = "12.2.2"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "pyobjc-core" },
|
||||||
|
{ name = "pyobjc-framework-cocoa" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/6f/1f/766e338197f7051c25f23cb0d350caa88234b31c3a759127f2cbb67f3376/pyobjc_framework_webkit-12.2.2.tar.gz", hash = "sha256:e5588df2a73b377b59a994cc2a78b467e4341f4e4d28b52e8671e21a2811d3c1", size = 333834, upload-time = "2026-08-11T19:45:42.708Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/b9/76/344b197a89878e8b103727984f2815bc38393515be5bf63aa7b847c414e0/pyobjc_framework_webkit-12.2.2-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:ef37692f0280151bf8164a718e334a9b3cb0abfc5455be14172280de7e277505", size = 50371, upload-time = "2026-08-11T19:43:31.561Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/69/84/036541aaf4795c0022b6b1dda9a4e099e14b137012065a799a0b174947e5/pyobjc_framework_webkit-12.2.2-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:206f88451e1c3e152c72c16c2af2664646cd752a3007c9cda8029a9e3f0ec9a4", size = 50395, upload-time = "2026-08-11T19:43:32.434Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/46/f9/8525d01afc8e7898ef395e55891d932111099a3770b2e5f0eb901a57f3ca/pyobjc_framework_webkit-12.2.2-cp313-cp313t-macosx_10_13_universal2.whl", hash = "sha256:36bea435489daa20ead1390d6bf0b98659beac0fc5a281e502acc5da334ec9eb", size = 50865, upload-time = "2026-08-11T19:43:33.263Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/37/2e/1f815581ca8884d1cc1a577f98ed0f43454bb3aa12c4aa7562d33c18c353/pyobjc_framework_webkit-12.2.2-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:83a5c250125ecaaf680a405cf435a038e4b168d0305ba7ad14398d810a49cf87", size = 50502, upload-time = "2026-08-11T19:43:34.126Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/f8/fb/3d48fb3deb0a57d25c118684dd13f702f856cadfcbd553b9a1ff5c8ba5fc/pyobjc_framework_webkit-12.2.2-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:147f0f18c0ddd70a1d05f88cf42a89b423b191957db6faf508cbbdb33092864c", size = 50971, upload-time = "2026-08-11T19:43:34.963Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/56/79/5dfb4cb4cc3bf1f534a154fd6d9737a53288224e5eeca14cb0a4b18e5665/pyobjc_framework_webkit-12.2.2-cp315-cp315-macosx_10_15_universal2.whl", hash = "sha256:0be3ed885100dd38c6b927c9a25a63f22fd624bc4c6bb3d3af14fab5dcdcfc97", size = 50501, upload-time = "2026-08-11T19:43:35.835Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/03/5b/e1e2f3f2a2d9194467898494cf102eaa96db1a395278a961861254ba0c48/pyobjc_framework_webkit-12.2.2-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:88c896d89764675af1ef85c6bda8740e50451e31bcd1d1d2ef59323acc9916ed", size = 50963, upload-time = "2026-08-11T19:43:37.152Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pytest"
|
||||||
|
version = "9.1.1"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "colorama", marker = "sys_platform == 'win32'" },
|
||||||
|
{ name = "iniconfig" },
|
||||||
|
{ name = "packaging" },
|
||||||
|
{ name = "pluggy" },
|
||||||
|
{ name = "pygments" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/e4/47/b9efed96c114afcfa3c9d3fe98a76a1d14c74a9e266d397cf6eb64be5e01/pytest-9.1.1.tar.gz", hash = "sha256:1088fbde8f2b49d95a549a195707afa7a76a3ce9bcadc26b6d71f0ffda5fe313", size = 1636369, upload-time = "2026-06-19T10:58:32.857Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/24/25/1de2678b631f5a49215c6c96fff41ba892b0a34df68d6d80292b1b48aa7f/pytest-9.1.1-py3-none-any.whl", hash = "sha256:37a86b45efb9a47a61a36449063e8e18d0cab3161329fc099eb21783169c4f0c", size = 386536, upload-time = "2026-06-19T10:58:31.347Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "python-yakh"
|
||||||
|
version = "0.4.1"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/d2/77/bbff0a1e6fb03b8cc2cc373a44cfbbb4fd22863c657f8630f4a0f5eb207c/python_yakh-0.4.1.tar.gz", hash = "sha256:da03e800b4f2f5d85344f1668e852687c12dc1a99a03c65cf3dc13a3680da49d", size = 3988, upload-time = "2025-01-14T18:08:15.767Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/22/42/72571b24514b5f59c328f12e5294b246958951b889fac2bd5321e08a4bab/python_yakh-0.4.1-py3-none-any.whl", hash = "sha256:d69507e13e03d09cefd88030f74b6d5369b67de004be975a35be28eb286122e4", size = 5826, upload-time = "2025-01-14T18:08:13.618Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pythonnet"
|
||||||
|
version = "3.1.0"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "clr-loader" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/05/57/da1992e44663b71365c6e842c8d7fa453d4ec45fb99a68cfee5b7e944d3c/pythonnet-3.1.0.tar.gz", hash = "sha256:7b34c382905d10a371509ffafd64cae0416305c28817738a9cd138336f4e9991", size = 250599, upload-time = "2026-05-23T20:30:21.578Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/ac/4b/52414f442624d2589f5374a48c08d5ae94f24bea67fc13a20a752884e5b7/pythonnet-3.1.0-cp310.cp311.cp312.cp313.cp314-none-any.whl", hash = "sha256:698dd88edc198819ad63b624a6ebe76208c7b46e4fe13626f65e484f0358d6ba", size = 217578, upload-time = "2026-05-23T20:30:19.527Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/db/67/031124fdcb937c266a3265118525bbf6dc13b8c79786d6a7290aecb6e7bb/pythonnet-3.1.0-cp310.cp311.cp312.cp313.cp314-none-win32.win_amd64.whl", hash = "sha256:7bdd4de03df3547a48122a3989265c8b31d5be0d19dadffa009eec7df8085e0b", size = 1644898, upload-time = "2026-05-23T20:30:16.213Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pywebview"
|
||||||
|
version = "6.2.1"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "bottle" },
|
||||||
|
{ name = "proxy-tools" },
|
||||||
|
{ name = "pyobjc-core", marker = "sys_platform == 'darwin'" },
|
||||||
|
{ name = "pyobjc-framework-cocoa", marker = "sys_platform == 'darwin'" },
|
||||||
|
{ name = "pyobjc-framework-quartz", marker = "sys_platform == 'darwin'" },
|
||||||
|
{ name = "pyobjc-framework-security", marker = "sys_platform == 'darwin'" },
|
||||||
|
{ name = "pyobjc-framework-uniformtypeidentifiers", marker = "sys_platform == 'darwin'" },
|
||||||
|
{ name = "pyobjc-framework-webkit", marker = "sys_platform == 'darwin'" },
|
||||||
|
{ name = "pythonnet", marker = "sys_platform == 'win32'" },
|
||||||
|
{ name = "qtpy", marker = "sys_platform == 'openbsd6'" },
|
||||||
|
{ name = "typing-extensions" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/59/4a/05307135dafba67778669d194bd1a3822a7685ec9ee8a6d7e70856c1a551/pywebview-6.2.1.tar.gz", hash = "sha256:71b7136752e40824655304d938efb62014218d1a90bd8e87e1cbdb1ce9c466af", size = 513126, upload-time = "2026-04-15T09:02:16.595Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/3d/25/9491695c22c4842c5b3903b4dc172e0eecf67a27c0af34a71512c9b76a0a/pywebview-6.2.1-py3-none-any.whl", hash = "sha256:9d07275f53894ab4d5e2e0e996227193e7187dec276d9b624dccbce029216b46", size = 525463, upload-time = "2026-04-15T09:02:10.186Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pywin32"
|
||||||
|
version = "312"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/83/ff/32aa7d2ed0ab12b323aaa64f9b75e6ad4f8fd09f9ccfc28c79414d46838d/pywin32-312-cp312-cp312-win32.whl", hash = "sha256:dab4f65ac9c4e48400a2a0530c46c3c579cd5905ecd11b80692373915269208b", size = 6371877, upload-time = "2026-06-04T07:49:28.836Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/03/d9/77040d3b43df3f3be32ea289433d660d2727f5ba327bc73be835127d9d60/pywin32-312-cp312-cp312-win_amd64.whl", hash = "sha256:b457f6d628a47e8a7346ce22acb7e1a46a4a78b52e1d17e1af56871bd19a93bc", size = 6914841, upload-time = "2026-06-04T07:49:31.85Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/e3/cc/7b1ec671775756020a0ee7f4feeaf3c568f0ab86bd3900088cf986937a92/pywin32-312-cp312-cp312-win_arm64.whl", hash = "sha256:6017c58e12f6809fbb0555b75df144c2922a9ffd18e4b9b5afa863b6c1a9d950", size = 6727901, upload-time = "2026-06-04T07:49:34.244Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/2d/41/12fbfd7f36ed2146d8bc9de96c2741296bf0d490b98508496cff322e274c/pywin32-312-cp313-cp313-win32.whl", hash = "sha256:7a27df850933d16a8eabfbaeb73d52b273e2da667f80d70b01a89d1f6828d02c", size = 6370184, upload-time = "2026-06-04T07:49:36.253Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/ba/db/36a78e3403099d31d9746d13fdcde5accc43c1155f375a34d15983a479a7/pywin32-312-cp313-cp313-win_amd64.whl", hash = "sha256:c53e878d15a1c44788082bfe712a905433473aa38f86375b7cf8b45e3acbaaf9", size = 6914298, upload-time = "2026-06-04T07:49:38.876Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/84/37/c1697194092b76de9ed47ca124323f02c57ffc8a45c06f88a3d5acaf01eb/pywin32-312-cp313-cp313-win_arm64.whl", hash = "sha256:59aba5d5940842075343a5ddc6b11f1cdf0d1567fe745290359dfbcc7c2eb831", size = 6727640, upload-time = "2026-06-04T07:49:41.083Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/fc/2b/1f3cded5822fd49c02f40544cbb5f58c7cfd6b1694869fd476cb6170ee97/pywin32-312-cp314-cp314-win32.whl", hash = "sha256:a77a90fbb6881238d2ca9c6fd797b25817f3768fe78d214a90137ff055a75f5b", size = 6468928, upload-time = "2026-06-04T07:49:43.188Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/21/82/3bf86d2e2808902013132e1ce905a7da0da53790f3836c64bf44d55e24f3/pywin32-312-cp314-cp314-win_amd64.whl", hash = "sha256:a4dd3a848290ef724347b19f301045831d8e802fa4464f491b98b1e0a081432e", size = 7024157, upload-time = "2026-06-04T07:49:45.34Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/a4/0e/73f6d6800b4f27655abd9e9f6aaeaefcddb2b946e4674efa2bab184a7f7b/pywin32-312-cp314-cp314-win_arm64.whl", hash = "sha256:9fce94568364e0155e6dfb781ac5d95903be8baf28670632beab1b523f300daa", size = 6839598, upload-time = "2026-06-04T07:49:47.613Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/eb/61/caa39686032d2ebdd04ff0ab5cbe163126c0066d98e00c9018646e42393b/pywin32-312-cp315-cp315-win32.whl", hash = "sha256:5c1fbe4a937a73ae9297384a3da38518cbc694c68ad8a809b2e19acd350f03ed", size = 6471159, upload-time = "2026-06-04T07:49:50.035Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/0f/cd/7e1de64a4a6f69c04214169657ccab0d93a670ea50e35eb8f489d7378249/pywin32-312-cp315-cp315-win_amd64.whl", hash = "sha256:c2f03a0f73f804a13c2735b99392b0cd426bb4f2c4d0178e5ac966a0f21618d5", size = 7025293, upload-time = "2026-06-04T07:49:54.857Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/23/ed/4532e9388e65fa16b46776ef47ad631a64eda1631884488af707666350ed/pywin32-312-cp315-cp315-win_arm64.whl", hash = "sha256:a8597d28f267b39074aef51fa593530082b39cbe5a074226096857b1fed2dfb9", size = 6840337, upload-time = "2026-06-04T07:49:57.531Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pywin32-ctypes"
|
||||||
|
version = "0.2.3"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/85/9f/01a1a99704853cb63f253eea009390c88e7131c67e66a0a02099a8c917cb/pywin32-ctypes-0.2.3.tar.gz", hash = "sha256:d162dc04946d704503b2edc4d55f3dba5c1d539ead017afa00142c38b9885755", size = 29471, upload-time = "2024-08-14T10:15:34.626Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/de/3d/8161f7711c017e01ac9f008dfddd9410dff3674334c233bde66e7ba65bbf/pywin32_ctypes-0.2.3-py3-none-any.whl", hash = "sha256:8a1513379d709975552d202d942d9837758905c8d01eb82b8bcc30918929e7b8", size = 30756, upload-time = "2024-08-14T10:15:33.187Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "qtpy"
|
||||||
|
version = "2.4.3"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "packaging" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/70/01/392eba83c8e47b946b929d7c46e0f04b35e9671f8bb6fc36b6f7945b4de8/qtpy-2.4.3.tar.gz", hash = "sha256:db744f7832e6d3da90568ba6ccbca3ee2b3b4a890c3d6fbbc63142f6e4cdf5bb", size = 66982, upload-time = "2025-02-11T15:09:25.759Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/69/76/37c0ccd5ab968a6a438f9c623aeecc84c202ab2fabc6a8fd927580c15b5a/QtPy-2.4.3-py3-none-any.whl", hash = "sha256:72095afe13673e017946cc258b8d5da43314197b741ed2890e563cf384b51aa1", size = 95045, upload-time = "2025-02-11T15:09:24.162Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "questo"
|
||||||
|
version = "0.4.2"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "python-yakh" },
|
||||||
|
{ name = "rich" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/a8/e6/4a86ccd5710c2fddae92786f15f2c69637b417905ff239d7424b55e342cb/questo-0.4.2.tar.gz", hash = "sha256:bcc917c2f1a65872e2bd02e79e226a716fd2d68a1ebe0d23c1828aa116aa6da6", size = 10474, upload-time = "2025-11-30T13:08:59.403Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/04/9e/2669ac7d718539a3783c3a6c440b3440b68193b59d763d7f89d33c0b1e8e/questo-0.4.2-py3-none-any.whl", hash = "sha256:1afce34a638601b54fbd697e99e7551813fafb513fe523165394eb12f9607b43", size = 12442, upload-time = "2025-11-30T13:08:57.602Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rich"
|
||||||
|
version = "15.0.0"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "markdown-it-py" },
|
||||||
|
{ name = "pygments" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/c0/8f/0722ca900cc807c13a6a0c696dacf35430f72e0ec571c4275d2371fca3e9/rich-15.0.0.tar.gz", hash = "sha256:edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36", size = 230680, upload-time = "2026-04-12T08:24:00.75Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/82/3b/64d4899d73f91ba49a8c18a8ff3f0ea8f1c1d75481760df8c68ef5235bf5/rich-15.0.0-py3-none-any.whl", hash = "sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb", size = 310654, upload-time = "2026-04-12T08:24:02.83Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "setuptools"
|
||||||
|
version = "83.0.0"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/34/26/f5d29e25ffdb535afef2d35cdb55b325298f96debd670da4c325e08d70f4/setuptools-83.0.0.tar.gz", hash = "sha256:025bccbbf0fa05b6192bc64ae1e7b16e001fd6d6d4d5de03c97b1c1ade523bef", size = 1154254, upload-time = "2026-07-04T15:31:22.699Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/5d/40/e1e72872c6354b306daef1703549e8e83b4d43cfea356311bf722a043752/setuptools-83.0.0-py3-none-any.whl", hash = "sha256:29b23c360f22f414dc7336bb39178cc7bcbf6021ed2733cde173f09dba19abb3", size = 1008090, upload-time = "2026-07-04T15:31:20.885Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "typing-extensions"
|
||||||
|
version = "4.16.0"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/f6/cc/6253133b5bb138fc3306cebfbda2c520f545d36b5be2c7255cc528bb45d6/typing_extensions-4.16.0.tar.gz", hash = "sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5", size = 113555, upload-time = "2026-07-02T08:40:05.92Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/49/d3/b8441a820a491ddfc024b0b0cf0393375b75ea13866d9c66727e54c2fc80/typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8", size = 45571, upload-time = "2026-07-02T08:40:04.659Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "xlsx-clean"
|
||||||
|
version = "1.0.0"
|
||||||
|
source = { editable = "." }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "beaupy" },
|
||||||
|
{ name = "pywebview" },
|
||||||
|
{ name = "pywin32", marker = "sys_platform == 'win32'" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[package.optional-dependencies]
|
||||||
|
desktop = [
|
||||||
|
{ name = "pyinstaller" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[package.dev-dependencies]
|
||||||
|
test = [
|
||||||
|
{ name = "pytest" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[package.metadata]
|
||||||
|
requires-dist = [
|
||||||
|
{ name = "beaupy", specifier = ">=3.12.0" },
|
||||||
|
{ name = "pyinstaller", marker = "extra == 'desktop'", specifier = ">=6.21.0" },
|
||||||
|
{ name = "pywebview", specifier = ">=5.0" },
|
||||||
|
{ name = "pywin32", marker = "sys_platform == 'win32'", specifier = ">=312" },
|
||||||
|
]
|
||||||
|
provides-extras = ["desktop"]
|
||||||
|
|
||||||
|
[package.metadata.requires-dev]
|
||||||
|
test = [{ name = "pytest", specifier = ">=8.0" }]
|
||||||
Reference in New Issue
Block a user