parameters: (self, page_set)
docstring: Rename generated SKP files into more descriptive names.
  
      Look into the subdirectory of TMP_SKP_DIR and find the most interesting
      .skp in there to be this page_set's representative .skp.
  
      Throws InvalidSKPException if the chosen .skp is less than 1KB. This
      typically happens when there is a 404 or a redirect loop. Anything greater
      than 1KB seems to have captured at least some useful information.
docstring_summary: Rename generated SKP files into more descriptive names.
docstring_tokens: Rename generated SKP files into more descriptive names .
function: def _RenameSkpFiles(self, page_set):
      """Rename generated SKP files into more descriptive names.
  
      Look into the subdirectory of TMP_SKP_DIR and find the most interesting
      .skp in there to be this page_set's representative .skp.
  
      Throws InvalidSKPException if the chosen .skp is less than 1KB. This
      typically happens when there is a 404 or a redirect loop. Anything greater
      than 1KB seems to have captured at least some useful information.
      """
      subdirs = glob.glob(os.path.join(TMP_SKP_DIR, '*'))
      for site in subdirs:
        if self._IsChromiumPageSet(page_set):
          filename = self._GetChromiumSkpFileName(page_set, site)
        else:
          filename = self._GetSkiaSkpFileName(page_set)
        filename = filename.lower()
  
        if self._skp_prefix:
          filename = '%s%s' % (self._skp_prefix, filename)
  
        # We choose the largest .skp as the most likely to be interesting.
        largest_skp = max(glob.glob(os.path.join(site, '*.skp')),
                          key=lambda path: os.stat(path).st_size)
        dest = os.path.join(self._local_skp_dir, filename)
        print('Moving', largest_skp, 'to', dest)
        shutil.move(largest_skp, dest)
        self._skp_files.append(filename)
        shutil.rmtree(site)
        skp_size = os.path.getsize(dest)
        if skp_size < 1024:
          raise InvalidSKPException(
              'Size of %s is only %d. Something is wrong.' % (dest, skp_size))
function_tokens: def _RenameSkpFiles ( self , page_set ) : subdirs = glob . glob ( os . path . join ( TMP_SKP_DIR , '*' ) ) for site in subdirs : if self . _IsChromiumPageSet ( page_set ) : filename = self . _GetChromiumSkpFileName ( page_set , site ) else : filename = self . _GetSkiaSkpFileName ( page_set ) filename = filename . lower ( ) if self . _skp_prefix : filename = '%s%s' % ( self . _skp_prefix , filename ) # We choose the largest .skp as the most likely to be interesting. largest_skp = max ( glob . glob ( os . path . join ( site , '*.skp' ) ) , key = lambda path : os . stat ( path ) . st_size ) dest = os . path . join ( self . _local_skp_dir , filename ) print ( 'Moving' , largest_skp , 'to' , dest ) shutil . move ( largest_skp , dest ) self . _skp_files . append ( filename ) shutil . rmtree ( site ) skp_size = os . path . getsize ( dest ) if skp_size < 1024 : raise InvalidSKPException ( 'Size of %s is only %d. Something is wrong.' % ( dest , skp_size ) )