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

Side by Side Diff: media/tools/layout_tests/bug.py

Issue 7693018: Intial checkin of layout test analyzer. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « media/tools/layout_tests/anno/anno.csv ('k') | media/tools/layout_tests/layouttest_analyzer.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/python
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 import re
7
8
9 class Bug:
10 """A class dealing with bug.
11
12 TODO(imasaki): add more functionalities here if bug-tracker API is available.
13 For example, you can get owner of the bug.
14 """
15 CHROME_BUG_URL = 'http://crbug.com/'
16 WEBKIT_BUG_URL = 'http://bugs.webkit.org/show_bug.cgi?id='
Ami GONE FROM CHROMIUM 2011/08/23 14:49:14 FWIW there's a redirect from http://webkit.org/b/<
imasaki1 2011/08/23 21:18:03 Done.
17 # Type enum for the bug
18 WEBKIT = 0
19 CHROMIUM = 1
20 OTHERS = 2
21
22 def __init__(self, bug_txt):
23 self.bug_txt = bug_txt
24 pattern_for_webkit_bug = r'BUGWK(\d+)'
25 match = re.search(pattern_for_webkit_bug, bug_txt)
26 if match:
27 self.type = self.WEBKIT
28 self.url = self.WEBKIT_BUG_URL + match.group(1)
29 return
30 pattern_for_chrome_bug = r'BUGCR(\d+)'
31 match = re.search(pattern_for_chrome_bug, bug_txt)
32 if match:
33 self.type = self.CHROMIUM
34 self.url = self.CHROME_BUG_URL + match.group(1)
35 return
36 pattern_for_other_bug = r'BUG(\S+)'
37 match = re.search(pattern_for_other_bug, bug_txt)
38 if match:
39 self.type = self.OTHERS
40 self.url = 'mailto:%s@chromium.org' % match.group(1).lower()
41 return
42 self.url = ''
43
44 def ToString(self):
45 return '<a href="%s">%s</a>' % (self.url, self.bug_txt)
OLDNEW
« no previous file with comments | « media/tools/layout_tests/anno/anno.csv ('k') | media/tools/layout_tests/layouttest_analyzer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698