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

Unified Diff: recipe_engine/recipe_api.py

Issue 2415793003: Setup basic Runtime with properties and platform.
Patch Set: Created 4 years, 2 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
Index: recipe_engine/recipe_api.py
diff --git a/recipe_engine/recipe_api.py b/recipe_engine/recipe_api.py
index 8827e4c4cf81994edf679d5d216406a3d7829fd6..7f5bbc003677176a965b7d07d77d889651251848 100644
--- a/recipe_engine/recipe_api.py
+++ b/recipe_engine/recipe_api.py
@@ -88,11 +88,11 @@ class PropertiesClient(object):
IDENT = 'properties'
- def __init__(self, engine):
- self._engine = engine
+ def __init__(self, properties):
+ self._properties = properties
def get_properties(self):
- return copy.deepcopy(self._engine.properties)
+ return copy.deepcopy(self._properties)
class StepClient(object):
@@ -127,6 +127,31 @@ class StepClient(object):
return self._engine.run_step(StepConfig.create(**step_dict))
+class PlatformClient(object):
+ """A recipe engine client to expose a common view of the running platform."""
+
+ IDENT = 'platform'
+
+ def __init__(self, plat):
+ self._plat = plat
+
+ # Export normalization methods.
+ self.norm_plat = plat.norm_plat
+ self.norm_bits = plat.norm_bits
+
+ @property
+ def name(self):
+ return self._plat.name
+
+ @property
+ def bits(self):
+ return self._plat.bits
+
+ @property
+ def arch(self):
+ return self._plat.arch
+
+
class DependencyManagerClient(object):
"""A recipe engine client representing the dependency manager."""
« no previous file with comments | « recipe_engine/doc.py ('k') | recipe_engine/run.py » ('j') | recipe_engine/run.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698