From 36775ae88b87cb6a126f9f0091b1a8dd41e8e0be Mon Sep 17 00:00:00 2001 From: lakshyacis Date: Mon, 23 Sep 2019 16:07:04 +0530 Subject: [PATCH 1/8] indicator_libmessaging pylint fixes --- src/plugins/indicator_libmessaging.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/plugins/indicator_libmessaging.py b/src/plugins/indicator_libmessaging.py index 3617866346..ab2e833e94 100644 --- a/src/plugins/indicator_libmessaging.py +++ b/src/plugins/indicator_libmessaging.py @@ -1,4 +1,8 @@ # -*- coding: utf-8 -*- +""" +src/plugins/indicator_libmessaging.py +===================================== +""" import gi gi.require_version('MessagingMenu', '1.0') # noqa:E402 @@ -9,6 +13,7 @@ class IndicatorLibmessaging(object): + """Plugin for libmessage indicator""" def __init__(self, form): try: self.app = MessagingMenu.App(desktop_id='pybitmessage.desktop') @@ -32,15 +37,18 @@ def __del__(self): if self.app: self.app.unregister() - def activate(self, app, source): + def activate(self, app, source): # pylint: disable=unused-argument + """Activate the libmessaging indicator plugin""" self.form.appIndicatorInbox( self.new_message_item if source == 'messages' else self.new_broadcast_item ) - # show the number of unread messages and subscriptions - # on the messaging menu def show_unread(self, draw_attention=False): + """ + show the number of unread messages and subscriptions + on the messaging menu + """ for source, count in zip( ('messages', 'subscriptions'), self.form.getUnread() From 4c1568a3eb4c6748c2e26c56d50a60e1c17271b7 Mon Sep 17 00:00:00 2001 From: lakshyacis Date: Mon, 23 Sep 2019 16:07:23 +0530 Subject: [PATCH 2/8] menu_qrcode pylint fixes --- src/plugins/menu_qrcode.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/menu_qrcode.py b/src/plugins/menu_qrcode.py index 7f21c6b88f..2e65bd8830 100644 --- a/src/plugins/menu_qrcode.py +++ b/src/plugins/menu_qrcode.py @@ -1,5 +1,8 @@ # -*- coding: utf-8 -*- """ +src/plugins/menu_qrcode.py +========================== + A menu plugin showing QR-Code for bitmessage address in modal dialog. """ @@ -12,9 +15,10 @@ # http://stackoverflow.com/questions/20452486 -class Image(qrcode.image.base.BaseImage): +class Image(qrcode.image.base.BaseImage): # pylint: disable=abstract-method """Image output class for qrcode using QPainter""" - def __init__(self, border, width, box_size): + + def __init__(self, border, width, box_size): # pylint: disable=super-init-not-called self.border = border self.width = width self.box_size = box_size From 7aa9b94c111106ea739ea3890b351a5c953d6a43 Mon Sep 17 00:00:00 2001 From: lakshyacis Date: Mon, 23 Sep 2019 16:08:00 +0530 Subject: [PATCH 3/8] notification_notify2 pylint fixes --- src/plugins/notification_notify2.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/notification_notify2.py b/src/plugins/notification_notify2.py index 3fd935c47f..b4cd045dfc 100644 --- a/src/plugins/notification_notify2.py +++ b/src/plugins/notification_notify2.py @@ -1,4 +1,8 @@ # -*- coding: utf-8 -*- +""" +src/plugins/notification_notify2.py +=================================== +""" import gi gi.require_version('Notify', '0.7') @@ -6,10 +10,13 @@ Notify.init('pybitmessage') + def connect_plugin(title, subtitle, category, label, icon): + """Plugin for notify2""" if not icon: icon = 'mail-message-new' if category == 2 else 'pybitmessage' connect_plugin.notification.update(title, subtitle, icon) connect_plugin.notification.show() + connect_plugin.notification = Notify.Notification.new("Init", "Init") From e50f99419fba105a56b100c89958b281ff21cc14 Mon Sep 17 00:00:00 2001 From: lakshyacis Date: Mon, 23 Sep 2019 16:08:18 +0530 Subject: [PATCH 4/8] plugin pylint fixes --- src/plugins/plugin.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/plugin.py b/src/plugins/plugin.py index 6601adafb9..e671a73f00 100644 --- a/src/plugins/plugin.py +++ b/src/plugins/plugin.py @@ -1,5 +1,8 @@ # -*- coding: utf-8 -*- - +""" +src/plugins/plugin.py +=================================== +""" import pkg_resources From df1994d6f3f02b833bbd690102ad8dfbbe3aa9c0 Mon Sep 17 00:00:00 2001 From: lakshyacis Date: Mon, 23 Sep 2019 16:08:34 +0530 Subject: [PATCH 5/8] proxyconfig_stem pylint fixes --- src/plugins/proxyconfig_stem.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins/proxyconfig_stem.py b/src/plugins/proxyconfig_stem.py index e8b5417ecf..5bb9a726e7 100644 --- a/src/plugins/proxyconfig_stem.py +++ b/src/plugins/proxyconfig_stem.py @@ -1,5 +1,8 @@ # -*- coding: utf-8 -*- - +""" +src/plugins/proxyconfig_stem.py +=================================== +""" import os import logging import random # noseq @@ -29,14 +32,14 @@ def __call__(self, line): # Plugin's debug or unexpected log line from tor self._logger.debug(line) else: - self._logger.log(self._levels.get(level, 10), '(tor)' + line) + self._logger.log(self._levels.get(level, 10), '(tor) %s', line) def connect_plugin(config): # pylint: disable=too-many-branches """Run stem proxy configurator""" logwrite = DebugLogger() if config.safeGet('bitmessagesettings', 'sockshostname') not in ( - 'localhost', '127.0.0.1', '' + 'localhost', '127.0.0.1', '' ): # remote proxy is choosen for outbound connections, # nothing to do here, but need to set socksproxytype to SOCKS5! From a86c5188c44411d173bd2a15b24b7801b8bddf8b Mon Sep 17 00:00:00 2001 From: lakshyacis Date: Mon, 23 Sep 2019 16:08:56 +0530 Subject: [PATCH 6/8] sound_canberra pylint fixes --- src/plugins/sound_canberra.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/sound_canberra.py b/src/plugins/sound_canberra.py index 094901ed56..dbb4baed62 100644 --- a/src/plugins/sound_canberra.py +++ b/src/plugins/sound_canberra.py @@ -1,4 +1,8 @@ # -*- coding: utf-8 -*- +""" +src/plugins/proxyconfig_stem.py +=================================== +""" from pybitmessage.bitmessageqt import sound @@ -14,7 +18,8 @@ } -def connect_plugin(category, label=None): +def connect_plugin(category, label=None): # pylint: disable=unused-argument + """This function implements the entry point.""" try: _canberra.play(0, pycanberra.CA_PROP_EVENT_ID, _theme[category], None) except (KeyError, pycanberra.CanberraException): From a86e43c108c4117472868f2bcecdb0f4d20df31e Mon Sep 17 00:00:00 2001 From: lakshyacis Date: Mon, 23 Sep 2019 16:09:19 +0530 Subject: [PATCH 7/8] sound_gstreamer pylint fixes --- src/plugins/sound_gstreamer.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/sound_gstreamer.py b/src/plugins/sound_gstreamer.py index 062da3f9df..32a0aa650b 100644 --- a/src/plugins/sound_gstreamer.py +++ b/src/plugins/sound_gstreamer.py @@ -1,5 +1,8 @@ # -*- coding: utf-8 -*- - +""" +src/plugins/sound_gstreamer.py +=================================== +""" import gi gi.require_version('Gst', '1.0') from gi.repository import Gst # noqa: E402 @@ -9,6 +12,7 @@ def connect_plugin(sound_file): + """Entry point for sound file""" _player.set_state(Gst.State.NULL) _player.set_property("uri", "file://" + sound_file) _player.set_state(Gst.State.PLAYING) From 433cb9818b045843128a9be52f1bff2be6c06239 Mon Sep 17 00:00:00 2001 From: lakshyacis Date: Mon, 23 Sep 2019 16:09:35 +0530 Subject: [PATCH 8/8] sound_playfile pylint fixes --- src/plugins/sound_playfile.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plugins/sound_playfile.py b/src/plugins/sound_playfile.py index c8216d07d7..6396c3192a 100644 --- a/src/plugins/sound_playfile.py +++ b/src/plugins/sound_playfile.py @@ -1,10 +1,14 @@ # -*- coding: utf-8 -*- - +""" +src/plugins/sound_playfile.py +=================================== +""" try: import winsound def connect_plugin(sound_file): + """Plugin's entry point""" winsound.PlaySound(sound_file, winsound.SND_FILENAME) except ImportError: import os @@ -18,7 +22,8 @@ def _subprocess(*args): args, stdout=FNULL, stderr=subprocess.STDOUT, close_fds=True) def connect_plugin(sound_file): - global play_cmd + """This function implements the entry point.""" + global play_cmd # pylint: disable=global-statement ext = os.path.splitext(sound_file)[-1] try: