def rar_extract(rarfile_path, numrars, one_folder, nzo, setname, extraction_path):
 fail = 0
 new_files = None
 rars = []
 passwords = get_all_passwords(nzo)
 for password in passwords:
  if password:
   logging.debug('Trying unrar with password "%s"', password)
   msg = (T('Trying unrar with password "%s"') % unicoder(password))
   nzo.fail_msg = msg
   nzo.set_unpack_info('Unpack', msg)
  (fail, new_files, rars) = rar_extract_core(rarfile_path, numrars, one_folder, nzo, setname, extraction_path, password)
  if (fail != 2):
   break
 if (fail == 2):
  logging.error('%s (%s)', T('Unpacking failed, archive requires a password'), os.path.split(rarfile_path)[1])
 return (fail, new_files, rars)

def rar_extract ( rarfile_path , numrars , one_folder , nzo , setname , extraction_path ) : fail = 0 new_files = None rars = [ ] passwords = get_all_passwords ( nzo ) for password in passwords : if password : logging . debug ( 'Trying unrar with password "%s"' , password ) msg = ( T ( 'Trying unrar with password "%s"' ) % unicoder ( password ) ) nzo . fail_msg = msg nzo . set_unpack_info ( 'Unpack' , msg ) ( fail , new_files , rars ) = rar_extract_core ( rarfile_path , numrars , one_folder , nzo , setname , extraction_path , password ) if ( fail != 2 ) : break if ( fail == 2 ) : logging . error ( '%s (%s)' , T ( 'Unpacking failed, archive requires a password' ) , os . path . split ( rarfile_path ) [ 1 ] ) return ( fail , new_files , rars )
unpack single rar set rarfile to extraction_path .