tessl install tessl/pypi-gntp@1.0.0Growl 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%
A monitoring utility that sends notifications to a Growl server and handles protocol-level errors gracefully.
Build a notification monitoring system that sends notifications to a Growl server and implements robust error handling for protocol-level failures. The system should be able to distinguish between different types of errors and handle them appropriately.
@generates
class NotificationMonitor:
"""
A notification monitor that sends notifications and handles protocol errors.
"""
def __init__(self, hostname='localhost', port=23053, password=None):
"""
Initialize the notification monitor.
Args:
hostname: The Growl server hostname
port: The Growl server port
password: Optional password for authentication
"""
pass
def send_notification(self, title, description, app_name='Monitor', retry_on_auth_error=False, fallback_password=None):
"""
Send a notification to the Growl server with error handling.
Args:
title: Notification title
description: Notification description
app_name: Application name for registration
retry_on_auth_error: Whether to retry with fallback_password on auth error
fallback_password: Password to use for retry on authentication failure
Returns:
dict with keys:
- 'success': bool indicating if notification was sent successfully
- 'error_code': int error code if a GNTPError occurred, None otherwise
- 'error_description': str error description if a GNTPError occurred, None otherwise
- 'retried': bool indicating if a retry was attempted
"""
pass
def is_authentication_error(self, error_code):
"""
Check if an error code represents an authentication failure.
Args:
error_code: The GNTP error code
Returns:
bool: True if error code is 401 (authentication error)
"""
pass
def is_recoverable_error(self, error_code):
"""
Check if an error is recoverable and should be retried.
Args:
error_code: The GNTP error code
Returns:
bool: True if the error is recoverable (not 400 or 500 range errors)
"""
passProvides Growl Notification Transport Protocol implementation with error handling support.
@satisfied-by