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

Unified Diff: tools/findit/result.py

Issue 421223003: [Findit] Plain objects to represent the returned result from running the algorithm, (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added JSON format Created 6 years, 4 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/findit/match_set.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/findit/result.py
diff --git a/tools/findit/result.py b/tools/findit/result.py
new file mode 100644
index 0000000000000000000000000000000000000000..143a6940bb809f3e7a9ceec6574c586a610e85d2
--- /dev/null
+++ b/tools/findit/result.py
@@ -0,0 +1,35 @@
+# 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
+
+
+class Result(object):
+
+ def __init__(self, suspected_cl, revision_url, component_name, author,
+ reason, review_url, reviewers, line_content):
+ self.suspected_cl = suspected_cl
+ self.suspected_cl_revision_url = revision_url
+ self.component_name = component_name
+ self.author = author
+ self.reason = reason
+ self.review_url = review_url
+ self.reviewers = reviewers
+ self.line_content = line_content
+
+ def ToDictionary(self):
+ """Returns the dictionary object for this result."""
+ result_dict = {
+ 'suspected cl': self.suspected_cl,
+ 'suspected cl revision url': self.suspected_cl_revision_url,
stgao 2014/08/14 17:47:15 Could we use a shorter name like just 'revision_ur
jeun 2014/08/14 18:03:59 Done.
+ 'component name': self.component_name,
+ 'author': self.author,
+ 'reason': self.reason,
+ 'review url': self.review_url,
+ 'reviewers': self.reviewers,
+ 'line content': self.line_content
+ }
+
+ return result_dict
+
stgao 2014/08/14 17:47:15 This empty line could be removed.
jeun 2014/08/14 18:03:59 Done.
« no previous file with comments | « tools/findit/match_set.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698