1
1
# -*- coding: utf-8 -*-
2
+ """
3
+ src/plugins/indicator_libmessaging.py
4
+ =====================================
5
+ """
6
+ from pybitmessage .bitmessageqt .utils import str_broadcast_subscribers
7
+ from pybitmessage .tr import _translate
2
8
3
9
import gi
4
- gi .require_version ('MessagingMenu' , '1.0' ) # noqa:E402
10
+ gi .require_version ('MessagingMenu' , '1.0' ) # .. noqa:E402
5
11
from gi .repository import MessagingMenu
6
12
7
- from pybitmessage .bitmessageqt .utils import str_broadcast_subscribers
8
- from pybitmessage .tr import _translate
9
-
10
13
11
14
class IndicatorLibmessaging (object ):
15
+ """Plugin for libmessage indicator"""
12
16
def __init__ (self , form ):
13
17
try :
14
18
self .app = MessagingMenu .App (desktop_id = 'pybitmessage.desktop' )
@@ -32,7 +36,8 @@ def __del__(self):
32
36
if self .app :
33
37
self .app .unregister ()
34
38
35
- def activate (self , app , source ):
39
+ def activate (self , app , source ): # pylint: disable=unused-argument
40
+ """Activate the libmessaging indicator plugin"""
36
41
self .form .appIndicatorInbox (
37
42
self .new_message_item if source == 'messages'
38
43
else self .new_broadcast_item
@@ -41,6 +46,10 @@ def activate(self, app, source):
41
46
# show the number of unread messages and subscriptions
42
47
# on the messaging menu
43
48
def show_unread (self , draw_attention = False ):
49
+ """
50
+ show the number of unread messages and subscriptions
51
+ on the messaging menu
52
+ """
44
53
for source , count in zip (
45
54
('messages' , 'subscriptions' ),
46
55
self .form .getUnread ()
0 commit comments