parameters: (user, host, path, files, verbose=False, port=None, ssh_key=None, base_path=None, upload_to_temp_dir=False, post_upload_command=None)
docstring: Upload each file in the list files to user@host:path. Optionally pass
      port and ssh_key to the ssh commands. If base_path is not None, upload
      files including their path relative to base_path. If upload_to_temp_dir is
      True files will be uploaded to a temporary directory on the remote server.
      Generally, you should have a post upload command specified in these cases
      that can move them around to their correct location(s).
      If post_upload_command is not None, execute that command on the remote host
      after uploading all files, passing it the upload path, and the full paths to
      all files uploaded.
      If verbose is True, print status updates while working.
docstring_summary: Upload each file in the list files to user
docstring_tokens: Upload each file in the list files to user
function: def UploadFiles(user, host, path, files, verbose=False, port=None, ssh_key=None, base_path=None, upload_to_temp_dir=False, post_upload_command=None):
      """Upload each file in the list files to user@host:path. Optionally pass
      port and ssh_key to the ssh commands. If base_path is not None, upload
      files including their path relative to base_path. If upload_to_temp_dir is
      True files will be uploaded to a temporary directory on the remote server.
      Generally, you should have a post upload command specified in these cases
      that can move them around to their correct location(s).
      If post_upload_command is not None, execute that command on the remote host
      after uploading all files, passing it the upload path, and the full paths to
      all files uploaded.
      If verbose is True, print status updates while working."""
      if upload_to_temp_dir:
          path = DoSSHCommand("mktemp -d", user, host, port=port, ssh_key=ssh_key)
      if not path.endswith("/"):
          path += "/"
      if base_path is not None:
          base_path = os.path.abspath(base_path)
      remote_files = []
      try:
          for file in files:
              file = os.path.abspath(file)
              if not os.path.isfile(file):
                  raise IOError("File not found: %s" % file)
              # first ensure that path exists remotely
              remote_path = GetRemotePath(path, file, base_path)
              DoSSHCommand("mkdir -p " + remote_path, user, host, port=port, ssh_key=ssh_key)
              if verbose:
                  print "Uploading " + file
              DoSCPFile(file, remote_path, user, host, port=port, ssh_key=ssh_key)
              remote_files.append(remote_path + '/' + os.path.basename(file))
          if post_upload_command is not None:
              if verbose:
                  print "Running post-upload command: " + post_upload_command
              file_list = '"' + '" "'.join(remote_files) + '"'
              DoSSHCommand('%s "%s" %s' % (post_upload_command, path, file_list), user, host, port=port, ssh_key=ssh_key)
      finally:
          if upload_to_temp_dir:
              DoSSHCommand("rm -rf %s" % path, user, host, port=port,
                           ssh_key=ssh_key)
      if verbose:
          print "Upload complete"
function_tokens: def UploadFiles ( user , host , path , files , verbose = False , port = None , ssh_key = None , base_path = None , upload_to_temp_dir = False , post_upload_command = None ) : if upload_to_temp_dir : path = DoSSHCommand ( "mktemp -d" , user , host , port = port , ssh_key = ssh_key ) if not path . endswith ( "/" ) : path += "/" if base_path is not None : base_path = os . path . abspath ( base_path ) remote_files = [ ] try : for file in files : file = os . path . abspath ( file ) if not os . path . isfile ( file ) : raise IOError ( "File not found: %s" % file ) # first ensure that path exists remotely remote_path = GetRemotePath ( path , file , base_path ) DoSSHCommand ( "mkdir -p " + remote_path , user , host , port = port , ssh_key = ssh_key ) if verbose : print "Uploading " + file DoSCPFile ( file , remote_path , user , host , port = port , ssh_key = ssh_key ) remote_files . append ( remote_path + '/' + os . path . basename ( file ) ) if post_upload_command is not None : if verbose : print "Running post-upload command: " + post_upload_command file_list = '"' + '" "' . join ( remote_files ) + '"' DoSSHCommand ( '%s "%s" %s' % ( post_upload_command , path , file_list ) , user , host , port = port , ssh_key = ssh_key ) finally : if upload_to_temp_dir : DoSSHCommand ( "rm -rf %s" % path , user , host , port = port , ssh_key = ssh_key ) if verbose : print "Upload complete"