def call_unrar(params, custom_path=None):
 global rar_executable_cached
 if (rar_executable_cached is None):
  for command in (custom_path, 'unrar', 'rar', osx_unrar):
   if (not command):
    continue
   try:
    subprocess.Popen([command], stdout=subprocess.PIPE)
    rar_executable_cached = command
    break
   except OSError:
    pass
  if (rar_executable_cached is None):
   raise UnpackerNotInstalled('No suitable RAR unpacker installed')
 assert (type(params) == list), 'params must be list'
 args = ([rar_executable_cached] + params)
 try:
  gc.disable()
  return subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 finally:
  gc.enable()

def call_unrar ( params , custom_path = None ) : global rar_executable_cached if ( rar_executable_cached is None ) : for command in ( custom_path , 'unrar' , 'rar' , osx_unrar ) : if ( not command ) : continue try : subprocess . Popen ( [ command ] , stdout = subprocess . PIPE ) rar_executable_cached = command break except OSError : pass if ( rar_executable_cached is None ) : raise UnpackerNotInstalled ( 'No suitable RAR unpacker installed' ) assert ( type ( params ) == list ) , 'params must be list' args = ( [ rar_executable_cached ] + params ) try : gc . disable ( ) return subprocess . Popen ( args , stdout = subprocess . PIPE , stderr = subprocess . PIPE ) finally : gc . enable ( )
calls rar/unrar command line executable .