diff options
author | rahulk@google.com <rahulk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-22 22:17:57 +0000 |
---|---|---|
committer | rahulk@google.com <rahulk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-22 22:17:57 +0000 |
commit | 9c791f97c1eec79f10baf6144e6a0526cb4ebad0 (patch) | |
tree | 30062562d605e8b9db0e7a535cf382d298727f11 /chrome/tools | |
parent | 4f7ce3e8339973a5e790b925ee1463e338ed0edb (diff) | |
download | chromium_src-9c791f97c1eec79f10baf6144e6a0526cb4ebad0.zip chromium_src-9c791f97c1eec79f10baf6144e6a0526cb4ebad0.tar.gz chromium_src-9c791f97c1eec79f10baf6144e6a0526cb4ebad0.tar.bz2 |
Move distribution specific theme images:
- Google Chrome images are in internal repository now and get checked out into app\theme\google_chrome so delete them from app\theme
- Add Chromium images to app\theme\Chromium
- Modify html inlining script to pick up images from different places depending on environment variable (for now the default is google chrome which will change to chromium).
- Moving icon file to private repository as well so delete it from public repository. In its place add chromium icon.
- chromium\product_logo.png is a not actually a logo but just the blue icon in the same size as google_chrome\product_logo.png. This file makes about:version and new tab page look prettier (imo).
BUG=1296800
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1249 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/tools')
-rw-r--r-- | chrome/tools/build/win/html_inline.py | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/chrome/tools/build/win/html_inline.py b/chrome/tools/build/win/html_inline.py index 17d24ca..1ae5ea1 100644 --- a/chrome/tools/build/win/html_inline.py +++ b/chrome/tools/build/win/html_inline.py @@ -38,11 +38,17 @@ This does not inline CSS styles, nor does it inline anything referenced from an inlined file. """ +import os import re import sys import base64 import mimetypes -from os import path + +# TODO(rahulk) The default here will change to 'CHROMIUM' as soon as the buildbots +# are ready with the correct environment variable +DIST_DEFAULT = 'GOOGLE_CHROME' +DIST_ENV_VAR = 'CHROMIUM_BUILD' +DIST_SUBSTR = '%DISTRIBUTION%' def ReadFile(input_filename): """Helper function that returns input_filename as a string. @@ -58,16 +64,18 @@ def ReadFile(input_filename): f.close() return file_contents -def SrcInline(src_match, base_path): +def SrcInline(src_match, base_path, distribution): """regex replace function. Takes a regex match for src="filename", attempts to read the file at 'filename' and returns the src attribute with the file inlined - as a data URI + as a data URI. If it finds DIST_SUBSTR string in file name, replaces + it with distribution. Args: src_match: regex match object with 'filename' named capturing group base_path: path that to look for files in + distribution: string that should replace DIST_SUBSTR Returns: string @@ -78,7 +86,8 @@ def SrcInline(src_match, base_path): # filename is probably a URL, which we don't want to bother inlining return src_match.group(0) - filepath = path.join(base_path, filename) + filename = filename.replace('%DISTRIBUTION%', distribution) + filepath = os.path.join(base_path, filename) mimetype = mimetypes.guess_type(filename)[0] or 'text/plain' inline_data = base64.standard_b64encode(ReadFile(filepath)) @@ -97,11 +106,17 @@ def InlineFile(input_filename, output_filename): output_filename: name of file to be written to """ print "inlining %s to %s" % (input_filename, output_filename) - input_filepath = path.dirname(input_filename) + input_filepath = os.path.dirname(input_filename) + distribution = DIST_DEFAULT + if DIST_ENV_VAR in os.environ.keys(): + distribution = os.environ[DIST_ENV_VAR] + if len(distribution) > 1 and distribution[0] == '_': + distribution = distribution[1:].lower() + def SrcReplace(src_match): """Helper function to provide SrcInline with the base file path""" - return SrcInline(src_match, input_filepath) + return SrcInline(src_match, input_filepath, distribution) # TODO(glen): Make this regex not match src="" text that is not inside a tag flat_text = re.sub('src="(?P<filename>[^"\']*)"', |