def download_command(url, to=STDOUT_INDICATOR, quote_url=False):
 if quote_url:
  url = ("'%s'" % url)
  if (to != STDOUT_INDICATOR):
   to = ("'%s'" % to)
 if which('wget'):
  download_cmd = ['wget', '-q']
  if (to == STDOUT_INDICATOR):
   download_cmd += ['-O', STDOUT_INDICATOR, url]
  else:
   download_cmd += ['--recursive', '-O', to, url]
 else:
  download_cmd = ['curl', '-L', url]
  if (to != STDOUT_INDICATOR):
   download_cmd += ['-o', to]
 return download_cmd

def download_command ( url , to = STDOUT_INDICATOR , quote_url = False ) : if quote_url : url = ( "'%s'" % url ) if ( to != STDOUT_INDICATOR ) : to = ( "'%s'" % to ) if which ( 'wget' ) : download_cmd = [ 'wget' , '-q' ] if ( to == STDOUT_INDICATOR ) : download_cmd += [ '-O' , STDOUT_INDICATOR , url ] else : download_cmd += [ '--recursive' , '-O' , to , url ] else : download_cmd = [ 'curl' , '-L' , url ] if ( to != STDOUT_INDICATOR ) : download_cmd += [ '-o' , to ] return download_cmd
build a command line to download a url .