AnniversariesGramplet: import WindowActiveError#843
Merged
GaryGriffin merged 1 commit intoMay 13, 2026
Conversation
`AnniversariesGramplet/AnniversariesGramplet.py:103` references
`WindowActiveError` in an `except` clause but never imports it. Ruff
(`F821`) flags this:
F821 Undefined name `WindowActiveError`
--> AnniversariesGramplet/AnniversariesGramplet.py:103:20
The exception is raised by `gramps.gui.editors.EditEvent` when the
editor is already open for the same handle; `WindowActiveError` lives
in `gramps.gen.errors`. Without the import, the `except` clause would
trigger `NameError` if an editor were already open — masked today only
because that path is rare.
Add the missing import alongside the other `gramps.gen.*` imports.
One-line change, no behavioural impact under normal use; fixes the
`NameError` on the active-editor path.
Verified locally with `ruff check --select=E9,F63,F7,F82 --no-fix
--exclude='*.gpr.py' AnniversariesGramplet/` (now passes) and
`python3 -m py_compile`.
Contributor
Author
|
@GaryGriffin - this is the first of 70 linting issues found in 27 add-ons. I didn't want to dump it all on you right away and happy to space it out the way you would like best. alternatively, I can do all 26 PRs at one go and you can merge as you see fit. |
Member
|
I am fine with 26 more PRs. I will also cherry pick each to gramps61. I may not wait my traditional week before merging. |
GaryGriffin
added a commit
that referenced
this pull request
May 13, 2026
GaryGriffin
added a commit
that referenced
this pull request
May 13, 2026
eduralph
added a commit
to eduralph/addons-source
that referenced
this pull request
May 19, 2026
…ps60 Drops the lint job's continue-on-error: true (and its TODO comment), making ruff E9/F63/F7/F82 a blocking gate per the comment's own instruction. The ruff backlog the comment guarded against was cleared by 24 PRs (gramps-project#843 + gramps-project#847-gramps-project#869) merged into maintenance/gramps60 between 2026-05-12 and 2026-05-18. Verified locally: pipx run ruff check --select=E9,F63,F7,F82 \ --no-fix --exclude='*.gpr.py' . on `gramps-project/addons-source:maintenance/gramps60` reports "All checks passed!". Other continue-on-error gates in this workflow (addon-structure, compile-check, integration) each guard their own backlogs and stay non-blocking until those clear separately. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
eduralph
added a commit
to eduralph/addons-source
that referenced
this pull request
May 19, 2026
…ared Drops continue-on-error: true (and the TODO comments) from both unit-test jobs. They were guarding against "currently-broken addon unit modules (import failures, stale API usage)" that have since been fixed by the merged plugin-registration / dep-declaration round (gramps-project#875 WordleGramplet, gramps-project#876 SourceReferences, gramps-project#878 EditExifMetadata, gramps-project#879 MongoDB, gramps-project#880 PhotoTaggingGramplet, gramps-project#869 SurnameMappingGramplet, gramps#2299 ClipboardGramplet) plus the lint backlog (gramps-project#843, gramps-project#847-gramps-project#869). Verified by the most recent fork CI run on eduralph/addons-source:maintenance/gramps60 (sha 8aabdd4, 2026-05-18): both Unit Tests (Linux) and Unit Tests (Windows) reported success. Also clears two stale comments that referenced the removed flag: - unit-test-linux's "Run per-addon unit tests" step: drop the trailing "Falls silently under continue-on-error." sentence. - integration's requires_mod-validate step: collapse the now-moot "this is the blocking copy" rationale to a plain pointer at unit-test-linux. The lone remaining continue-on-error is on addon-structure (line 70), gated by the po/template.pot backlog. PRs gramps-project#838-gramps-project#841 were closed without merge; per Eduard's call the po/template.pot check stays non-blocking for now. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AnniversariesGramplet/AnniversariesGramplet.py:103referencesWindowActiveErrorin anexceptclause but never imports it. Ruff (ruleF821) flags this:The exception is raised by
gramps.gui.editors.EditEventwhen the editor is already open for the same handle;WindowActiveErrorlives ingramps.gen.errors. Without the import, theexceptclause would triggerNameErrorif an editor were already open — a real (if rare) runtime bug masked today only because that path is uncommon.Fix
Add the missing import alongside the other
gramps.gen.*imports:from gramps.gen.config import config +from gramps.gen.errors import WindowActiveError from gramps.gui.editors import EditEventOne-line change, no behavioural impact under normal use; fixes the
NameErroron the active-editor path.Verification
ruff check --select=E9,F63,F7,F82 --no-fix --exclude='*.gpr.py' AnniversariesGramplet/→ "All checks passed!" (was 1 F821).python3 -m py_compile AnniversariesGramplet/AnniversariesGramplet.pyexits 0.Scope
Per addons-source convention, one PR per addon directory. This is the first of an upstream-friendly per-addon series clearing the lint backlog (the same set PR #820's body originally enumerated). Each subsequent PR will be similarly minimal and addon-scoped.
🤖 Generated with Claude Code