| Index: third_party/pylint/reporters/html.py
|
| ===================================================================
|
| --- third_party/pylint/reporters/html.py (revision 292881)
|
| +++ third_party/pylint/reporters/html.py (working copy)
|
| @@ -1,5 +1,4 @@
|
| -# Copyright (c) 2003-2006 Sylvain Thenault (thenault@gmail.com).
|
| -# Copyright (c) 2003-2011 LOGILAB S.A. (Paris, FRANCE).
|
| +# Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE).
|
| # This program is free software; you can redistribute it and/or modify it under
|
| # the terms of the GNU General Public License as published by the Free Software
|
| # Foundation; either version 2 of the License, or (at your option) any later
|
| @@ -11,7 +10,7 @@
|
| #
|
| # You should have received a copy of the GNU General Public License along with
|
| # this program; if not, write to the Free Software Foundation, Inc.,
|
| -# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
| +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
| """HTML reporter"""
|
|
|
| import sys
|
| @@ -20,7 +19,7 @@
|
| from logilab.common.ureports import HTMLWriter, Section, Table
|
|
|
| from pylint.interfaces import IReporter
|
| -from pylint.reporters import BaseReporter
|
| +from pylint.reporters import BaseReporter, Message
|
|
|
|
|
| class HTMLReporter(BaseReporter):
|
| @@ -27,6 +26,7 @@
|
| """report messages and layouts in HTML"""
|
|
|
| __implements__ = IReporter
|
| + name = 'html'
|
| extension = 'html'
|
|
|
| def __init__(self, output=sys.stdout):
|
| @@ -35,12 +35,9 @@
|
|
|
| def add_message(self, msg_id, location, msg):
|
| """manage message of different type and in the context of path"""
|
| - module, obj, line, col_offset = location[1:]
|
| - if self.include_ids:
|
| - sigle = msg_id
|
| - else:
|
| - sigle = msg_id[0]
|
| - self.msgs += [sigle, module, obj, str(line), str(col_offset), escape(msg)]
|
| + msg = Message(self, msg_id, location, msg)
|
| + self.msgs += (msg.category, msg.module, msg.obj,
|
| + str(msg.line), str(msg.column), escape(msg.msg))
|
|
|
| def set_output(self, output=None):
|
| """set output stream
|
| @@ -67,3 +64,7 @@
|
| self.msgs = []
|
| HTMLWriter().format(layout, self.out)
|
|
|
| +
|
| +def register(linter):
|
| + """Register the reporter classes with the linter."""
|
| + linter.register_reporter(HTMLReporter)
|
|
|