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

Side by Side Diff: recipe_modules/path/config.py

Issue 2808713003: path: Add tracking of volatile paths. (Closed)
Patch Set: comments Created 3 years, 8 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/path/api.py ('k') | recipe_modules/path/example.py » ('j') | 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 LUCI Authors. All rights reserved. 1 # Copyright 2013 The LUCI Authors. All rights reserved.
2 # Use of this source code is governed under the Apache License, Version 2.0 2 # Use of this source code is governed under the Apache License, Version 2.0
3 # that can be found in the LICENSE file. 3 # that can be found in the LICENSE file.
4 4
5 from recipe_engine.config import config_item_context, ConfigGroup, Dict, Static 5 from recipe_engine.config import config_item_context, ConfigGroup, Dict, \
6 Set, Static
6 from recipe_engine.config_types import Path 7 from recipe_engine.config_types import Path
7 8
8 def BaseConfig(PLATFORM, START_DIR, TEMP_DIR, CACHE_DIR, **_kwargs): 9 def BaseConfig(PLATFORM, START_DIR, TEMP_DIR, CACHE_DIR, **_kwargs):
9 assert START_DIR[0].endswith(('\\', '/')), START_DIR 10 assert START_DIR[0].endswith(('\\', '/')), START_DIR
10 assert TEMP_DIR[0].endswith(('\\', '/')), TEMP_DIR 11 assert TEMP_DIR[0].endswith(('\\', '/')), TEMP_DIR
11 assert CACHE_DIR[0].endswith(('\\', '/')), CACHE_DIR 12 assert CACHE_DIR[0].endswith(('\\', '/')), CACHE_DIR
12 return ConfigGroup( 13 return ConfigGroup(
13 # base path name -> [tokenized absolute path] 14 # base path name -> [tokenized absolute path]
14 base_paths = Dict(value_type=tuple), 15 base_paths = Dict(value_type=tuple),
15 16
16 # dynamic path name -> Path object (referencing one of the base_paths) 17 # dynamic path name -> Path object (referencing one of the base_paths)
17 dynamic_paths = Dict(value_type=(Path, type(None))), 18 dynamic_paths = Dict(value_type=(Path, type(None))),
18 19
20 # Path keys from "base_paths" and "dynamic_paths" that are known to be
21 # volatile.
22 volatile_paths = Set(str),
23
19 PLATFORM = Static(PLATFORM), 24 PLATFORM = Static(PLATFORM),
20 START_DIR = Static(tuple(START_DIR)), 25 START_DIR = Static(tuple(START_DIR)),
21 TEMP_DIR = Static(tuple(TEMP_DIR)), 26 TEMP_DIR = Static(tuple(TEMP_DIR)),
22 CACHE_DIR = Static(tuple(CACHE_DIR)), 27 CACHE_DIR = Static(tuple(CACHE_DIR)),
23 ) 28 )
24 29
25 config_ctx = config_item_context(BaseConfig) 30 config_ctx = config_item_context(BaseConfig)
26 31
27 @config_ctx(is_root=True) 32 @config_ctx(is_root=True)
28 def BASE(c): 33 def BASE(c):
29 c.base_paths['start_dir'] = c.START_DIR 34 c.base_paths['start_dir'] = c.START_DIR
30 c.base_paths['tmp_base'] = c.TEMP_DIR 35 c.base_paths['tmp_base'] = c.TEMP_DIR
31 c.base_paths['cache'] = c.CACHE_DIR 36 c.base_paths['cache'] = c.CACHE_DIR
32 c.dynamic_paths['checkout'] = None 37 c.dynamic_paths['checkout'] = None
OLDNEW
« no previous file with comments | « recipe_modules/path/api.py ('k') | recipe_modules/path/example.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698