mirror of
https://fuchsia.googlesource.com/third_party/github.com/pylint-dev/pylint
synced 2024-09-21 16:19:21 +00:00
29 lines
707 B
Python
29 lines
707 B
Python
""" reporter used by gui.py """
|
|
|
|
import sys
|
|
|
|
from pylint.interfaces import IReporter
|
|
from pylint.reporters import BaseReporter
|
|
from pylint import utils
|
|
from logilab.common.ureports 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)
|