eric6/Plugins/CheckerPlugins/SyntaxChecker/pyflakes/messages.py

changeset 7064
1010f737def2
parent 6942
2602857055c5
child 7360
9190402e4505
equal deleted inserted replaced
7063:2bea77c643a0 7064:1010f737def2
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
458 462
459 class DefaultExceptNotLast(Message): 463 class DefaultExceptNotLast(Message):
460 """ 464 """
461 Class defining the "Default except not being the last" message. 465 Class defining the "Default except not being the last" message.
462 466
463 Indicates an except block as not the last exception handler. 467 Indicates an except: block as not the last exception handler.
464 """ 468 """
465 message_id = 'F25' 469 message_id = 'F25'
466 message = 'default \'except:\' must be last' 470 message = 'default \'except:\' must be last'
467 471
468 472

eric ide

mercurial