Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: third_party/pylint/reporters/guireporter.py

Issue 739393004: Revert "Revert "pylint: upgrade to 1.3.1"" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/pylint/reporters/__init__.py ('k') | third_party/pylint/reporters/html.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 """ reporter used by gui.py """ 1 """ reporter used by gui.py """
2 2
3 import sys 3 import sys
4 4
5 from pylint.interfaces import IReporter 5 from pylint.interfaces import IReporter
6 from pylint.reporters import BaseReporter 6 from pylint.reporters import BaseReporter, Message
7 from logilab.common.ureports import TextWriter 7 from logilab.common.ureports import TextWriter
8 8
9 9
10 class GUIReporter(BaseReporter): 10 class GUIReporter(BaseReporter):
11 """saves messages""" 11 """saves messages"""
12 12
13 __implements__ = IReporter 13 __implements__ = IReporter
14 extension = '' 14 extension = ''
15 15
16 def __init__(self, gui, output=sys.stdout): 16 def __init__(self, gui, output=sys.stdout):
17 """init""" 17 """init"""
18 BaseReporter.__init__(self, output) 18 BaseReporter.__init__(self, output)
19 self.msgs = []
20 self.gui = gui 19 self.gui = gui
21 20
22 def add_message(self, msg_id, location, msg): 21 def add_message(self, msg_id, location, msg):
23 """manage message of different type and in the context of path""" 22 """manage message of different type and in the context of path"""
24 module, obj, line = location[1:] 23 message = Message(self, msg_id, location, msg)
25 if self.include_ids: 24 self.gui.msg_queue.put(message)
26 sigle = msg_id
27 else:
28 sigle = msg_id[0]
29
30 full_msg = [sigle, module, obj, str(line), msg]
31 self.msgs += [[sigle, module, obj, str(line)]]
32 self.gui.msg_queue.put(full_msg)
33 25
34 def _display(self, layout): 26 def _display(self, layout):
35 """launch layouts display""" 27 """launch layouts display"""
36 TextWriter().format(layout, self.out) 28 TextWriter().format(layout, self.out)
OLDNEW
« no previous file with comments | « third_party/pylint/reporters/__init__.py ('k') | third_party/pylint/reporters/html.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698