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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « tools/findit/match_set.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import json
6
7
8 class Result(object):
9
10 def __init__(self, suspected_cl, revision_url, component_name, author,
11 reason, review_url, reviewers, line_content):
12 self.suspected_cl = suspected_cl
13 self.suspected_cl_revision_url = revision_url
14 self.component_name = component_name
15 self.author = author
16 self.reason = reason
17 self.review_url = review_url
18 self.reviewers = reviewers
19 self.line_content = line_content
20
21 def ToDictionary(self):
22 """Returns the dictionary object for this result."""
23 result_dict = {
24 'suspected cl': self.suspected_cl,
25 '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.
26 'component name': self.component_name,
27 'author': self.author,
28 'reason': self.reason,
29 'review url': self.review_url,
30 'reviewers': self.reviewers,
31 'line content': self.line_content
32 }
33
34 return result_dict
35
stgao 2014/08/14 17:47:15 This empty line could be removed.
jeun 2014/08/14 18:03:59 Done.
OLDNEW
« 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