diff options
author | zelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-30 00:45:53 +0000 |
---|---|---|
committer | zelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-30 00:45:53 +0000 |
commit | 18a0cbcb3a11d1d3b064f972007e8877a8f81636 (patch) | |
tree | ed17aab1b72b2f47ceb14e1fd7a388917ea08639 /tools/grit | |
parent | ffffe93cb3fcff1ddbff35da546981f905d6fdb5 (diff) | |
download | chromium_src-18a0cbcb3a11d1d3b064f972007e8877a8f81636.zip chromium_src-18a0cbcb3a11d1d3b064f972007e8877a8f81636.tar.gz chromium_src-18a0cbcb3a11d1d3b064f972007e8877a8f81636.tar.bz2 |
Split options page code/html into its own set of files.
Changed grit to support generic <!--include file="..."--> tag in html files to support the scenario above.
TEST=make sure chrome:options page still shows correctly
BUG=chromium-os:4429
Review URL: http://codereview.chromium.org/2835009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51203 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/grit')
-rwxr-xr-x | tools/grit/grit/format/html_inline.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/grit/grit/format/html_inline.py b/tools/grit/grit/format/html_inline.py index 8be2e81..128b267 100755 --- a/tools/grit/grit/format/html_inline.py +++ b/tools/grit/grit/format/html_inline.py @@ -107,6 +107,10 @@ def InlineFile(input_filename, output_filename): return src_match.group(0) return pattern % ReadFile(filepath) + def InlineIncludeFiles(src_match): + """Helper function to inline external script files""" + return InlineFileContents(src_match, '%s') + def InlineScript(src_match): """Helper function to inline external script files""" return InlineFileContents(src_match, '<script>%s</script>') @@ -152,6 +156,11 @@ def InlineFile(input_filename, output_filename): InlineCssFile, flat_text) + flat_text = re.sub( + '<!--\s*include\s+file="(?P<filename>[^"\']*)".*-->', + InlineIncludeFiles, + flat_text) + # TODO(glen): Make this regex not match src="" text that is not inside a tag flat_text = re.sub('src="(?P<filename>[^"\']*)"', SrcReplace, |