From 15711760828ab1210d462027776be839d0cbdd77 Mon Sep 17 00:00:00 2001 From: coolguy-cell Date: Tue, 9 Jun 2020 16:19:54 +0530 Subject: [PATCH] fixed CQ for bitmessageqt.statusbar module --- src/bitmessageqt/statusbar.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/bitmessageqt/statusbar.py b/src/bitmessageqt/statusbar.py index 65a5acfb..2add604d 100644 --- a/src/bitmessageqt/statusbar.py +++ b/src/bitmessageqt/statusbar.py @@ -1,8 +1,12 @@ -from PyQt4 import QtCore, QtGui -from Queue import Queue +# pylint: disable=unused-argument +"""Status bar Module""" + from time import time +from PyQt4 import QtGui + class BMStatusBar(QtGui.QStatusBar): + """Status bar with queue and priorities""" duration = 10000 deleteAfter = 60 @@ -13,6 +17,9 @@ class BMStatusBar(QtGui.QStatusBar): self.iterator = 0 def timerEvent(self, event): + """an event handler which allows to queue and prioritise messages to + show in the status bar, for example if many messages come very quickly + after one another, it adds delays and so on""" while len(self.important) > 0: self.iterator += 1 try: @@ -30,9 +37,3 @@ class BMStatusBar(QtGui.QStatusBar): self.important.append([message, time()]) self.iterator = len(self.important) - 2 self.timerEvent(None) - - def showMessage(self, message, timeout=0): - super(BMStatusBar, self).showMessage(message, timeout) - - def clearMessage(self): - super(BMStatusBar, self).clearMessage()