daily pastebin goal
4%
SHARE
TWEET

Untitled

a guest Dec 18th, 2018 96 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/tools/grit/grit/node/include.py b/tools/grit/grit/node/include.py
  2. index 7699b68c4d27..8aa1325f79f5 100644
  3. --- a/tools/grit/grit/node/include.py
  4. +++ b/tools/grit/grit/node/include.py
  5. @@ -30,12 +30,12 @@ class IncludeNode(base.Node):
  6.    def _IsValidChild(self, child):
  7.      return False
  8.  
  9. -  def _GetFlattenedData(self, allow_external_script=False):
  10. +  def _GetFlattenedData(self, allow_external_script=False, preprocess_only=False):
  11.      if not self._flattened_data:
  12.        filename = self.ToRealPath(self.GetInputPath())
  13.        self._flattened_data = (
  14.            grit.format.html_inline.InlineToString(filename, self,
  15. -              preprocess_only=False,
  16. +              preprocess_only=preprocess_only,
  17.                allow_external_script=allow_external_script))
  18.      return self._flattened_data
  19.    def MandatoryAttributes(self):
  20. @@ -95,6 +95,8 @@ class IncludeNode(base.Node):
  21.      if self.attrs['flattenhtml'] == 'true':
  22.        allow_external_script = self.attrs['allowexternalscript'] == 'true'
  23.        data = self._GetFlattenedData(allow_external_script=allow_external_script)
  24. +    elif self.attrs['preprocess'] == 'true':
  25. +      data = self._GetFlattenedData(allow_external_script=False, preprocess_only=True)
  26.      else:
  27.        data = util.ReadFile(filename, util.BINARY)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top