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

Unified Diff: tools/telemetry/telemetry/components/results_viewer.py

Issue 169283004: Introduce telemetry.web_components and a simple component-based Results object (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added HTML output, ready for review Created 6 years, 10 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: tools/telemetry/telemetry/components/results_viewer.py
diff --git a/tools/telemetry/telemetry/components/results_viewer.py b/tools/telemetry/telemetry/components/results_viewer.py
new file mode 100644
index 0000000000000000000000000000000000000000..d120ed65faf77b7a049e6a4aee23040f77a5db4b
--- /dev/null
+++ b/tools/telemetry/telemetry/components/results_viewer.py
@@ -0,0 +1,28 @@
+# Copyright (c) 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+import json
+
+from telemetry.components import viewer
+
+class ResultsViewer(viewer.Viewer):
tonyg 2014/02/19 16:44:32 Can you post a link to an results output file this
+ def __init__(self, data_to_view):
+ super(ResultsViewer, self).__init__(
+ tvcm_module_name='telemetry.components.results_viewer',
+ js_class_name='telemetry.components.ResultsViewer',
+ data_binding_property='dataToView')
+
+ self._data_to_view = data_to_view
+
+ @property
+ def data_to_view(self):
+ return self._data_to_view
+
+ def WriteDataToFileAsJSON(self, f):
slamm 2014/02/19 17:10:51 WriteDataToFileAsJSON -> WriteDataToFileAsJson
+ json.dump(self._data_to_view, f)
+
+
+if __name__ == '__main__':
+ import sys
+ x = ResultsViewer({'hello': 'world', 'nice': ['to', 'see', 'you']})
+ x.WriteViewerToFile(sys.stdout)

Powered by Google App Engine
This is Rietveld 408576698