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

Side by Side Diff: recipe_modules/infra_paths/api.py

Issue 1917263002: Revert of depot_tools: add infra_paths recipe module for infra-specific paths (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « recipe_modules/infra_paths/__init__.py ('k') | recipe_modules/infra_paths/config.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 from recipe_engine import recipe_api
6
7
8 class InfraPathsApi(recipe_api.RecipeApi):
9 def get_config_defaults(self):
10 return {
11 'PLATFORM': self.m.platform.name,
12 'CURRENT_WORKING_DIR': self.m.path['cwd'],
13 'ROOT': self.m.path['root'],
14 }
15
16 def __init__(self, **kwargs):
17 super(InfraPathsApi, self).__init__(**kwargs)
18 self._config_set = False
19
20 def _lazy_set_config(self):
21 if self._config_set:
22 return
23 self._config_set = True
24
25 path_config = self.m.properties.get('path_config')
26 if path_config in ('kitchen',):
27 self.set_config(path_config)
28 else:
29 self.set_config('buildbot')
30
31 def __getitem__(self, name):
32 self._lazy_set_config()
33 return self.c.paths[name]
OLDNEW
« no previous file with comments | « recipe_modules/infra_paths/__init__.py ('k') | recipe_modules/infra_paths/config.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698