gh-157749: Add tkinter.systray.NotificationHandler - #157760
Open
serhiy-storchaka wants to merge 1 commit into
Open
serhiy-storchaka wants to merge 1 commit into
serhiy-storchaka wants to merge 1 commit into
Conversation
A logging handler which shows log records as desktop notifications using the "tk sysnotify" command. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Documentation build overview
|
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.
Add the
NotificationHandlerclass totkinter.systray-- alogginghandler which shows log records as desktop notifications using thetk sysnotifycommand.The title of the notification is the title argument, or the level name of the record by default. The message is the record formatted by the handler's formatter. The master window is used to send notifications; by default the default root window is looked up when a record is emitted, so the handler can be created before the root window. Errors are reported via
handleError().The test which sends a real notification is in
SysTrayIconTest, so that all real notifications in a test process are sent from the same Tcl interpreter: on X11 with libnotify, Tk crashes or hangs whentk sysnotifyis called after the interpreter which sent the previous notification was deleted (Tk unloads and reloads libnotify, and GLib cannot re-register its types). This is a Tk bug which will be reported separately.🤖 Generated with Claude Code