tools/grit/grit/node/structure.py
def Process(self, output_dir):
    """Writes the processed data to output_dir.  In the case of a chrome_html
    structure this will add references to other scale factors.  If flattening
    this will also write file references to be base64 encoded data URLs.  The
    name of the new file is returned."""
    filename = self.ToRealPath(self.GetInputPath())
    flat_filename = os.path.join(output_dir,
        self.attrs['name'] + '_' + os.path.basename(filename))

    if self._last_flat_filename == flat_filename:
      return

    with open(flat_filename, 'wb') as outfile:
      if self.ExpandVariables():
        text = self.gatherer.GetText()
        file_contents = self._Substitute(text)
      else:
        file_contents = self.gatherer.GetData('', 'utf-8')
      outfile.write(file_contents.encode('utf-8'))

    self._last_flat_filename = flat_filename
    return os.path.basename(flat_filename)
Writes the processed data to output_dir.  In the case of a chrome_html
    structure this will add references to other scale factors.  If flattening
    this will also write file references to be base64 encoded data URLs.  The
    name of the new file is returned.
Writes the processed data to output_dir.  In the case of a chrome_html
structure this will add references to other scale factors.  If flattening
this will also write file references to be base64 encoded data URLs.  The
name of the new file is returned.
Writes the processed data to output_dir . In the case of a chrome_html structure this will add references to other scale factors . If flattening this will also write file references to be base64 encoded data URLs . The name of the new file is returned .
def Process(self, output_dir):
    filename = self.ToRealPath(self.GetInputPath())
    flat_filename = os.path.join(output_dir,
        self.attrs['name'] + '_' + os.path.basename(filename))
    if self._last_flat_filename == flat_filename:
      return
    with open(flat_filename, 'wb') as outfile:
      if self.ExpandVariables():
        text = self.gatherer.GetText()
        file_contents = self._Substitute(text)
      else:
        file_contents = self.gatherer.GetData('', 'utf-8')
      outfile.write(file_contents.encode('utf-8'))
    self._last_flat_filename = flat_filename
    return os.path.basename(flat_filename)
def Process ( self , output_dir ) : filename = self . ToRealPath ( self . GetInputPath ( ) ) flat_filename = os . path . join ( output_dir , self . attrs [ 'name' ] + '_' + os . path . basename ( filename ) ) if self . _last_flat_filename == flat_filename : return with open ( flat_filename , 'wb' ) as outfile : if self . ExpandVariables ( ) : text = self . gatherer . GetText ( ) file_contents = self . _Substitute ( text ) else : file_contents = self . gatherer . GetData ( '' , 'utf-8' ) outfile . write ( file_contents . encode ( 'utf-8' ) ) self . _last_flat_filename = flat_filename return os . path . basename ( flat_filename )
Writes the processed data to output_dir.
Writes the processed data to output_dir .
"""Writes the processed data to output_dir.  In the case of a chrome_html
    structure this will add references to other scale factors.  If flattening
    this will also write file references to be base64 encoded data URLs.  The
    name of the new file is returned."""
self
output_dir