Skip to content

Small cleanups: duplicate QTimer import + set_check_box_state hygiene#292

Open
razinkele wants to merge 2 commits into
bpozdena:mainfrom
razinkele:fix/pyflakes-cleanup
Open

Small cleanups: duplicate QTimer import + set_check_box_state hygiene#292
razinkele wants to merge 2 commits into
bpozdena:mainfrom
razinkele:fix/pyflakes-cleanup

Conversation

@razinkele
Copy link
Copy Markdown

Summary

Two small no-behavior-change cleanups surfaced by pyflakes on the post-restructure source tree:

  • src/main_window.py — Remove the duplicate QTimer at the end of the from PySide6.QtCore import … line. Python silently dedupes, so no runtime impact, but the duplicate is a leftover from the monolithic-to-modular extraction.
  • src/profile_settings_window.py (set_check_box_state) — Three small fixes to one function:
    • Remove the unused local sender = self.sender() (assigned but never used).
    • Remove the leftover print("test " + _property) debug line.
    • Narrow the bare except: to except AttributeError: — the exception that re.search(...).group(1) actually raises when there is no match. The bare form would also swallow KeyboardInterrupt, SystemExit, and unrelated bugs.

Test plan

  • All files in src/ compile cleanly under Python 3.12 (python3 -m compileall -q src/)
  • Pyflakes no longer reports the two findings the PR addresses (pyflakes src/main_window.py src/profile_settings_window.py)
  • Normal control flow unchanged — the bare-except → AttributeError change preserves the existing fall-through behavior for the documented checkBox/groupBox name patterns; only out-of-band exceptions (e.g. KeyboardInterrupt) are no longer suppressed.

razinkele and others added 2 commits May 12, 2026 11:03
`QTimer` appeared twice in the same `from PySide6.QtCore import ...` line,
a likely artifact of the monolithic-to-modular extraction. Python silently
deduplicates so there is no behavior change, but pyflakes flagged it.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Three small fixes to one function:
- Remove unused `sender = self.sender()` local (assigned but never used)
- Remove leftover `print("test " + _property)` debug line
- Narrow bare `except:` to `except AttributeError:` — matches the
  exception `re.search(...).group(1)` actually raises when there is no
  match, and stops swallowing unrelated errors (KeyboardInterrupt etc.)

No behavior change for normal control flow.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant