Utilities/py3flakes/messages.py

changeset 2997
7f0ef975da9e
parent 2965
d133c7edd88a
child 3030
4a0a82ddd9d2
child 3057
10516539f238
equal deleted inserted replaced
2996:c6f16f1b9958 2997:7f0ef975da9e
36 Special method return a string representation of the instance object. 36 Special method return a string representation of the instance object.
37 37
38 @return string representation of the object (string) 38 @return string representation of the object (string)
39 """ 39 """
40 return '{0}:{1} {2}'.format( 40 return '{0}:{1} {2}'.format(
41 self.filename, self.lineno, self.message.format(*self.message_args)) 41 self.filename, self.lineno,
42 self.message.format(*self.message_args))
42 43
43 def getMessageData(self): 44 def getMessageData(self):
44 """ 45 """
45 Public method to get the individual message data elements. 46 Public method to get the individual message data elements.
46 47
47 @return tuple containing file name, line number and message 48 @return tuple containing file name, line number and message
48 (string, integer, string) 49 (string, integer, string)
49 """ 50 """
50 return (self.filename, self.lineno, self.message.format(*self.message_args)) 51 return (self.filename, self.lineno,
52 self.message.format(*self.message_args))
51 53
52 54
53 class UnusedImport(Message): 55 class UnusedImport(Message):
54 """ 56 """
55 Class defining the "Unused Import" message. 57 Class defining the "Unused Import" message.
148 150
149 class UndefinedExport(Message): 151 class UndefinedExport(Message):
150 """ 152 """
151 Class defining the "Undefined Export" message. 153 Class defining the "Undefined Export" message.
152 """ 154 """
153 message = QCoreApplication.translate('py3Flakes', 'Undefined name {0!r} in __all__.') 155 message = QCoreApplication.translate(
156 'py3Flakes', 'Undefined name {0!r} in __all__.')
154 157
155 def __init__(self, filename, lineno, name): 158 def __init__(self, filename, lineno, name):
156 """ 159 """
157 Constructor 160 Constructor
158 161

eric ide

mercurial