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

Unified Diff: tools/cr/cr/base/platform.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/base/host.py ('k') | tools/cr/cr/commands/build.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/cr/cr/base/platform.py
diff --git a/tools/cr/cr/base/platform.py b/tools/cr/cr/base/platform.py
index db6f66d298349bd3bb15de140b80af24781bc929..0220d9f164ee04a709b436115cf9b0084f54f1e7 100644
--- a/tools/cr/cr/base/platform.py
+++ b/tools/cr/cr/base/platform.py
@@ -39,13 +39,13 @@ class Platform(cr.Plugin, cr.Plugin.Type):
def __init__(self):
super(Platform, self).__init__()
- def Activate(self, context):
- super(Platform, self).Activate(context)
- if _PathFixup not in context.fixup_hooks:
- context.fixup_hooks.append(_PathFixup)
+ def Activate(self):
+ super(Platform, self).Activate()
+ if _PathFixup not in cr.context.fixup_hooks:
+ cr.context.fixup_hooks.append(_PathFixup)
@cr.Plugin.activemethod
- def Prepare(self, context):
+ def Prepare(self):
pass
@property
@@ -53,12 +53,12 @@ class Platform(cr.Plugin, cr.Plugin.Type):
return []
-def _PathFixup(context, key, value):
+def _PathFixup(base, key, value):
"""A context fixup that does platform specific modifications to the PATH."""
if key == 'PATH':
paths = []
- for entry in Platform.GetActivePlugin(context).paths:
- entry = context.Substitute(entry)
+ for entry in Platform.GetActivePlugin().paths:
+ entry = base.Substitute(entry)
if entry not in paths:
paths.append(entry)
for entry in value.split(os.path.pathsep):
« no previous file with comments | « tools/cr/cr/base/host.py ('k') | tools/cr/cr/commands/build.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698