third_party.pylibs.pylint.src/pylint/reporters/guireporter.py
Claudiu Popa 3feb461aad Bring logilab-common's ureports into pylint.reporters.
With this change, we moved away from depending on logilab-common,
having in Pylint all the components that were used from logilab-common.
The API should be considered an implementation detail and can change at
some point in the future.
Closes issue #621.
2015-09-05 15:24:35 +03:00

28 lines
696 B
Python

""" reporter used by gui.py """
import sys
from pylint.interfaces import IReporter
from pylint.reporters import BaseReporter
from pylint.reporters.ureports.text_writer import TextWriter
class GUIReporter(BaseReporter):
"""saves messages"""
__implements__ = IReporter
extension = ''
def __init__(self, gui, output=sys.stdout):
"""init"""
BaseReporter.__init__(self, output)
self.gui = gui
def handle_message(self, msg):
"""manage message of different type and in the context of path"""
self.gui.msg_queue.put(msg)
def _display(self, layout):
"""launch layouts display"""
TextWriter().format(layout, self.out)