39 "E124": QCoreApplication.translate( |
39 "E124": QCoreApplication.translate( |
40 "pep8", |
40 "pep8", |
41 "closing bracket does not match visual indentation"), |
41 "closing bracket does not match visual indentation"), |
42 "E125": QCoreApplication.translate( |
42 "E125": QCoreApplication.translate( |
43 "pep8", |
43 "pep8", |
44 "continuation line does not distinguish itself from next" |
44 "continuation line with same indent as next logical line"), |
45 " logical line"), |
|
46 "E126": QCoreApplication.translate( |
45 "E126": QCoreApplication.translate( |
47 "pep8", |
46 "pep8", |
48 "continuation line over-indented for hanging indent"), |
47 "continuation line over-indented for hanging indent"), |
49 "E127": QCoreApplication.translate( |
48 "E127": QCoreApplication.translate( |
50 "pep8", |
49 "pep8", |
51 "continuation line over-indented for visual indent"), |
50 "continuation line over-indented for visual indent"), |
52 "E128": QCoreApplication.translate( |
51 "E128": QCoreApplication.translate( |
53 "pep8", |
52 "pep8", |
54 "continuation line under-indented for visual indent"), |
53 "continuation line under-indented for visual indent"), |
|
54 "E129": QCoreApplication.translate( |
|
55 "pep8", |
|
56 "visually indented line with same indent as next logical line"), |
|
57 "E131": QCoreApplication.translate( |
|
58 "pep8", |
|
59 "continuation line unaligned for hanging indent"), |
55 "E133": QCoreApplication.translate( |
60 "E133": QCoreApplication.translate( |
56 "pep8", |
61 "pep8", |
57 "closing bracket is missing indentation"), |
62 "closing bracket is missing indentation"), |
58 "W191": QCoreApplication.translate( |
63 "W191": QCoreApplication.translate( |
59 "pep8", |
64 "pep8", |
110 "pep8", |
115 "pep8", |
111 "at least two spaces before inline comment"), |
116 "at least two spaces before inline comment"), |
112 "E262": QCoreApplication.translate( |
117 "E262": QCoreApplication.translate( |
113 "pep8", |
118 "pep8", |
114 "inline comment should start with '# '"), |
119 "inline comment should start with '# '"), |
|
120 "E265": QCoreApplication.translate( |
|
121 "pep8", |
|
122 "block comment should start with '# '"), |
115 "E271": QCoreApplication.translate( |
123 "E271": QCoreApplication.translate( |
116 "pep8", |
124 "pep8", |
117 "multiple spaces after keyword"), |
125 "multiple spaces after keyword"), |
118 "E272": QCoreApplication.translate( |
126 "E272": QCoreApplication.translate( |
119 "pep8", |
127 "pep8", |
182 "pep8", |
190 "pep8", |
183 "comparison to {0} should be {1}"), |
191 "comparison to {0} should be {1}"), |
184 "E712": QCoreApplication.translate( |
192 "E712": QCoreApplication.translate( |
185 "pep8", |
193 "pep8", |
186 "comparison to {0} should be {1}"), |
194 "comparison to {0} should be {1}"), |
|
195 "E713": QCoreApplication.translate( |
|
196 "pep8", |
|
197 "test for membership should be 'not in'"), |
|
198 "E714": QCoreApplication.translate( |
|
199 "pep8", |
|
200 "test for object identity should be 'is not'"), |
187 "E721": QCoreApplication.translate( |
201 "E721": QCoreApplication.translate( |
188 "pep8", |
202 "pep8", |
189 "do not compare types, use 'isinstance()'"), |
203 "do not compare types, use 'isinstance()'"), |
190 "E901": QCoreApplication.translate( |
204 "E901": QCoreApplication.translate( |
191 "pep8", |
205 "pep8", |
192 "{0}: {1}"), |
206 "{0}: {1}"), |
|
207 "E902": QCoreApplication.translate( |
|
208 "pep8", |
|
209 "{0}"), |
193 |
210 |
194 # DocStyleChecker messages |
211 # DocStyleChecker messages |
195 "D101": QCoreApplication.translate( |
212 "D101": QCoreApplication.translate( |
196 "DocStyleChecker", "module is missing a docstring"), |
213 "DocStyleChecker", "module is missing a docstring"), |
197 "D102": QCoreApplication.translate( |
214 "D102": QCoreApplication.translate( |
519 "E303": [3], |
536 "E303": [3], |
520 "E501": [85, 79], |
537 "E501": [85, 79], |
521 "E711": ["None", "'if cond is None:'"], |
538 "E711": ["None", "'if cond is None:'"], |
522 "E712": ["True", "'if cond is True:' or 'if cond:'"], |
539 "E712": ["True", "'if cond is True:' or 'if cond:'"], |
523 "E901": ["SyntaxError", "Invalid Syntax"], |
540 "E901": ["SyntaxError", "Invalid Syntax"], |
|
541 "E902": ["IOError"], |
524 "D232": ["public"], |
542 "D232": ["public"], |
525 "D901": ["SyntaxError", "Invalid Syntax"], |
543 "D901": ["SyntaxError", "Invalid Syntax"], |
|
544 "FWRITE_ERROR": ["IOError"], |
526 } |
545 } |
527 |
546 |
528 |
547 |
529 def getTranslatedMessage(message): |
548 def getTranslatedMessage(message): |
530 """ |
549 """ |
536 """ |
555 """ |
537 if isinstance(message, list): |
556 if isinstance(message, list): |
538 message, args = message |
557 message, args = message |
539 else: |
558 else: |
540 args = [] |
559 args = [] |
|
560 |
541 if message in _messages: |
561 if message in _messages: |
542 if isinstance(args, int): |
562 if isinstance(args, int): |
543 # Retranslate with correct plural form |
563 # Retranslate with correct plural form |
544 return _messages[message](args) |
564 return _messages[message](args) |
545 else: |
565 else: |
546 if message.startswith('F'): |
566 if message.startswith(('FD', 'FE', 'FN', 'FW')): |
547 prefix = '' |
567 prefix = '' |
548 else: |
568 else: |
549 prefix = message + ' ' |
569 prefix = message + ' ' |
550 return prefix + _messages[message].format(*args) |
570 return prefix + _messages[message].format(*args) |
551 elif ' ' in message: |
571 elif ' ' in message: |