Repository navigation
Platforms own their notifier, app name and catalog key - #1238
Merged
Merged
Conversation
setting_choices chose the desktop notifier with toad.os == "linux" and the application name with toad.os == "macos", and the catalog selection "exact key or '*'" was written twice (get_os_matrix and commands_for), with the OS literal declared twice (toad and agent_schema). Platform is now one family decoded once from platform.system(): the base answers DesktopService(), "Toad" and select(); Linux overrides desktop(), Mac overrides application_name. The compares, _OS_map, get_os_matrix, the second OS literal and the cast are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ejYrMLnLWah8wCDDcb57V
…unknown toad/platform.py now holds the Platform family and the DesktopService family it answers with, so toad/__init__ and setting_choices import them at the top and Platform.desktop() no longer imports setting_choices lazily. The decoded value is toad.host, since toad.platform is now the module. UnknownPlatform answers the base defaults and the catalog wildcard: a FreeBSD box used to decode as Linux and get the D-Bus probe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ejYrMLnLWah8wCDDcb57V
toad/__init__.py re-exported OS and Platform behind noqa F401 with no reader, and kept toad.host beside an `import platform as _platform` alias dodging its own module name (TIME-3). host is now declared at the bottom of toad/platform.py and every reader imports it from there; the re-exports, the alias, the now unused `import toad` lines and setting_choices' unused ABC import are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ejYrMLnLWah8wCDDcb57V
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
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.
Follows toad#1235, which merged at 2038e3e while it still chose platform behaviour with
toad.os == "linux"(setting_choices.py:166) andtoad.os == "macos"(:179), IMPL-1.toad/platform.pydeclares thePlatformfamily and theDesktopServicefamily it answers with:DesktopService,DBusDesktop,UncheckedDBusDesktopandAbsentDesktop, moved unchanged from setting_choices.py.desktop()->DesktopService(),application_name"Toad" andselect(matrix)(the exact catalog key, else"*").LinuxPlatformoverridesdesktop()withUncheckedDBusDesktop(), andMacPlatformoverrides the name with "🐸 Toad".UnknownPlatformgets the base defaults and the wildcard key. Before this, any undeclared system (FreeBSD, say) decoded as Linux and got the D-Bus probe.host = Platform.decode(platform.system()). Readers dofrom toad.platform import host, and the package root re-exports nothing._OS_mapandtoad.os;get_os_matrix, a second copy ofcommands_for's exact-or-*pick;OSliteral in agent_schema;cast;desktop();import platform as _platformalias, the noqa'd re-exports of OS and Platform, the unusedimport toadlines and setting_choices' unusedABCimport.key.Net src at f94cadd: platform.py +129, setting_choices.py −64,
__init__.py −25, agent_schema −2, agent_modal −1, acp/agent −1.Interpreter check, run instead of tests (owner order: no per-branch tests):
🤖 Generated with Claude Code
https://claude.ai/code/session_013ejYrMLnLWah8wCDDcb57V