Skip to content

Fix remaining audit follow-ups: UI freeze, Python 3 requirement, dead code cleanup - #3

Merged
pQu4k3r merged 4 commits into
mainfrom
develop
Sep 7, 2026
Merged

Fix remaining audit follow-ups: UI freeze, Python 3 requirement, dead code cleanup#3
pQu4k3r merged 4 commits into
mainfrom
develop

Conversation

@pQu4k3r

@pQu4k3r pQu4k3r commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #2, closing out the remaining items from the full repository audit that were previously excluded pending further review.

  • Low-severity cleanup: fixed unit_manager.py's "left" key never reaching the metric preset; removed a dead, broken download_tile_grid_async method in foreca_map_api.py (copy-paste leftover referencing attributes that don't exist on that class, zero callers) plus its now-unused imports; fixed a stale hardcoded version string in CONTROL/prerm; documented installer.sh as the recommended install method in README.
  • _load_favorite fully backgrounded: this is the core weather-refresh path, triggered on every arrow-key press and favorite selection. It previously ran all network calls synchronously on the UI thread, freezing the whole Enigma2 UI. Network fetching now runs in a background thread; only the final widget updates run via reactor.callFromThread. Added a sequence guard so a superseded request (from rapid key presses) can't overwrite a newer one with stale data. _update_fav_button_names had the same blocking-network-calls-on-UI-thread problem (3x get_location_by_id) and got the same treatment.
  • Python 3 requirement enforced in install scripts: README and the Yocto recipe (enigma2-plugin-extensions-foreca-one.bb) already declare Python 3 only (the code uses f-strings throughout, which are a SyntaxError under Python 2), but installer.sh and CONTROL/preinst still had dead Python 2 branches that installed the wrong package names and reported false success on Python-2-only systems. Both now require Python 3 explicitly and fail with a clear error otherwise. Also fixed installer.sh's version check itself (it ran python --version, which fails outright on images that only ship a python3 binary), and a separate pre-existing bug where Packagepillow was computed but never actually installed.
  • slideshow.py: switched an HTTP image fetch to HTTPS (existing error handling already covers a TLS-incompatible host gracefully).
  • Removed dead code: translate_utils.py had zero references anywhere in the codebase (confirmed via repo-wide search) and duplicated google_translate.py's caching logic.

pQu4k3r and others added 4 commits September 7, 2026 21:07
- unit_manager.py: UnitSettingsSimple's "left" action called self.down
  instead of self.up, so the metric preset (labeled "Prev") could
  never be reached with the left key.
- foreca_map_api.py: removed a dead, broken download_tile_grid_async
  method referencing attributes that don't exist on this class
  (self.api, self.center_lat, self.merge_tile_grid, etc.) - a
  copy-paste leftover with zero callers; the real, working version
  lives on the screen class in foreca_map_viewer.py. Also dropped
  the now-unused Thread/PIL.Image imports.
- CONTROL/prerm: updated a hardcoded stale version string
  ("v.1.0.0") to match the current plugin version (1.3.1).
- README.md: documented installer.sh as the recommended automatic
  install method (handles dependencies), alongside the existing
  manual copy instructions.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UPpumFb2PP21ATpDwJBYBB
…HTTPS

- plugin.py: fully backgrounded _load_favorite (the core weather-refresh
  path, run on every arrow-key press and favorite selection), which
  previously ran all network calls synchronously on the UI thread and
  froze the whole Enigma2 UI. Network fetching now runs in a background
  thread; only the final widget updates run via reactor.callFromThread.
  Added a sequence guard so a superseded request (from rapid key
  presses) can't overwrite a newer one with stale data.
  _update_fav_button_names had the same blocking-network-calls-on-UI-
  thread problem (3x get_location_by_id) and got the same treatment.
- installer.sh: removed the dead Python 2 code path. README.md and the
  Yocto recipe (enigma2-plugin-extensions-foreca-one.bb) already declare
  Python 3 only, so branching for "Python2 image detected" just
  installed the wrong package names and gave a false success message
  on Python-2-only systems where the plugin could never actually load
  (f-strings are used throughout). Now requires python3 explicitly and
  fails with a clear error otherwise. Also fixed the Python-version
  check itself: it ran `python --version`, which fails outright on
  images that only ship a `python3` binary (no unversioned `python`),
  misdetecting them as Python 2. Also fixed a separate pre-existing
  bug: Packagepillow was computed but install_pkg was never actually
  called on it, so installer.sh never really installed Pillow despite
  several modules importing it.
- CONTROL/preinst: same Python 3 requirement fix as installer.sh.
- slideshow.py: switched the wetterkontor map image fetch from HTTP to
  HTTPS; the existing try/except already handles connection failures
  gracefully, so a TLS-incompatible host would fail the same way any
  other network hiccup already does.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UPpumFb2PP21ATpDwJBYBB
Confirmed zero references anywhere in the codebase (verified via
grep across all plugin files). It duplicated google_translate.py's
translation-cache logic under a different, unused entry point.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UPpumFb2PP21ATpDwJBYBB
Patch release covering the bug fixes from the full repository audit
(crash fixes, security fixes, UI-freeze fixes, Python 3 enforcement,
dead code removal). Updated the version string everywhere it's
declared: __init__.py, installer.sh (also updated its changelog
shown by the in-plugin update checker), CONTROL/control,
CONTROL/prerm, and the README badge. The Yocto recipe
(enigma2-plugin-extensions-foreca-one.bb) uses its own git-hash-based
PV scheme and is intentionally left untouched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UPpumFb2PP21ATpDwJBYBB
@pQu4k3r
pQu4k3r merged commit d22c50a into main Sep 7, 2026
6 checks passed
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