Commit 74ecd45c authored by Wolfgang Rohdewald's avatar Wolfgang Rohdewald
Browse files

pylint: use super()

parent 15a4c29b
......@@ -286,7 +286,7 @@ class AnimatedMixin:
"""for UITile and PlayerWind"""
def __init__(self):
super(AnimatedMixin, self).__init__()
super().__init__()
self.activeAnimation = dict() # key is the property name
self.queuedAnimations = []
......
......@@ -27,7 +27,7 @@ class Background(Resource):
def __init__(self, name):
"""continue __build"""
super(Background, self).__init__(name)
super().__init__(name)
self.__svg = None
self.__pmap = None
self.graphicsPath = None
......
......@@ -19,7 +19,7 @@ class BackgroundSelector(QWidget):
"""presents all available backgrounds with previews"""
def __init__(self, parent):
super(BackgroundSelector, self).__init__(parent)
super().__init__(parent)
loadUi(self)
self.kcfg_backgroundName = QLineEdit(self)
self.kcfg_backgroundName.setVisible(False)
......
......@@ -39,7 +39,7 @@ class PlayerWind(AnimatedMixin, QGraphicsObject, StrMixin):
def __init__(self, wind, parent=None):
"""generate new wind marker"""
super(PlayerWind, self).__init__()
super().__init__()
assert not parent
assert isinstance(wind, Wind), 'wind {} must be a real Wind but is {}'.format(
wind, type(wind))
......
......@@ -23,7 +23,7 @@ class ChatModel(QAbstractTableModel):
"""a model for the chat view"""
def __init__(self, parent=None):
super(ChatModel, self).__init__(parent)
super().__init__(parent)
self.chatLines = []
def headerData(self, section, orientation, role=Qt.DisplayRole): # pylint: disable=no-self-use
......@@ -112,7 +112,7 @@ class ChatWindow(QWidget):
"""a widget for showing chat messages"""
def __init__(self, scene=None, table=None):
super(ChatWindow, self).__init__(None)
super().__init__(None)
self.scene = scene
self.table = table or scene.game.client.table
self.table.chatWindow = self
......
......@@ -30,7 +30,7 @@ class PlayConfigTab(QWidget):
"""Display Config tab"""
def __init__(self, parent):
super(PlayConfigTab, self).__init__(parent)
super().__init__(parent)
self.setupUi()
def setupUi(self):
......
......@@ -23,7 +23,7 @@ class DifferModel(QAbstractTableModel):
"""a model for our ruleset differ"""
def __init__(self, diffs, view):
super(DifferModel, self).__init__()
super().__init__()
self.diffs = diffs
self.view = view
......
......@@ -96,7 +96,7 @@ class Games(QDialog):
"""a dialog for selecting a game"""
def __init__(self, parent=None):
super(Games, self).__init__(parent)
super().__init__(parent)
self.selectedGame = None
self.onlyPending = True
decorateWindow(self, i18nc("@title:window", "Games"))
......
......@@ -23,7 +23,7 @@ class ZeroEmptyColumnDelegate(QStyledItemDelegate):
return ''
if isinstance(value, float) and value == 0.0:
return ''
return super(ZeroEmptyColumnDelegate, self).displayText(value, locale)
return super().displayText(value, locale)
class RichTextColumnDelegate(QStyledItemDelegate):
......@@ -32,7 +32,7 @@ class RichTextColumnDelegate(QStyledItemDelegate):
document = None
def __init__(self, parent=None):
super(RichTextColumnDelegate, self).__init__(parent)
super().__init__(parent)
if self.label is None:
self.label = QLabel()
self.label.setIndent(5)
......@@ -68,7 +68,7 @@ class RightAlignedCheckboxDelegate(QStyledItemDelegate):
https://wiki.qt.io/Technical_FAQ#How_can_I_align_the_checkboxes_in_a_view.3F"""
def __init__(self, parent, cellFilter):
super(RightAlignedCheckboxDelegate, self).__init__(parent)
super().__init__(parent)
self.cellFilter = cellFilter
@staticmethod
......
......@@ -792,7 +792,7 @@ class KSwitchLanguageDialog(KDialog):
"""select application language"""
def __init__(self, parent):
super(KSwitchLanguageDialog, self).__init__(parent)
super().__init__(parent)
self.languageRows = dict()
self.languageButtons = list()
self.setCaption(i18n('Switch Application Language'))
......@@ -864,7 +864,7 @@ class KSwitchLanguageDialog(KDialog):
"""OK"""
newValue = ':'.join(x.current for x in self.languageButtons)
Internal.kajonggrc.setValue('Locale', 'Language', newValue)
super(KSwitchLanguageDialog, self).accept()
super().accept()
def slotAddLanguageButton(self):
"""adding a new button with en_US as it should always be present"""
......@@ -899,7 +899,7 @@ class KLanguageButton(QWidget):
"""A language button for KSwitchLanguageDialog"""
def __init__(self, txt, parent=None):
super(KLanguageButton, self).__init__(parent)
super().__init__(parent)
self.button = QPushButton(txt)
self.popup = QMenu()
self.button.setMenu(self.popup)
......
......@@ -126,7 +126,7 @@ class MainWindow(KXmlGuiWindow):
def __init__(self):
# see https://marc.info/?l=kde-games-devel&m=120071267328984&w=2
super(MainWindow, self).__init__()
super().__init__()
Internal.app.aboutToQuit.connect(self.aboutToQuit)
self.exitConfirmed = None
self.exitReady = None
......
......@@ -136,7 +136,7 @@ class RuleModel(TreeModel):
"""a model for our rule table"""
def __init__(self, rulesets, title, parent=None):
super(RuleModel, self).__init__(parent)
super().__init__(parent)
self.rulesets = rulesets
self.loaded = False
unitNames = list()
......@@ -470,7 +470,7 @@ class RulesetSelector(QWidget):
"""presents all available rulesets with previews"""
def __init__(self, parent=None):
super(RulesetSelector, self).__init__(parent)
super().__init__(parent)
self.setContentsMargins(0, 0, 0, 0)
self.setupUi()
......
......@@ -136,7 +136,7 @@ class GameScene(SceneWithFocusRect):
Internal.scene = self
self.mainWindow = parent
self._game = None
super(GameScene, self).__init__()
super().__init__()
self.scoreTable = None
self.explainView = None
......@@ -289,7 +289,7 @@ class PlayingScene(GameScene):
self.__startingGame = True
self._clientDialog = None
super(PlayingScene, self).__init__(parent)
super().__init__(parent)
@GameScene.game.setter
def game(self, value): # pylint: disable=arguments-differ
......@@ -454,7 +454,7 @@ class ScoringScene(GameScene):
def __init__(self, parent=None):
self.scoringDialog = None
super(ScoringScene, self).__init__(parent)
super().__init__(parent)
self.selectorBoard.hasFocus = True
@GameScene.game.setter
......
......@@ -165,7 +165,7 @@ class ScoreModel(TreeModel):
steps = 30 # how fine do we want the stepping in the chart spline
def __init__(self, parent=None):
super(ScoreModel, self).__init__(parent)
super().__init__(parent)
self.scoreTable = parent
self.rootItem = ScoreRootItem(None)
self.minY = self.maxY = None
......@@ -401,7 +401,7 @@ class ScoreTable(QWidget):
finished. To achieve this we keep our own reference to game."""
def __init__(self, scene):
super(ScoreTable, self).__init__(None)
super().__init__(None)
self.setObjectName('ScoreTable')
self.scene = scene
self.scoreModel = None
......
......@@ -34,7 +34,7 @@ class TablesModel(QAbstractTableModel):
"""a model for our tables"""
def __init__(self, tables, parent=None):
super(TablesModel, self).__init__(parent)
super().__init__(parent)
self.tables = tables
assert isinstance(tables, list)
......@@ -164,7 +164,7 @@ class TableList(QWidget):
# pylint: disable=too-many-instance-attributes
def __init__(self, client):
super(TableList, self).__init__(None)
super().__init__(None)
self.autoStarted = False
self.client = client
self.setObjectName('TableList')
......
......@@ -31,7 +31,7 @@ class Tileset(Resource):
def __init__(self, name):
"""continue __build"""
super(Tileset, self).__init__(name)
super().__init__(name)
self.tileSize = None
self.faceSize = None
self.__renderer = None
......
......@@ -24,7 +24,7 @@ class TilesetSelector(QWidget):
"""presents all available tiles with previews"""
def __init__(self, parent):
super(TilesetSelector, self).__init__(parent)
super().__init__(parent)
loadUi(self)
self.kcfg_tilesetName = QLineEdit(self)
......
......@@ -33,7 +33,7 @@ class UITile(AnimatedMixin, QGraphicsObject, StrMixin):
clsUid = 0
def __init__(self, tile, xoffset=0.0, yoffset=0.0, level=0):
super(UITile, self).__init__()
super().__init__()
if not isinstance(tile, Tile):
tile = Tile(tile)
UITile.clsUid += 1
......
......@@ -33,7 +33,7 @@ class SideText(AnimatedMixin, QGraphicsObject, StrMixin):
assert len(self.sideTexts) < 4
self.__name = 't%d' % len(self.sideTexts)
self.sideTexts.append(self)
super(SideText, self).__init__()
super().__init__()
self.hide()
Internal.scene.addItem(self)
self.__text = ''
......
......@@ -85,7 +85,7 @@ class VisiblePlayingPlayer(VisiblePlayer, PlayingPlayer):
def clearHand(self):
"""clears attributes related to current hand"""
super(VisiblePlayingPlayer, self).clearHand()
super().clearHand()
if self.game and self.game.wall:
# is None while __del__
self.front = self.game.wall[self.idx]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment