Use Python 3 style super()

which is simpler and less fragile.
This commit is contained in:
Florian Festi 2022-04-09 20:39:00 +02:00
parent 94935d96bd
commit 76384165cd
4 changed files with 11 additions and 11 deletions

View File

@ -781,7 +781,7 @@ class MoorBoxSideEdge(edges.BaseEdge):
""" """
def __init__(self, boxes, corner_length, corner_height, lower_corner): def __init__(self, boxes, corner_length, corner_height, lower_corner):
super(MoorBoxSideEdge, self).__init__(boxes, None) super().__init__(boxes, None)
self.corner_height = corner_height self.corner_height = corner_height
self.lower_corner = lower_corner self.lower_corner = lower_corner
self.corner_length = corner_length self.corner_length = corner_length
@ -812,7 +812,7 @@ class MoorBoxHoleEdge(edges.BaseEdge):
""" """
def __init__(self, boxes, height, corner_height, lower_corner): def __init__(self, boxes, height, corner_height, lower_corner):
super(MoorBoxHoleEdge, self).__init__(boxes, None) super().__init__(boxes, None)
self.height = height self.height = height
self.corner_height = corner_height self.corner_height = corner_height
self.lower_corner = lower_corner self.lower_corner = lower_corner
@ -864,7 +864,7 @@ class BedHeadEdge(edges.BaseEdge):
""" """
def __init__(self, boxes, hole_depth): def __init__(self, boxes, hole_depth):
super(BedHeadEdge, self).__init__(boxes, None) super().__init__(boxes, None)
self.hole_depth = hole_depth self.hole_depth = hole_depth
def __call__(self, length, **kw): def __call__(self, length, **kw):
@ -895,7 +895,7 @@ class Bed2SidesEdge(edges.BaseEdge):
""" """
def __init__(self, boxes, bed_length, full_head_length, full_foot_height): def __init__(self, boxes, bed_length, full_head_length, full_foot_height):
super(Bed2SidesEdge, self).__init__(boxes, None) super().__init__(boxes, None)
self.bed_length = bed_length self.bed_length = bed_length
self.full_head_length = full_head_length self.full_head_length = full_head_length
self.full_foot_height = full_foot_height self.full_foot_height = full_foot_height
@ -927,7 +927,7 @@ class NoopEdge(edges.BaseEdge):
""" """
def __init__(self, boxes): def __init__(self, boxes):
super(NoopEdge, self).__init__(boxes, None) super().__init__(boxes, None)
def __call__(self, length, **kw): def __call__(self, length, **kw):
# cancel turn # cancel turn

View File

@ -20,7 +20,7 @@ from boxes import *
class DinRailEdge(edges.FingerHoleEdge): class DinRailEdge(edges.FingerHoleEdge):
def __init__(self, boxes, settings, width=35.0, offset=0.0): def __init__(self, boxes, settings, width=35.0, offset=0.0):
super(DinRailEdge, self).__init__(boxes, settings) super().__init__(boxes, settings)
self.width = width self.width = width
self.offset = offset self.offset = offset

View File

@ -533,7 +533,7 @@ class DividerNotchesEdge(edges.BaseEdge):
def __init__(self, boxes, sx): def __init__(self, boxes, sx):
super(DividerNotchesEdge, self).__init__(boxes, None) super().__init__(boxes, None)
self.sx = sx self.sx = sx
@ -578,7 +578,7 @@ class DividerSlotsEdge(edges.BaseEdge):
def __init__(self, boxes, descriptions): def __init__(self, boxes, descriptions):
super(DividerSlotsEdge, self).__init__(boxes, None) super().__init__(boxes, None)
self.descriptions = descriptions self.descriptions = descriptions

View File

@ -214,7 +214,7 @@ class PhoneHolder(Boxes):
class BottomEdge(edges.BaseEdge): class BottomEdge(edges.BaseEdge):
def __init__(self, boxes, support_start_height, support_spacing): def __init__(self, boxes, support_start_height, support_spacing):
super(BottomEdge, self).__init__(boxes, None) super().__init__(boxes, None)
self.support_start_height = support_start_height self.support_start_height = support_start_height
self.support_spacing = support_spacing self.support_spacing = support_spacing
@ -242,7 +242,7 @@ class BottomEdge(edges.BaseEdge):
class SideEdge(edges.BaseEdge): class SideEdge(edges.BaseEdge):
def __init__(self, boxes, tab_start, tab_length, reverse=False): def __init__(self, boxes, tab_start, tab_length, reverse=False):
super(SideEdge, self).__init__(boxes, None) super().__init__(boxes, None)
self.tab_start = tab_start self.tab_start = tab_start
self.tab_length = tab_length self.tab_length = tab_length
self.reverse = reverse self.reverse = reverse
@ -271,7 +271,7 @@ class SideEdge(edges.BaseEdge):
class TabbedEdge(edges.BaseEdge): class TabbedEdge(edges.BaseEdge):
def __init__(self, boxes, tab_start, tab_length, tab_depth, reverse=False): def __init__(self, boxes, tab_start, tab_length, tab_depth, reverse=False):
super(TabbedEdge, self).__init__(boxes, None) super().__init__(boxes, None)
self.tab_start = tab_start self.tab_start = tab_start
self.tab_length = tab_length self.tab_length = tab_length
self.tab_depth = tab_depth self.tab_depth = tab_depth