Skip to content

removed the dead theme block in moon_engine.py - #159

Merged
LeyckerS merged 1 commit into
LeyckerS:mainfrom
AashishGupta2007:fix/remove-dead-theme-block
Aug 8, 2026
Merged

removed the dead theme block in moon_engine.py#159
LeyckerS merged 1 commit into
LeyckerS:mainfrom
AashishGupta2007:fix/remove-dead-theme-block

Conversation

@AashishGupta2007

@AashishGupta2007 AashishGupta2007 commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Description

I have removed the dead theme block at the top of moon_engine.py as it had no use in the code due to the introduction of web/styles.css, which has its own palette in CSS custom properties and shares not one hex value with this block.

Addresses #145

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would change existing behavior)
  • Documentation update
  • Refactor / code cleanup
  • Other:

Checklist

  • I have tested my changes locally
  • If this affects shared logic (extraction, download engine), I also
    applied the equivalent change to moon_cli.py
    — not applicable: this removes an unused constant block with zero
    references, no shared logic touched.
  • I have kept the single-file architecture (no package split)
  • I have not added new dependencies without justification in the PR
    description

Screenshots / logs (if applicable)

Screenshot 2026-08-08 at 1 49 13 PM

@LeyckerS LeyckerS left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified all three things this rests on rather than taking the description's word for it.

All fifteen names are unreferenced. Worth showing the working, because a naive grep -w OK returns six hits and looks alarming:

integration_http.py:214:    print("[OK] browser → HTTP loopback → Engine: ...")
integration_web.py:189:    print("[OK] GUI ↔ bridge ↔ engine: ...")
moon_download.py:310:        W(f"OK: {len(ok_r)}  /  Fail: {len(fail_r)}")
moon_download.py:365:        W(f"  Completed OK   : {len(ok_r)}")
moon_download.py:407:        W(f"  {'Time':>7}  ... {'OK':>5} ...")
render_gui.py:83:        print("[OK] no js errors, no overflow, no horizontal scroll")

Every one is inside a string literal. The only real definition is the line you are deleting.

Your styles.css claim holds exactly as stated. I checked all fifteen hex values against web/styles.css and not one appears. That is a stronger check than "it looks unused" and it is the reason this is safe rather than merely plausible.

On #145's actual question — "why is it here?" — the answer is in the history, and it is worth recording since the issue asked for it:

5f172d3  chore: delete the tkinter GUI and its generator
43114d5  refactor: gen_1.py -> moon_tk.py, and the engine regenerated from it

moon_engine.py was once generated from a tkinter GUI. The palette was that GUI's, compiled into the engine along with everything else, and it survived 5f172d3 because deleting the generator did not touch its output. So this is not a constant someone added and forgot — it is residue from a build step that no longer exists. Module-level constants with zero references in this file are usually from that era, which is a useful thing for the next person to know.

Your reasoning about web/styles.css explains why it is unused today; the history explains why it exists at all. Both halves together are the complete answer, and I will put the second one in the changelog alongside your first.

CI green on all eight. Merging.

@LeyckerS
LeyckerS merged commit 9cd9787 into LeyckerS:main Aug 8, 2026
8 checks passed
LeyckerS added a commit that referenced this pull request Aug 8, 2026
- #158 (@nightcityblade, #81) takes ruff out of the version matrix
- #157 (@XEDAB, #155) removes the assertion that could not fail
- #159 (@AashishGupta2007, #145) removes the generated-era THEME block

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
LeyckerS added a commit that referenced this pull request Aug 12, 2026
Every entry in this release came from an outside contributor.

- #150 (@shard872, #116) a full disk aborts the run instead of retrying
- #149 (@Allen58562, #65) Stop interrupts transfers already in flight
- #153 (@AdvaitVarhade, #32) structured CLI exit codes
- #161 (@Divesh-Kshirsagar, #151) pytest.ini with a narrow warning filter
- #158 (@nightcityblade, #81) ruff runs once, not once per Python version
- #157 (@XEDAB, #155) the assertion that could not fail
- #162 (@XEDAB, #160) the stub that left the engine on the real network
- #159 (@AashishGupta2007, #145) the generated-era THEME block

README: consolidated the changelog sections, refreshed the stale test count,
and replaced the stars badge with a contributors badge.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

2 participants