diff -Nru gedit-pylint-2-3.0~alpha1~bzr108~ubuntu14.10.1/bc-release_override gedit-pylint-2-3.0~bzr116~ubuntu14.10.1/bc-release_override --- gedit-pylint-2-3.0~alpha1~bzr108~ubuntu14.10.1/bc-release_override 2015-02-08 10:46:37.000000000 +0000 +++ gedit-pylint-2-3.0~bzr116~ubuntu14.10.1/bc-release_override 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -history add ['data/ui/images/BEAMED EIGHTH NOTES.png', '2002-2010', u'Free Software Foundation'] -history remove ['COPYING', '2007', 'P. Henrique Silva '] -history remove ['README', '2007', 'P. Henrique Silva '] -history replace ['pylint-2.plugin', '2007', 'P. Henrique Silva ', 'P. Henrique Silva '] -history replace ['pylint-2/__init__.py', '2007', 'P. Henrique Silva ', 'P. Henrique Silva '] -history add ['pylint-2/gedit_pylint.py', '2005', 'Christopher Lenz'] -history replace ['pylint-2/gedit_pylint.py', '2007-2008', 'P. Henrique Silva ', 'P. Henrique Silva '] - -history add ['gedit-pylint-2.gschema.xml', '2014', 'Ricardo Gemignani '] -history add ['pylint-2/config.py', '2014', 'Ricardo Gemignani '] -history add ['pylint-2/config.ui', '2014', 'Ricardo Gemignani '] -history add ['pylint-2/gedit_pylint.py', '2014', 'Ricardo Gemignani '] diff -Nru gedit-pylint-2-3.0~alpha1~bzr108~ubuntu14.10.1/debian/bzr-builder.manifest gedit-pylint-2-3.0~bzr116~ubuntu14.10.1/debian/bzr-builder.manifest --- gedit-pylint-2-3.0~alpha1~bzr108~ubuntu14.10.1/debian/bzr-builder.manifest 2015-02-08 10:46:38.000000000 +0000 +++ gedit-pylint-2-3.0~bzr116~ubuntu14.10.1/debian/bzr-builder.manifest 2015-02-09 10:46:35.000000000 +0000 @@ -1,2 +1,2 @@ -# bzr-builder format 0.3 deb-version {debupstream}~bzr108 -lp:gedit-pylint-2 revid:barcc@gmx.de-20150208103358-j3nmpkxs7vimhbqx +# bzr-builder format 0.3 deb-version {debupstream}~bzr116 +lp:gedit-pylint-2 revid:barcc@gmx.de-20150208175727-4o9dlixkbhoef0m9 diff -Nru gedit-pylint-2-3.0~alpha1~bzr108~ubuntu14.10.1/debian/changelog gedit-pylint-2-3.0~bzr116~ubuntu14.10.1/debian/changelog --- gedit-pylint-2-3.0~alpha1~bzr108~ubuntu14.10.1/debian/changelog 2015-02-08 10:46:38.000000000 +0000 +++ gedit-pylint-2-3.0~bzr116~ubuntu14.10.1/debian/changelog 2015-02-09 10:46:35.000000000 +0000 @@ -1,10 +1,10 @@ -gedit-pylint-2 (3.0~alpha1~bzr108~ubuntu14.10.1) utopic; urgency=low +gedit-pylint-2 (3.0~bzr116~ubuntu14.10.1) utopic; urgency=low * Auto build. - -- Launchpad Package Builder Sun, 08 Feb 2015 10:46:38 +0000 + -- Launchpad Package Builder Mon, 09 Feb 2015 10:46:35 +0000 -gedit-pylint-2 (3.0~alpha1) UNRELEASED; urgency=low +gedit-pylint-2 (3.0) utopic; urgency=low * New release + Support for newer pylint versions @@ -14,7 +14,7 @@ + Use pybuild + Renamed binary package to gedit-pylint-2-plugin - -- B. Clausius Sun, 08 Feb 2015 06:18:42 +0100 + -- B. Clausius Sun, 08 Feb 2015 18:56:47 +0100 gedit-pylint-2 (2.1) oneiric; urgency=low diff -Nru gedit-pylint-2-3.0~alpha1~bzr108~ubuntu14.10.1/pylint-2/gedit_pylint.py gedit-pylint-2-3.0~bzr116~ubuntu14.10.1/pylint-2/gedit_pylint.py --- gedit-pylint-2-3.0~alpha1~bzr108~ubuntu14.10.1/pylint-2/gedit_pylint.py 2015-02-08 10:46:37.000000000 +0000 +++ gedit-pylint-2-3.0~bzr116~ubuntu14.10.1/pylint-2/gedit_pylint.py 2015-02-09 10:46:35.000000000 +0000 @@ -29,21 +29,37 @@ import subprocess import os import re +from collections import namedtuple from gi.repository import GLib from gi.repository import Gtk from gi.repository import Pango +PylintMessage = namedtuple('PylintMessage', 'stock_id lineno message msg_type category tag') + class PylintResultsModel (Gtk.ListStore): + category_to_stock = { + 'error': Gtk.STOCK_DIALOG_ERROR, + 'warning': Gtk.STOCK_DIALOG_WARNING, + 'convention': Gtk.STOCK_DIALOG_INFO, + 'refactor': Gtk.STOCK_DIALOG_INFO, + } + def __init__(self): - super(PylintResultsModel, self).__init__(str, int, str, str, object) + super(PylintResultsModel, self).__init__(str, int, str, str, str, str) def add(self, msg): - self.append([msg.stock_id, msg.lineno, msg.message, msg.msg_type, msg]) - - def add_info(self, doc, message): - self.add(PylintMessage(doc, None, '', -1, message, '', '')) + if msg.stock_id is None: + msg = msg._replace(stock_id=self.category_to_stock.get(msg.category, Gtk.STOCK_NO)) + self.append(msg) + + def add_info(self, message): + self.add(PylintMessage(None, -1, message, None, '', '')) + + def messages(self): + for row in self: + yield PylintMessage(*row) class PylintResultsPanel: @@ -77,46 +93,6 @@ if key != config.pylint_select: config.settings.set_string('pylint-select', key) - -class PylintMessage: - def __init__(self, doc, msg_type, category, lineno, message, method, tag): - self._doc = doc - self._msg_type = msg_type - self._category = category - self._lineno = lineno - self._message = message - self._method = method - self._tag = tag - self._start_iter = None - self._end_iter = None - self._stock_id = self._get_stock_id(category) - - def _get_stock_id(self, category): - if category == "error": - return Gtk.STOCK_DIALOG_ERROR - elif category == "warning": - return Gtk.STOCK_DIALOG_WARNING - elif category in ["convention", "refactor"]: - return Gtk.STOCK_DIALOG_INFO - else: - return Gtk.STOCK_NO - - doc = property(lambda self: self.__doc) - - msg_type = property(lambda self: self._msg_type) - category = property(lambda self: self._category) - - lineno = property(lambda self: self._lineno) - message = property(lambda self: self._message) - - method = property(lambda self: self._method) - tag = property(lambda self: self._tag) - - start = property(lambda self: self._start_iter) - end = property(lambda self: self._end_iter) - - stock_id = property(lambda self: self._stock_id) - class PylintInstance: def __init__(self, window, config): @@ -212,15 +188,15 @@ self._panel.checkbutton_highlight.set_active(True) if doc.get_modified(): - model.add_info(doc, 'Unsaved document') + model.add_info('Unsaved document') return doc_file = doc.get_location() if doc_file is None: - model.add_info(doc, 'No document') + model.add_info('No document') return filename = doc_file.get_path() if filename is None: - model.add_info(doc, 'Not a local file') + model.add_info('Not a local file') return # run pylint from the parentdir of the package, so that pylint can find modules there cwd = doc_file.get_parent() @@ -240,13 +216,13 @@ elif langid == 'python3': pylint_cmd = self._config.pylint3_cmd or 'pylint3' else: - model.add_info(doc, 'Not a Python document') + model.add_info('Not a Python document') return else: - model.add_info(doc, 'Internal error: %r' % self._config.pylint_select) + model.add_info('Internal error: %r' % self._config.pylint_select) return - model.add_info(doc, 'Please wait …') + model.add_info('Please wait …') GLib.idle_add(self.on_run_pylint, doc, model, filename, cwd, pylint_cmd) def on_run_pylint(self, doc, model, filename, cwd, pylint_cmd): @@ -259,7 +235,7 @@ cwd=cwd) except FileNotFoundError as e: model.clear() - model.add_info(doc, str(e)) + model.add_info(str(e)) return stdout, unused_stderr = process.communicate() err_lines = stdout.splitlines() @@ -300,7 +276,6 @@ def _parse_errors(self, err_lines): for line in err_lines: match = self._msg_re.match(line) - if match: msg_type = match.group('type') category = self._msg_categories.get(msg_type[0]) @@ -321,15 +296,8 @@ method = '' msg = 'plugin failed to parse pylint-error: '+line.strip() tag = '' + yield PylintMessage(None, lineno, msg, msg_type, category, tag or '') - yield PylintMessage(self._window.get_active_document, - msg_type, - category, - lineno, - msg, - method, - tag or '') - def _hightlight_errors(self, doc): tag_table = doc.get_tag_table() word_error_tag = tag_table.lookup('pylint-word-error') @@ -342,11 +310,9 @@ result_model = self._result_models[doc] except KeyError: return - for item in result_model: - err = item[4] + for err in result_model.messages(): if err.category != "error": continue - start = doc.get_iter_at_line(err.lineno - 1) end = doc.get_iter_at_line(err.lineno - 1) end.forward_to_line_end() diff -Nru gedit-pylint-2-3.0~alpha1~bzr108~ubuntu14.10.1/setup.py gedit-pylint-2-3.0~bzr116~ubuntu14.10.1/setup.py --- gedit-pylint-2-3.0~alpha1~bzr108~ubuntu14.10.1/setup.py 2015-02-08 10:46:37.000000000 +0000 +++ gedit-pylint-2-3.0~bzr116~ubuntu14.10.1/setup.py 2015-02-09 10:46:35.000000000 +0000 @@ -22,7 +22,7 @@ distutils.core.setup( name='gedit-pylint-2', - version='3.0~alpha1', + version='3.0', license='GPL-3', author='B Clausius', author_email='barcc@gmx.de',