def send_nscript(title, msg, gtype, force=False, test=None):
 if test:
  script = test.get('nscript_script')
  parameters = test.get('nscript_parameters')
 else:
  script = sabnzbd.cfg.nscript_script()
  parameters = sabnzbd.cfg.nscript_parameters()
 if (not script):
  return T('Cannot send, missing required data')
 title = (u'SABnzbd: ' + Tx(NOTIFICATION.get(gtype, 'other')))
 if (force or check_classes(gtype, 'nscript')):
  script_path = make_script_path(script)
  if script_path:
   (output, ret) = external_script(script_path, gtype, title, msg, parameters)
   if ret:
    logging.error((T('Script returned exit code %s and output "%s"') % (ret, output)))
    return (T('Script returned exit code %s and output "%s"') % (ret, output))
   else:
    logging.info(('Successfully executed notification script ' + script_path))
  else:
   return (T('Notification script "%s" does not exist') % script_path)
 return ''

def send_nscript ( title , msg , gtype , force = False , test = None ) : if test : script = test . get ( 'nscript_script' ) parameters = test . get ( 'nscript_parameters' ) else : script = sabnzbd . cfg . nscript_script ( ) parameters = sabnzbd . cfg . nscript_parameters ( ) if ( not script ) : return T ( 'Cannot send, missing required data' ) title = ( u'SABnzbd: ' + Tx ( NOTIFICATION . get ( gtype , 'other' ) ) ) if ( force or check_classes ( gtype , 'nscript' ) ) : script_path = make_script_path ( script ) if script_path : ( output , ret ) = external_script ( script_path , gtype , title , msg , parameters ) if ret : logging . error ( ( T ( 'Script returned exit code %s and output "%s"' ) % ( ret , output ) ) ) return ( T ( 'Script returned exit code %s and output "%s"' ) % ( ret , output ) ) else : logging . info ( ( 'Successfully executed notification script ' + script_path ) ) else : return ( T ( 'Notification script "%s" does not exist' ) % script_path ) return ''
run users notification script .