From da8bbc2103ff03a6f62a82aa8c4341efcf357dfb Mon Sep 17 00:00:00 2001 From: coolguy-cell Date: Tue, 9 Jun 2020 15:14:41 +0530 Subject: [PATCH] fixed CQ for bitmessageqt.retranslateui module --- src/bitmessageqt/retranslateui.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/bitmessageqt/retranslateui.py b/src/bitmessageqt/retranslateui.py index e9d5bb3a..93a43834 100644 --- a/src/bitmessageqt/retranslateui.py +++ b/src/bitmessageqt/retranslateui.py @@ -1,9 +1,12 @@ -from os import path +"""RetranslateMixin module. +""" +# pylint: disable=too-few-public-methods from PyQt4 import QtGui -from debug import logger import widgets + class RetranslateMixin(object): + """RetranslateMixin class for dynamically change language during runtime.""" def retranslateUi(self): defaults = QtGui.QWidget() widgets.load(self.__class__.__name__.lower() + '.ui', defaults) @@ -12,7 +15,9 @@ class RetranslateMixin(object): if callable(setTextMethod): getattr(self, attr).setText(getattr(defaults, attr).text()) elif isinstance(value, QtGui.QTableWidget): - for i in range (value.columnCount()): - getattr(self, attr).horizontalHeaderItem(i).setText(getattr(defaults, attr).horizontalHeaderItem(i).text()) - for i in range (value.rowCount()): - getattr(self, attr).verticalHeaderItem(i).setText(getattr(defaults, attr).verticalHeaderItem(i).text()) + for i in range(value.columnCount()): + getattr(self, attr).horizontalHeaderItem(i).setText( + getattr(defaults, attr).horizontalHeaderItem(i).text()) + for i in range(value.rowCount()): + getattr(self, attr).verticalHeaderItem(i).setText( + getattr(defaults, attr).verticalHeaderItem(i).text())