OLD | NEW |
---|---|
1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import base64 | 5 import base64 |
6 import hashlib | 6 import hashlib |
7 import os | 7 import os |
8 import string | 8 import string |
9 import win32api | 9 import win32api |
10 import win32com.client | 10 import win32com.client |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
101 chrome_update_registry_subkey = ('Software\\Google\\Update\\Clients\\' | 101 chrome_update_registry_subkey = ('Software\\Google\\Update\\Clients\\' |
102 '{8A69D345-D564-463c-AFF1-A69D9E530F96}') | 102 '{8A69D345-D564-463c-AFF1-A69D9E530F96}') |
103 chrome_html_prog_id = 'ChromeHTML' | 103 chrome_html_prog_id = 'ChromeHTML' |
104 elif mini_installer_product_name == 'Chromium Installer': | 104 elif mini_installer_product_name == 'Chromium Installer': |
105 chrome_short_name = 'Chromium' | 105 chrome_short_name = 'Chromium' |
106 chrome_long_name = 'Chromium' | 106 chrome_long_name = 'Chromium' |
107 chrome_dir = 'Chromium' | 107 chrome_dir = 'Chromium' |
108 chrome_update_registry_subkey = 'Software\\Chromium' | 108 chrome_update_registry_subkey = 'Software\\Chromium' |
109 chrome_html_prog_id = 'ChromiumHTM' | 109 chrome_html_prog_id = 'ChromiumHTM' |
110 else: | 110 else: |
111 raise KeyError("Unknown mini_installer product name '%s'" % | 111 raise KeyError("Unknown mini_installer product name '%s' for %s" % |
112 mini_installer_product_name) | 112 (mini_installer_product_name, mini_installer_abspath)) |
Avi (use Gerrit)
2014/03/27 18:36:50
What's this doing in this CL?
| |
113 | 113 |
114 self._variable_mapping = { | 114 self._variable_mapping = { |
115 'PROGRAM_FILES': program_files_path, | 115 'PROGRAM_FILES': program_files_path, |
116 'LOCAL_APPDATA': local_appdata_path, | 116 'LOCAL_APPDATA': local_appdata_path, |
117 'MINI_INSTALLER': mini_installer_abspath, | 117 'MINI_INSTALLER': mini_installer_abspath, |
118 'MINI_INSTALLER_FILE_VERSION': mini_installer_file_version, | 118 'MINI_INSTALLER_FILE_VERSION': mini_installer_file_version, |
119 'CHROME_SHORT_NAME': chrome_short_name, | 119 'CHROME_SHORT_NAME': chrome_short_name, |
120 'CHROME_LONG_NAME': chrome_long_name, | 120 'CHROME_LONG_NAME': chrome_long_name, |
121 'CHROME_DIR': chrome_dir, | 121 'CHROME_DIR': chrome_dir, |
122 'CHROME_UPDATE_REGISTRY_SUBKEY': chrome_update_registry_subkey, | 122 'CHROME_UPDATE_REGISTRY_SUBKEY': chrome_update_registry_subkey, |
(...skipping 16 matching lines...) Expand all Loading... | |
139 variables must be escaped with $$, otherwise a KeyError or a ValueError will | 139 variables must be escaped with $$, otherwise a KeyError or a ValueError will |
140 be raised. | 140 be raised. |
141 | 141 |
142 Args: | 142 Args: |
143 str: A string. | 143 str: A string. |
144 | 144 |
145 Returns: | 145 Returns: |
146 A new string created by replacing variables with their values. | 146 A new string created by replacing variables with their values. |
147 """ | 147 """ |
148 return string.Template(str).substitute(self._variable_mapping) | 148 return string.Template(str).substitute(self._variable_mapping) |
OLD | NEW |