def list_scripts(default=False, none=True):
 lst = []
 path = cfg.script_dir.get_path()
 if (path and os.access(path, os.R_OK)):
  for script in globber_full(path):
   if os.path.isfile(script):
    if ((sabnzbd.WIN32 and (os.path.splitext(script)[1].lower() in PATHEXT) and (not (win32api.GetFileAttributes(script) & win32file.FILE_ATTRIBUTE_HIDDEN))) or script.endswith('.py') or ((not sabnzbd.WIN32) and os.access(script, os.X_OK) and (not os.path.basename(script).startswith('.')))):
     lst.append(os.path.basename(script))
  if none:
   lst.insert(0, 'None')
  if default:
   lst.insert(0, 'Default')
 return lst

def list_scripts ( default = False , none = True ) : lst = [ ] path = cfg . script_dir . get_path ( ) if ( path and os . access ( path , os . R_OK ) ) : for script in globber_full ( path ) : if os . path . isfile ( script ) : if ( ( sabnzbd . WIN32 and ( os . path . splitext ( script ) [ 1 ] . lower ( ) in PATHEXT ) and ( not ( win32api . GetFileAttributes ( script ) & win32file . FILE_ATTRIBUTE_HIDDEN ) ) ) or script . endswith ( '.py' ) or ( ( not sabnzbd . WIN32 ) and os . access ( script , os . X_OK ) and ( not os . path . basename ( script ) . startswith ( '.' ) ) ) ) : lst . append ( os . path . basename ( script ) ) if none : lst . insert ( 0 , 'None' ) if default : lst . insert ( 0 , 'Default' ) return lst
return a list of script names .