CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-gntp

tessl install tessl/pypi-gntp@1.0.0

Growl Notification Transport Protocol for Python

Agent Success

Agent success rate when using this tile

80%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.25x

Baseline

Agent success rate without this tile

64%

task.mdevals/scenario-7/

Notification Icon Manager

Build a notification icon manager that handles multiple icon formats and sends notifications with appropriate icon representations.

Requirements

Create a Python module that:

  1. Sends notifications with icons from different sources:

    • URL-based icons (both HTTP and file:// URLs)
    • Binary image data loaded from local files
  2. Implements a NotificationIconManager class with the following methods:

    • send_with_url_icon(title, message, icon_url): Sends a notification with an icon specified by URL
    • send_with_file_icon(title, message, image_path): Sends a notification with an icon loaded from a local image file as binary data
    • send_with_multiple_icons(notifications): Sends multiple notifications, each with their own icon (URL or file-based)
  3. The implementation should:

    • Properly register the application with the notification system before sending notifications
    • Handle both URL-based and binary icon data correctly
    • Read image files and convert them to the appropriate format for embedding in notifications
    • Use the notification type "General Notification" for all notifications

Test Cases

  • Sending a notification with an HTTP URL icon displays the notification @test
  • Sending a notification with a file:// URL icon displays the notification @test
  • Sending a notification with a binary icon loaded from a PNG file displays the notification @test
  • Sending multiple notifications with different icon types (both URL and binary) displays all notifications @test

Implementation

@generates

API

class NotificationIconManager:
    """Manages notifications with different icon formats."""

    def __init__(self, app_name="IconManager", hostname="localhost", port=23053):
        """Initialize the icon manager with application settings."""
        pass

    def send_with_url_icon(self, title, message, icon_url):
        """Send a notification with an icon specified by URL.

        Args:
            title: The notification title
            message: The notification message
            icon_url: URL to the icon (HTTP or file://)
        """
        pass

    def send_with_file_icon(self, title, message, image_path):
        """Send a notification with an icon from a local file as binary data.

        Args:
            title: The notification title
            message: The notification message
            image_path: Path to the local image file
        """
        pass

    def send_with_multiple_icons(self, notifications):
        """Send multiple notifications with different icon types.

        Args:
            notifications: List of dicts with keys 'title', 'message',
                         and either 'icon_url' or 'image_path'
        """
        pass

Dependencies { .dependencies }

gntp { .dependency }

Provides desktop notification support with icon handling capabilities.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/gntp@1.0.x
tile.json