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

Unified Diff: recipe_engine/types.py

Issue 2415793003: Setup basic Runtime with properties and platform.
Patch Set: Split out, more immutables, better utilization. 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/types.py
diff --git a/recipe_engine/types.py b/recipe_engine/types.py
index 7859af93324fd84ddec8419319ca5583c4927798..693ae36b1434d49b8657b46fe70fea5403f71db9 100644
--- a/recipe_engine/types.py
+++ b/recipe_engine/types.py
@@ -71,6 +71,14 @@ class FrozenDict(collections.Mapping):
def __repr__(self):
return 'FrozenDict(%r)' % (self._d.items(),)
+ def to_json(self, **kw):
+ """Returns (str): a JSON string containing the encoded FrozenDict.
+
+ Args:
+ kw: Keyword arguments to forward to "json.dumps".
+ """
+ return json.dumps(self._d, **kw)
+
class StepPresentation(object):
STATUSES = set(('SUCCESS', 'FAILURE', 'WARNING', 'EXCEPTION'))

Powered by Google App Engine
This is Rietveld 408576698