Skip to content

Show the map viewer’s local address and default port in --help - #4825

Open
Abishek0070 wants to merge 2 commits into
ItsNotRexed:mainfrom
Abishek0070:main
Open

Abishek0070 wants to merge 2 commits into
ItsNotRexed:mainfrom
Abishek0070:main

Conversation

@Abishek0070

Copy link
Copy Markdown

Summary

python -I viewer/serve.py --help now shows where to open the map viewer with its default settings: http://127.0.0.1:8765/. The command description names the loopback address, and the --port help reads the default port from argparse so it stays accurate if the default changes.

Testing

  • Ran python -I viewer/serve.py --help and confirmed it shows 127.0.0.1, the default port 8765, and how to request a free port with --port 0.
  • Ran python -I tests/test_viewer_serve.py. All 39 tests passed.

AI-assisted: yes

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed.

@Atomic258

Copy link
Copy Markdown
Contributor

Tested 6ea29818b7dbd0d293d089f8f2b6d88d72a8fd73 on Windows 11 / Python 3.15.2 (CPU only). python -I viewer/serve.py --help shows 127.0.0.1, default 8765, and that port 0 requests a free port. python -I tests/test_viewer_serve.py passed all 39 tests. Red control: git show HEAD^:viewer/serve.py | python -I - --help omitted the address and default port. Worktree clean.

AI-assisted (Devin); no game files.

@whattheflop whattheflop left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Integration check with the catalog draft #4763 at 66c88956. Both PRs edit the same CLI block, and Git merged them cleanly (tree f577cb3be1936c01b59ac2f8fbe820526624df30). On the merged tree --help shows 127.0.0.1, default port 8765, the port-0 behavior, and the new catalog option. Synthetic verification with uv CPython 3.12.13 and Node 24.16.0 passed 72 Python tests with 3 platform skips and all 60 Node tests. No manual conflict resolution needed at these heads. AI-assisted.

@kapitche

Copy link
Copy Markdown
Contributor

Tested 6ea2981 merged with main 3faac55 (clean merge) on Windows 11 (CPython 3.13.1) and Linux (WSL2, CPython 3.12.16): pass.

  • Windows: python -I tests\test_viewer_serve.py: 39 run, 38 passed, 1 skipped, 0 failed. python -I viewer\serve.py --help prints "Serve the map viewer on 127.0.0.1." and --port PORT listening port (default: 8765); 0 asks the OS for a free port; the bound port is printed, exit 0. --port abc still exits 2 with the argparse error.
  • Linux: the help output is identical. test_viewer_serve.py gives 39 run, 110 errors, all ConnectionRefusedError from loopback sockets, which this WSL session refuses for any Python socket (a bare socket.create_connection to a local listener fails the same way). main's serve.py gives the same 110 errors, so the Linux run is not evidence either way.
  • Negative control: main's serve.py --help has no description and the --port text has no default.
  • The new text is only help strings, with no test covering it. The %(default)s expansion is checked by the output above.

@memorypressure

Copy link
Copy Markdown

Verified on Linux: merges cleanly with current main 3faac55, and --help now prints the server description and the 8765 default correctly (%(default)s expands as intended — ran it). The full tests/test_viewer_serve.py suite passes on the merged tree, 39 tests (re-run), no regressions; nothing on main touched viewer/serve.py since your base. Note this PR comes from a fork main branch so it gets no CI runs at all — treat this as the extra evidence a human reviewer needs to weigh. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run).

@Atomic258

Copy link
Copy Markdown
Contributor

Tested 6ea2981 on Windows Server 2022, CPython 3.13.12: pass

  • python -I viewer/serve.py --help runs and prints usage - the port/arg parsing change applies cleanly.

git diff --check clean; python -m compileall -q exit 0. No game files, no GPU. AI-assisted (Devin).

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.

5 participants