Skip to content

Fix crash-causing bugs from automated PEP8 pass and broken imports - #1

Merged
pQu4k3r merged 2 commits into
mainfrom
develop
Sep 1, 2026
Merged

Fix crash-causing bugs from automated PEP8 pass and broken imports#1
pQu4k3r merged 2 commits into
mainfrom
develop

Conversation

@pQu4k3r

@pQu4k3r pQu4k3r commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

The "Apply auto PEP8 aggressive fixes" commit split several f-strings
across multiple lines with a literal newline inside the {} expression.
That's a hard SyntaxError on any Python before 3.12 (Enigma2 boxes run
3.8/3.9), so analisi_screen.py, archivio_screen.py,
superenalotto_screen.py and dieci_lotto_screen.py failed to import at
all, breaking the whole plugin. Collapsed them back to single-line
f-strings.

main_screen.py imported a function name (aggiorna_archivio) that was
never called, while the names actually called in ok_pressed
(update_archive, download_and_convert_se) were never imported at all -
pressing "Update Lotto Archive" or "Update Superenalotto" raised
NameError. Fixed the imports to match what's actually used.

Also cleaned up dead/broken code found during the audit:

  • Removed translate_utils.py, an unused leftover from an unrelated
    "Foreca One Weather" plugin that imported a SYSTEM_DIR constant
    never defined in this plugin (would ImportError if ever used).
  • Removed unused json imports in core/update.py and
    core/update_superenalotto.py.
  • Removed a dead get_archive() call in get_dieci_lotto().
  • generate_fake_se_archive() now persists its generated archive via
    save_superenalotto_archive(), matching generate_fake_archive()'s
    behavior instead of regenerating random fake data on every call.

The "Apply auto PEP8 aggressive fixes" commit split several f-strings
across multiple lines with a literal newline inside the {} expression.
That's a hard SyntaxError on any Python before 3.12 (Enigma2 boxes run
3.8/3.9), so analisi_screen.py, archivio_screen.py,
superenalotto_screen.py and dieci_lotto_screen.py failed to import at
all, breaking the whole plugin. Collapsed them back to single-line
f-strings.

main_screen.py imported a function name (aggiorna_archivio) that was
never called, while the names actually called in ok_pressed
(update_archive, download_and_convert_se) were never imported at all -
pressing "Update Lotto Archive" or "Update Superenalotto" raised
NameError. Fixed the imports to match what's actually used.

Also cleaned up dead/broken code found during the audit:
- Removed translate_utils.py, an unused leftover from an unrelated
  "Foreca One Weather" plugin that imported a SYSTEM_DIR constant
  never defined in this plugin (would ImportError if ever used).
- Removed unused `json` imports in core/update.py and
  core/update_superenalotto.py.
- Removed a dead get_archive() call in get_dieci_lotto().
- generate_fake_se_archive() now persists its generated archive via
  save_superenalotto_archive(), matching generate_fake_archive()'s
  behavior instead of regenerating random fake data on every call.
The script had Windows-style CRLF line terminators, which broke bash
parsing on the target box (BusyBox/Enigma2 Linux): '$'\r'': command
not found' and a syntax error on the cleanup() function definition.
Converted to LF and pinned *.sh to eol=lf in .gitattributes so this
can't silently reintroduce itself.
@pQu4k3r
pQu4k3r merged commit 60c8b56 into main Sep 1, 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