Make pylint happy on plugins

It does not like dynamically defined attributes, unsurprisingly
This commit is contained in:
mathieui 2018-08-15 13:24:11 +02:00
parent 6e13b8b735
commit b6e23355f1
No known key found for this signature in database
GPG key ID: C59F84CEEFD616E3
3 changed files with 6 additions and 6 deletions

View file

@ -27,7 +27,7 @@ from poezio.plugin import BasePlugin
from pygments import highlight from pygments import highlight
from pygments.lexers import get_lexer_by_name 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) FORMATTER = HtmlFormatter(nowrap=True, noclasses=True)

View file

@ -76,8 +76,8 @@ class Plugin(BasePlugin):
port=self.config.get('port', '6600')) port=self.config.get('port', '6600'))
password = self.config.get('password', '') password = self.config.get('password', '')
if password: if password:
c.password(password) c.password(password) #pylint: disable=no-member
current = c.currentsong() current = c.currentsong() #pylint: disable=no-member
artist = current.get('artist', 'Unknown artist') artist = current.get('artist', 'Unknown artist')
album = current.get('album', 'Unknown album') album = current.get('album', 'Unknown album')
title = current.get('title', base( title = current.get('title', base(
@ -86,7 +86,7 @@ class Plugin(BasePlugin):
s = '%s - %s (%s)' % (artist, title, album) s = '%s - %s (%s)' % (artist, title, album)
if 'full' in args: if 'full' in args:
if 'elapsed' in current and 'time' in current: 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) percents = int(current_time / float(current['time']) * 10)
s += ' \x192}[\x191}' + '-' * ( s += ' \x192}[\x191}' + '-' * (
percents - 1) + '\x193}+' + '\x191}' + '-' * ( percents - 1) + '\x193}+' + '\x191}' + '-' * (

View file

@ -637,8 +637,8 @@ class Plugin(BasePlugin):
return return
except ErrorReceived as err: except ErrorReceived as err:
# Received an OTR error # Received an OTR error
format_dict['err'] = err.args[0].error.decode( proto_error = err.args[0].error # pylint: disable=no-member
'utf-8', errors='replace') format_dict['err'] = proto_error.decode('utf-8', errors='replace')
tab.add_message(OTR_ERROR % format_dict, typ=0) tab.add_message(OTR_ERROR % format_dict, typ=0)
del msg['body'] del msg['body']
del msg['html'] del msg['html']