def send_prowl(title, msg, gtype, force=False, test=None):
 if test:
  apikey = test.get('prowl_apikey')
 else:
  apikey = sabnzbd.cfg.prowl_apikey()
 if (not apikey):
  return T('Cannot send, missing required data')
 title = Tx(NOTIFICATION.get(gtype, 'other'))
 title = urllib2.quote(title.encode('utf8'))
 msg = urllib2.quote(msg.encode('utf8'))
 prio = get_prio(gtype, 'prowl')
 if force:
  prio = 0
 if (prio > (-3)):
  url = ('https://api.prowlapp.com/publicapi/add?apikey=%s&application=SABnzbd&event=%s&description=%s&priority=%d' % (apikey, title, msg, prio))
  try:
   urllib2.urlopen(url)
   return ''
  except:
   logging.warning(T('Failed to send Prowl message'))
   logging.info('Traceback: ', exc_info=True)
   return T('Failed to send Prowl message')
 return ''

def send_prowl ( title , msg , gtype , force = False , test = None ) : if test : apikey = test . get ( 'prowl_apikey' ) else : apikey = sabnzbd . cfg . prowl_apikey ( ) if ( not apikey ) : return T ( 'Cannot send, missing required data' ) title = Tx ( NOTIFICATION . get ( gtype , 'other' ) ) title = urllib2 . quote ( title . encode ( 'utf8' ) ) msg = urllib2 . quote ( msg . encode ( 'utf8' ) ) prio = get_prio ( gtype , 'prowl' ) if force : prio = 0 if ( prio > ( - 3 ) ) : url = ( 'https://api.prowlapp.com/publicapi/add?apikey=%s&application=SABnzbd&event=%s&description=%s&priority=%d' % ( apikey , title , msg , prio ) ) try : urllib2 . urlopen ( url ) return '' except : logging . warning ( T ( 'Failed to send Prowl message' ) ) logging . info ( 'Traceback: ' , exc_info = True ) return T ( 'Failed to send Prowl message' ) return ''
send message to prowl .