Repository navigation
Render an environment as text, with an example console application - #59
Merged
Merged
Conversation
Patchwork could only show an environment through Pygame. text_renderer turns locations into a grid of text without importing Pygame, and console_view prints an existing environment from its ID, so it needs no display, creates nothing in Viron and writes no file. Closes #11 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 6, 2026
Member
Author
|
Self-review rubric, scored against head
Findings:
Do-not-auto-merge check: no This comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
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
text_renderer.pyis added, withrenderLocations(locations, filled, empty), which turns locations into a text grid. Pygame is not imported, and the grid is sized from the locations themselves.console_view.pyis added as the example console application that Add text-based UI support to library for users #11 asks for.python console_view.py <environmentId>prints an environment that already exists in Viron. Nothing is created in Viron, no file is written and no usage is reported.Text renderingsection, and its test-suite paragraphs are updated.An environment ID was chosen as the argument over a grid size so that the example needs no copy of
main.py's cache and creation logic, which cannot be imported without Pygame. Theurlandportconstants are duplicated for the same reason.main.py,render_window.py,graphik.py, theVironpin and the workflow file are unchanged.Closes #11
Test plan
python3 -m unittest discover -s tests: 192 tests executed, all passing, 22 of them newpython3 -m py_compileon every top-level module, including the two new onespython3 headless_run.py: all three scenarios PASS, so the Pygame path is unaffectedconsole_view.pyrun unmodified on Python 3.8 against the realLocationServiceandLocationmodel over real HTTP, using a local stand-in server on:9999. Exit statuses were 0 for a 3x3 environment, 1 for an empty list, 1 for a500, 1 for a refused connection, 2 for a missing argument and 0 for--helpxandyand addingimport pygametotext_renderer.pyfailed 5 of its 9 tests. The source was then restoredmain.py, which is unchanged. The stand-in server's JSON and its empty-list answer were taken fromLocationandLocationControllerin the pinned submodule, not observed from a running VironNotes for review
console_view.pyandtext_renderer.pyare not added to thepy_compilestep in.github/workflows/tests.yml, since workflow files are on the do-not-auto-merge list. The suite imports both modules, so a syntax error still fails CI, and the README says so.Virongives every grid the same coordinates, so an environment with several grids is drawn overlapping. The README states this; multi-grid drawing remains Support drawing environments with multiple grids #2.Issues not picked
Vironpin).Locationcarries no grid ID andnumGridsis fixed at1, so a separate design is needed.This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson