parameters: (self, json_files)
docstring: Uploads the given json_files to the test_results_server (if the
      test_results_server is given).
docstring_summary: Uploads the given json_files to the test_results_server (if the
      test_results_server is given).
docstring_tokens: Uploads the given json_files to the test_results_server ( if the test_results_server is given ) .
function: def UploadJSONFiles(self, json_files):
      """Uploads the given json_files to the test_results_server (if the
      test_results_server is given)."""
      if not self._test_results_server:
        return
  
      if not self._master_name:
        _log.error(
            '--test-results-server was set, but --master-name was not.  Not '
            'uploading JSON files.')
        return
  
      _log.info('Uploading JSON files for builder: %s', self._builder_name)
      attrs = [('builder', self._builder_name),
               ('testtype', self._test_type),
               ('master', self._master_name)]
  
      files = [(json_file, os.path.join(self._results_directory, json_file))
               for json_file in json_files]
  
      url = 'https://%s/testfile/upload' % self._test_results_server
      # Set uploading timeout in case appengine server is having problems.
      # 120 seconds are more than enough to upload test results.
      uploader = _FileUploader(url, 120)
      try:
        response = uploader.UploadAsMultipartFormData(files, attrs)
        if response:
          if response.code == 200:
            _log.info('JSON uploaded.')
          else:
            _log.debug(
                "JSON upload failed, %d: '%s'", response.code, response.read())
        else:
          _log.error('JSON upload failed; no response returned')
      except Exception as err: # pylint: disable=broad-except
        _log.error('Upload failed: %s', err)
        return
function_tokens: def UploadJSONFiles ( self , json_files ) : if not self . _test_results_server : return if not self . _master_name : _log . error ( '--test-results-server was set, but --master-name was not.  Not ' 'uploading JSON files.' ) return _log . info ( 'Uploading JSON files for builder: %s' , self . _builder_name ) attrs = [ ( 'builder' , self . _builder_name ) , ( 'testtype' , self . _test_type ) , ( 'master' , self . _master_name ) ] files = [ ( json_file , os . path . join ( self . _results_directory , json_file ) ) for json_file in json_files ] url = 'https://%s/testfile/upload' % self . _test_results_server # Set uploading timeout in case appengine server is having problems. # 120 seconds are more than enough to upload test results. uploader = _FileUploader ( url , 120 ) try : response = uploader . UploadAsMultipartFormData ( files , attrs ) if response : if response . code == 200 : _log . info ( 'JSON uploaded.' ) else : _log . debug ( "JSON upload failed, %d: '%s'" , response . code , response . read ( ) ) else : _log . error ( 'JSON upload failed; no response returned' ) except Exception as err : # pylint: disable=broad-except _log . error ( 'Upload failed: %s' , err ) return