Chromium Code Reviews| Index: tools/telemetry/telemetry/value/__init__.py |
| diff --git a/tools/telemetry/telemetry/value/__init__.py b/tools/telemetry/telemetry/value/__init__.py |
| index 8bba418e09af16f4afa2f7005597da594a1e3066..8d03d78eb218e6924ff3e596a19c56b3047386ff 100644 |
| --- a/tools/telemetry/telemetry/value/__init__.py |
| +++ b/tools/telemetry/telemetry/value/__init__.py |
| @@ -42,7 +42,7 @@ SUMMARY_RESULT_OUTPUT_CONTEXT = 'summary-result-output-context' |
| class Value(object): |
| """An abstract value produced by a telemetry page test. |
| """ |
| - def __init__(self, page, name, units, important, description): |
| + def __init__(self, page, name, units, important, description, paths): |
| """A generic Value object. |
| Args: |
| @@ -56,12 +56,17 @@ class Value(object): |
| by default in downstream UIs. |
| description: A string explaining in human-understandable terms what this |
| value represents. |
| + paths: A list of paths corresponding to files associated with this value. |
|
nednguyen
2014/09/08 18:45:24
What are paths? Are they strings, or are they inst
|
| """ |
| self.page = page |
| self.name = name |
| self.units = units |
| self.important = important |
| self.description = description |
| + if paths is None: |
| + self.paths = [] |
| + else: |
| + self.paths = paths |
| def IsMergableWith(self, that): |
| return (self.units == that.units and |
| @@ -187,6 +192,11 @@ class Value(object): |
| if self.page: |
| d['page_id'] = self.page.id |
|
nduca
2014/09/08 18:53:02
How about
""Returns file handle... or none."""
|
| + if self.paths: |
| + # Assigning IDs to paths is a serialization detail, so we defer updating |
| + # this to an ID until we actually intend on serializing this value. |
| + d['paths'] = self.paths |
| + |
| return d |
| def AsDictWithoutBaseClassEntries(self): |