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-1/

GNTP Message Resource Parser

Build a tool that parses GNTP protocol messages and extracts embedded binary resources (such as icons or images) from them.

Overview

GNTP (Growl Notification Transport Protocol) messages can contain embedded binary resources. Your tool should parse raw GNTP messages and extract any embedded resources along with message metadata.

Capabilities

Parse basic messages

  • Parsing a GNTP NOTICE message with an embedded PNG icon extracts the message headers and binary resource data correctly @test
  • Parsing a GNTP REGISTER message returns the message type and notification type names @test

Extract embedded resources

  • Extracting resources from a message with a single embedded image returns the resource identifier and complete binary data @test
  • Extracting resources from a message with multiple embedded resources returns all resource identifiers and data @test

Handle authentication

  • Parsing a password-protected message with the correct password succeeds and extracts the content @test
  • Parsing a password-protected message with an incorrect password raises an AuthError @test

Implementation

@generates

API

def parse_message(raw_message, password=None):
    """
    Parse a raw GNTP message and extract its contents.

    Parameters:
    - raw_message (bytes or str): The raw GNTP message data
    - password (str): Optional password for authentication

    Returns:
    dict: Dictionary containing:
        - 'message_type': str - Type of message ('REGISTER', 'NOTICE', etc.)
        - 'headers': dict - Message headers as key-value pairs
        - 'resources': dict - Resource identifiers mapped to binary data

    Raises:
    - AuthError: When password authentication fails
    - ParseError: When message format is invalid
    """
    pass

def extract_resources(message_obj):
    """
    Extract all binary resources from a GNTP message object.

    Parameters:
    - message_obj: A GNTP message object (e.g., GNTPNotice, GNTPRegister)

    Returns:
    dict: Resource identifiers (MD5 hashes) mapped to binary data bytes
    """
    pass

Dependencies { .dependencies }

gntp { .dependency }

Provides GNTP protocol implementation for parsing messages and extracting resources.

@satisfied-by

Version

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