mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:45:53 +01:00
[PR #2185] make_game --pick: on macOS, the folder dialog is osascript's choose folder, so it needs no Tkinter (MAKE-GAME-PICK-MACOS) #2189
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2189
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2185
Author: @Tauwni
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/make-game-pick-macos-osascript📝 Commits (2)
9af0a22make_game --pick: on macOS, the folder dialog is osascript's choose folder, so it needs no Tkinter13909f8Merge main into fix/make-game-pick-macos-osascript📊 Changes
2 files changed (+56 additions, -11 deletions)
View changed files
📝
make_game.py(+23 -6)📝
tests/test_make_game_pick.py(+33 -5)📄 Description
Claimed in the coordination issue as: MAKE-GAME-PICK-MACOS (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7181407725)
What and why
make_game.py --pickopens its folder dialog through Tk on macOS. Homebrew's Python ships without Tkinter (it's a separate[email protected]formula), so on a Mac with Homebrew's Python--pickstops:osascriptis on every Mac, and itschoose folderis the system folder dialog.native_picker()now returns it on macOS, the way kdialog and zenity are the native tools on Linux:native_ask:choose folder with prompt … default location …. The prompt and the start folder are passed asargv, not pasted into the script, so a path with quotes needs no escaping. Cancel is AppleScript error -128, whichosascriptexits 1 with, the codenative_askalready treats as cancelled.native_warn:display dialog … with icon caution, also with the message passed asargv.osascriptfails to run, it falls back to Tk as before.Tested
Apple M3, macOS 26.5.1:
osacompile. The warning dialog showed a message with quotes, a backslash and a newline, passed asargv(run withgiving up after 1). Thechoose folderdialog opened on the home folder. Cancel (error number -128) exits 1.tests/test_make_game_pick.py: 17 tests OK on Python 3.12 and 3.15. New tests cover macOS picking osascript (and nothing when it's missing), the arguments of the ask and the warning, and cancel. The old "None on macOS" case now only covers Windows. Alltests/test_make_game*.pyare OK.AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.