Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: third_party/recipe_engine/util.py

Issue 1151423002: Move recipe engine to third_party/recipe_engine. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Moved field_composer_test with its buddies Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/recipe_engine/unittests/field_composer_test.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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()
OLDNEW
« no previous file with comments | « third_party/recipe_engine/unittests/field_composer_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698