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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 'CHROME_SHORT_NAME': 'Chromium', | 157 'CHROME_SHORT_NAME': 'Chromium', |
158 'CHROME_UPDATE_REGISTRY_SUBKEY': 'Software\\Chromium', | 158 'CHROME_UPDATE_REGISTRY_SUBKEY': 'Software\\Chromium', |
159 'CHROME_CLIENT_STATE_KEY': 'Software\\Chromium', | 159 'CHROME_CLIENT_STATE_KEY': 'Software\\Chromium', |
160 'SUPPORTS_SXS': False | 160 'SUPPORTS_SXS': False |
161 }) | 161 }) |
162 else: | 162 else: |
163 raise KeyError("Unknown mini_installer product name '%s'" % | 163 raise KeyError("Unknown mini_installer product name '%s'" % |
164 mini_installer_product_name) | 164 mini_installer_product_name) |
165 | 165 |
166 | 166 |
167 def Expand(self, str): | 167 def Expand(self, input_string): |
168 """Expands variables in the given string. | 168 """Expands variables in the given string. |
169 | 169 |
170 This method resolves only variables defined in the constructor. It does not | 170 This method resolves only variables defined in the constructor. It does not |
171 resolve environment variables. Any dollar signs that are not part of | 171 resolve environment variables. Any dollar signs that are not part of |
172 variables must be escaped with $$, otherwise a KeyError or a ValueError will | 172 variables must be escaped with $$, otherwise a KeyError or a ValueError will |
173 be raised. | 173 be raised. |
174 | 174 |
175 Args: | 175 Args: |
176 str: A string. | 176 input_string: A string with variables. |
177 | 177 |
178 Returns: | 178 Returns: |
179 A new string created by replacing variables with their values. | 179 A new string created by replacing variables with their values. |
180 """ | 180 """ |
181 return string.Template(str).substitute(self._variable_mapping) | 181 return string.Template(input_string).substitute(self._variable_mapping) |
OLD | NEW |