def check_for_sabnzbd(url, upload_nzbs, allow_browser=True):
 if (allow_browser is None):
  allow_browser = True
 if is_sabnzbd_running(url):
  if upload_nzbs:
   from sabnzbd.utils.upload import upload_file
   prev = sabnzbd.set_https_verification(0)
   for f in upload_nzbs:
    upload_file(url, f)
   sabnzbd.set_https_verification(prev)
  else:
   url = url[:(url.rfind('/') + 1)]
   launch_a_browser(url, force=allow_browser)
  exit_sab(0)
  return True
 return False

def check_for_sabnzbd ( url , upload_nzbs , allow_browser = True ) : if ( allow_browser is None ) : allow_browser = True if is_sabnzbd_running ( url ) : if upload_nzbs : from sabnzbd . utils . upload import upload_file prev = sabnzbd . set_https_verification ( 0 ) for f in upload_nzbs : upload_file ( url , f ) sabnzbd . set_https_verification ( prev ) else : url = url [ : ( url . rfind ( '/' ) + 1 ) ] launch_a_browser ( url , force = allow_browser ) exit_sab ( 0 ) return True return False
check for a running instance of sabnzbd on this port allow_browser==true|none will launch the browser .