From b6e23355f1be8f02ab1e5284e65991382be76dbc Mon Sep 17 00:00:00 2001 From: mathieui Date: Wed, 15 Aug 2018 13:24:11 +0200 Subject: Make pylint happy on plugins It does not like dynamically defined attributes, unsurprisingly --- plugins/code.py | 2 +- plugins/mpd_client.py | 6 +++--- plugins/otr.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins') diff --git a/plugins/code.py b/plugins/code.py index 1c0679f2..fa04f758 100644 --- a/plugins/code.py +++ b/plugins/code.py @@ -27,7 +27,7 @@ from poezio.plugin import BasePlugin from pygments import highlight from pygments.lexers import get_lexer_by_name -from pygments.formatters import HtmlFormatter +from pygments.formatters import HtmlFormatter #pylint: disable=no-name-in-module FORMATTER = HtmlFormatter(nowrap=True, noclasses=True) diff --git a/plugins/mpd_client.py b/plugins/mpd_client.py index c5cd88b8..a8893999 100644 --- a/plugins/mpd_client.py +++ b/plugins/mpd_client.py @@ -76,8 +76,8 @@ class Plugin(BasePlugin): port=self.config.get('port', '6600')) password = self.config.get('password', '') if password: - c.password(password) - current = c.currentsong() + c.password(password) #pylint: disable=no-member + current = c.currentsong() #pylint: disable=no-member artist = current.get('artist', 'Unknown artist') album = current.get('album', 'Unknown album') title = current.get('title', base( @@ -86,7 +86,7 @@ class Plugin(BasePlugin): s = '%s - %s (%s)' % (artist, title, album) if 'full' in args: if 'elapsed' in current and 'time' in current: - current_time = float(c.status()['elapsed']) + current_time = float(c.status()['elapsed']) #pylint: disable=no-member percents = int(current_time / float(current['time']) * 10) s += ' \x192}[\x191}' + '-' * ( percents - 1) + '\x193}+' + '\x191}' + '-' * ( diff --git a/plugins/otr.py b/plugins/otr.py index 1e5944a8..9c80f390 100644 --- a/plugins/otr.py +++ b/plugins/otr.py @@ -637,8 +637,8 @@ class Plugin(BasePlugin): return except ErrorReceived as err: # Received an OTR error - format_dict['err'] = err.args[0].error.decode( - 'utf-8', errors='replace') + proto_error = err.args[0].error # pylint: disable=no-member + format_dict['err'] = proto_error.decode('utf-8', errors='replace') tab.add_message(OTR_ERROR % format_dict, typ=0) del msg['body'] del msg['html'] -- cgit v1.2.3