2010-05-11 10:23:19 +00:00
|
|
|
""" reporter used by gui.py """
|
|
|
|
|
|
|
|
import sys
|
|
|
|
|
|
|
|
from pylint.interfaces import IReporter
|
2014-08-17 00:40:44 +00:00
|
|
|
from pylint.reporters import BaseReporter
|
|
|
|
from pylint import utils
|
2010-05-11 10:23:19 +00:00
|
|
|
from logilab.common.ureports import TextWriter
|
|
|
|
|
|
|
|
|
|
|
|
class GUIReporter(BaseReporter):
|
|
|
|
"""saves messages"""
|
|
|
|
|
|
|
|
__implements__ = IReporter
|
|
|
|
extension = ''
|
2010-05-12 06:59:15 +00:00
|
|
|
|
2010-05-11 10:23:19 +00:00
|
|
|
def __init__(self, gui, output=sys.stdout):
|
|
|
|
"""init"""
|
|
|
|
BaseReporter.__init__(self, output)
|
|
|
|
self.gui = gui
|
|
|
|
|
2014-08-17 00:57:50 +00:00
|
|
|
def handle_message(self, msg):
|
2010-05-11 10:23:19 +00:00
|
|
|
"""manage message of different type and in the context of path"""
|
2014-08-17 00:57:50 +00:00
|
|
|
self.gui.msg_queue.put(msg)
|
2010-05-12 06:59:15 +00:00
|
|
|
|
2010-05-11 10:23:19 +00:00
|
|
|
def _display(self, layout):
|
|
|
|
"""launch layouts display"""
|
|
|
|
TextWriter().format(layout, self.out)
|