22 |
22 |
23 def __init__(self, filename, loc): |
23 def __init__(self, filename, loc): |
24 """ |
24 """ |
25 Constructor |
25 Constructor |
26 |
26 |
27 @param filename name of the file (string) |
27 @param filename name of the file |
|
28 @type str |
28 @param loc location of the issue |
29 @param loc location of the issue |
29 """ |
30 """ |
30 self.filename = filename |
31 self.filename = filename |
31 self.lineno = loc.lineno |
32 self.lineno = loc.lineno |
32 self.col = getattr(loc, 'col_offset', 0) |
33 self.col = getattr(loc, 'col_offset', 0) |
33 |
34 |
34 def __str__(self): |
35 def __str__(self): |
35 """ |
36 """ |
36 Special method return a string representation of the instance object. |
37 Special method return a string representation of the instance object. |
37 |
38 |
38 @return string representation of the object (string) |
39 @return string representation of the object |
39 """ |
40 @rtype str |
40 return '{0}:{1}: {2}'.format( |
41 """ |
41 self.filename, self.lineno, self.message % self.message_args) |
42 return '{0}:{1}:{2} {3}'.format( |
|
43 self.filename, self.lineno, self.col + 1, |
|
44 self.message % self.message_args) |
42 |
45 |
43 def getMessageData(self): |
46 def getMessageData(self): |
44 """ |
47 """ |
45 Public method to get the individual message data elements. |
48 Public method to get the individual message data elements. |
46 |
49 |
47 @return tuple containing file name, line number, column, message ID |
50 @return tuple containing file name, line number, column, message ID |
48 and message arguments (string, integer, integer, string, list) |
51 and message arguments |
|
52 @rtype tuple of (str, int, int, str, list) |
49 """ |
53 """ |
50 return (self.filename, self.lineno, self.col, self.message_id, |
54 return (self.filename, self.lineno, self.col, self.message_id, |
51 self.message_args) |
55 self.message_args) |
52 |
56 |
53 |
57 |