| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013-2015 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 functools | 5 import functools |
| 6 import os | 6 import os |
| 7 | 7 |
| 8 from cStringIO import StringIO | 8 from cStringIO import StringIO |
| 9 | 9 |
| 10 | |
| 11 SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__)) | |
| 12 BUILD_ROOT = os.path.dirname(os.path.dirname(SCRIPT_PATH)) | |
| 13 ROOT_PATH = os.path.abspath(os.path.join( | |
| 14 SCRIPT_PATH, os.pardir, os.pardir, os.pardir)) | |
| 15 BASE_DIRS = [ | |
| 16 SCRIPT_PATH, | |
| 17 os.path.join(ROOT_PATH, 'build_internal', 'scripts', 'slave'), | |
| 18 os.path.join(ROOT_PATH, 'build_internal', 'scripts', 'slave-internal') | |
| 19 ] | |
| 20 MODULE_DIRS = lambda: [os.path.join(x, 'recipe_modules') for x in BASE_DIRS] | |
| 21 RECIPE_DIRS = lambda: [os.path.join(x, 'recipes') for x in BASE_DIRS] | |
| 22 | |
| 23 | |
| 24 class RecipeAbort(Exception): | 10 class RecipeAbort(Exception): |
| 25 pass | 11 pass |
| 26 | 12 |
| 27 | 13 |
| 28 class ModuleInjectionError(AttributeError): | 14 class ModuleInjectionError(AttributeError): |
| 29 pass | 15 pass |
| 30 | 16 |
| 31 | 17 |
| 32 class ModuleInjectionSite(object): | 18 class ModuleInjectionSite(object): |
| 33 def __init__(self, owner_module=None): | 19 def __init__(self, owner_module=None): |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 self.lines[-1].write(s) | 139 self.lines[-1].write(s) |
| 154 break | 140 break |
| 155 self.lines[-1].write(s[:i]) | 141 self.lines[-1].write(s[:i]) |
| 156 self.lines[-1] = self.lines[-1].getvalue() | 142 self.lines[-1] = self.lines[-1].getvalue() |
| 157 self.lines.append(StringIO()) | 143 self.lines.append(StringIO()) |
| 158 s = s[i+1:] | 144 s = s[i+1:] |
| 159 | 145 |
| 160 def close(self): | 146 def close(self): |
| 161 if not isinstance(self.lines[-1], basestring): | 147 if not isinstance(self.lines[-1], basestring): |
| 162 self.lines[-1] = self.lines[-1].getvalue() | 148 self.lines[-1] = self.lines[-1].getvalue() |
| OLD | NEW |