OLD | NEW |
1 #!/usr/bin/python | |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 3 # found in the LICENSE file. |
5 | 4 |
6 """Bug module that is necessary for the layout analyzer.""" | 5 """Bug module that is necessary for the layout analyzer.""" |
7 | 6 |
8 import re | 7 import re |
9 | 8 |
10 | 9 |
11 class Bug: | 10 class Bug(object): |
12 """A class representing a bug. | 11 """A class representing a bug. |
13 | 12 |
14 TODO(imasaki): add more functionalities here if bug-tracker API is available. | 13 TODO(imasaki): add more functionalities here if bug-tracker API is available. |
15 For example, you can get the name of a bug owner. | 14 For example, you can get the name of a bug owner. |
16 """ | 15 """ |
17 CHROME_BUG_URL = 'http://crbug.com/' | 16 CHROME_BUG_URL = 'http://crbug.com/' |
18 WEBKIT_BUG_URL = 'http://webkit.org/b/' | 17 WEBKIT_BUG_URL = 'http://webkit.org/b/' |
19 # Type enum for the bug. | 18 # Type enum for the bug. |
20 WEBKIT = 0 | 19 WEBKIT = 0 |
21 CHROMIUM = 1 | 20 CHROMIUM = 1 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 return | 52 return |
54 self.url = '' | 53 self.url = '' |
55 | 54 |
56 def __str__(self): | 55 def __str__(self): |
57 """Get a string representation of a bug object. | 56 """Get a string representation of a bug object. |
58 | 57 |
59 Returns: | 58 Returns: |
60 a string for HTML link representation of a bug. | 59 a string for HTML link representation of a bug. |
61 """ | 60 """ |
62 return '<a href="%s">%s</a>' % (self.url, self.bug_txt) | 61 return '<a href="%s">%s</a>' % (self.url, self.bug_txt) |
OLD | NEW |