#NEWLINE# def notify( self , noteType , title , description , icon = None , sticky = False , priority = None , callback = None , identifier = None , custom = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# 'Send a GNTP notifications\n\n\t\t.. warning::\n\t\t\tMust have registered with growl beforehand or messages will be ignored\n\n\t\t:param string noteType: One of the notification names registered earlier\n\t\t:param string title: Notification title (usually displayed on the notification)\n\t\t:param string description: The main content of the notification\n\t\t:param string icon: Icon URL path\n\t\t:param boolean sticky: Sticky notification\n\t\t:param integer priority: Message priority level from -2 to 2\n\t\t:param string callback:  URL callback\n\t\t:param dict custom: Custom attributes. Key names should be prefixed with X-\n\t\t\taccording to the spec but this is not enforced by this class\n\n\t\t.. warning::\n\t\t\tFor now, only URL callbacks are supported. In the future, the\n\t\t\tcallback argument will also support a function\n\t\t' #NEWLINE# logger . info ( 'Sending notification [%s] to %s:%s' , noteType , self . hostname , self . port ) #NEWLINE# assert ( noteType in self . notifications ) #NEWLINE# notice = gntp . core . GNTPNotice ( ) #NEWLINE# notice . add_header ( 'Application-Name' , self . applicationName ) #NEWLINE# notice . add_header ( 'Notification-Name' , noteType ) #NEWLINE# notice . add_header ( 'Notification-Title' , title ) #NEWLINE# if self . password : #NEWLINE# #INDENT# notice . set_password ( self . password , self . passwordHash ) #NEWLINE# #UNINDENT# if sticky : #NEWLINE# #INDENT# notice . add_header ( 'Notification-Sticky' , sticky ) #NEWLINE# #UNINDENT# if priority : #NEWLINE# #INDENT# notice . add_header ( 'Notification-Priority' , priority ) #NEWLINE# #UNINDENT# if icon : #NEWLINE# #INDENT# if self . _checkIcon ( icon ) : #NEWLINE# #INDENT# notice . add_header ( 'Notification-Icon' , icon ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# resource = notice . add_resource ( icon ) #NEWLINE# notice . add_header ( 'Notification-Icon' , resource ) #NEWLINE# #UNINDENT# #UNINDENT# if description : #NEWLINE# #INDENT# notice . add_header ( 'Notification-Text' , description ) #NEWLINE# #UNINDENT# if callback : #NEWLINE# #INDENT# notice . add_header ( 'Notification-Callback-Target' , callback ) #NEWLINE# #UNINDENT# if identifier : #NEWLINE# #INDENT# notice . add_header ( 'Notification-Coalescing-ID' , identifier ) #NEWLINE# #UNINDENT# for key in custom : #NEWLINE# #INDENT# notice . add_header ( key , custom [ key ] ) #NEWLINE# #UNINDENT# self . add_origin_info ( notice ) #NEWLINE# self . notify_hook ( notice ) #NEWLINE# return self . _send ( 'notify' , notice )