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

Unified Diff: tools/cr/cr/config.py

Issue 142933004: [cr tool] Make context implicit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/cr/cr/commands/sync.py ('k') | tools/cr/cr/context.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/cr/cr/config.py
diff --git a/tools/cr/cr/config.py b/tools/cr/cr/config.py
index a19b837a446767e12f2fd0e33c01716b01dc31e0..5b4ca8ee6b841967c4f1fa6cfa9ff165d147e05b 100644
--- a/tools/cr/cr/config.py
+++ b/tools/cr/cr/config.py
@@ -97,13 +97,13 @@ class Config(cr.visitor.Node):
Returns:
A dynamic value.
"""
- def Resolve(context):
- test = context.Get(condition)
+ def Resolve(base):
+ test = base.Get(condition)
if test:
value = true_value
else:
value = false_value
- return context.Substitute(value)
+ return base.Substitute(value)
return Resolve
@classmethod
@@ -116,11 +116,11 @@ class Config(cr.visitor.Node):
Returns:
value if it resolves, alternate otherwise.
"""
- def Resolve(context):
+ def Resolve(base):
try:
- return context.Substitute(value)
+ return base.Substitute(value)
except KeyError:
- return context.Substitute(alternate)
+ return base.Substitute(alternate)
return Resolve
def __init__(self, name='--', literal=False, export=None, enabled=True):
« no previous file with comments | « tools/cr/cr/commands/sync.py ('k') | tools/cr/cr/context.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698