Add typing: magic methods

This commit is contained in:
Rotzbua 2023-01-08 19:41:02 +01:00 committed by Florian Festi
parent 755d8be998
commit 11340448fa
144 changed files with 191 additions and 191 deletions

View File

@ -119,7 +119,7 @@ class NutHole:
"M64": (95, 51),
}
def __init__(self, boxes, settings):
def __init__(self, boxes, settings) -> None:
self.boxes = boxes
self.ctx = boxes.ctx
self.settings = settings
@ -181,7 +181,7 @@ class ArgparseEdgeType:
names = edges.getDescriptions()
edges: List[str] = []
def __init__(self, edges: Optional[str] = None):
def __init__(self, edges: Optional[str] = None) -> None:
if edges:
self.edges = list(edges)
@ -284,7 +284,7 @@ class Boxes:
description = "" # Markdown syntax is supported
def __init__(self):
def __init__(self) -> None:
self.formats = formats.Formats()
self.ctx = None
description = self.__doc__

View File

@ -27,7 +27,7 @@ class Surface:
scale = 1.0
invert_y = False
def __init__(self, fname):
def __init__(self, fname) -> None:
self._fname = fname
self.parts = []
self._p = self.new_part("default")
@ -93,7 +93,7 @@ class Surface:
class Part:
def __init__(self, name):
def __init__(self, name) -> None:
self.pathes = []
self.path = []
@ -140,11 +140,11 @@ class Part:
class Path:
def __init__(self, path, params):
def __init__(self, path, params) -> None:
self.path = path
self.params = params
def __repr__(self):
def __repr__(self) -> str:
l = len(self.path)
# x1,y1 = self.path[0][1:3]
if l>0:
@ -211,7 +211,7 @@ class Path:
self.path = [p for n, p in enumerate(self.path) if p != self.path[n-1]]
class Context:
def __init__(self, surface, *al, **ad):
def __init__(self, surface, *al, **ad) -> None:
self._renderer = self._dwg = surface
self._bounds = Extents()

View File

@ -116,7 +116,7 @@ class BoltPolicy(object):
class Bolts(BoltPolicy):
"""Distribute a fixed number of bolts evenly"""
def __init__(self, bolts=1):
def __init__(self, bolts=1) -> None:
self.bolts = bolts
def numFingers(self, numFingers):
@ -211,7 +211,7 @@ class Settings(object):
choices=choices,
help=descriptions.get(name))
def __init__(self, thickness, relative=True, **kw):
def __init__(self, thickness, relative=True, **kw) -> None:
self.values = {}
for name, value in self.absolute_params.items():
if isinstance(value, tuple):
@ -294,7 +294,7 @@ class BaseEdge(object):
char: Optional[str] = None
description = "Abstract Edge Class"
def __init__(self, boxes, settings):
def __init__(self, boxes, settings) -> None:
self.boxes = boxes
self.ctx = boxes.ctx
self.settings = settings
@ -727,7 +727,7 @@ class CompoundEdge(BaseEdge):
"""Edge composed of multiple different Edges"""
description = "Compound Edge"
def __init__(self, boxes, types, lengths):
def __init__(self, boxes, types, lengths) -> None:
super(CompoundEdge, self).__init__(boxes, None)
self.types = [self.edges.get(edge, edge) for edge in types]
@ -763,7 +763,7 @@ class Slot(BaseEdge):
description = "Slot"
def __init__(self, boxes, depth):
def __init__(self, boxes, depth) -> None:
super(Slot, self).__init__(boxes, None)
self.depth = depth
@ -785,7 +785,7 @@ class SlottedEdge(BaseEdge):
"""Edge with multiple slots"""
description = "Straight Edge with slots"
def __init__(self, boxes, sections, edge="e", slots=0):
def __init__(self, boxes, sections, edge="e", slots=0) -> None:
super(SlottedEdge, self).__init__(boxes, Settings(boxes.thickness))
self.edge = self.edges.get(edge, edge)
@ -1019,7 +1019,7 @@ class FingerJointEdgeCounterPart(FingerJointEdge):
class FingerHoles(FingerJointBase):
"""Hole matching a finger joint edge"""
def __init__(self, boxes, settings):
def __init__(self, boxes, settings) -> None:
self.boxes = boxes
self.ctx = boxes.ctx
self.settings = settings
@ -1067,7 +1067,7 @@ class FingerHoleEdge(BaseEdge):
char = 'h'
description = "Edge (parallel Finger Joint Holes)"
def __init__(self, boxes, fingerHoles=None, **kw):
def __init__(self, boxes, fingerHoles=None, **kw) -> None:
settings = None
if isinstance(fingerHoles, Settings):
settings = fingerHoles
@ -1106,7 +1106,7 @@ class CrossingFingerHoleEdge(Edge):
description = "Edge (orthogonal Finger Joint Holes)"
char = '|'
def __init__(self, boxes, height, fingerHoles=None, **kw):
def __init__(self, boxes, height, fingerHoles=None, **kw) -> None:
super(CrossingFingerHoleEdge, self).__init__(boxes, None, **kw)
self.fingerHoles = fingerHoles or boxes.fingerHolesAt
@ -1173,7 +1173,7 @@ class StackableBaseEdge(BaseEdge):
description = "Abstract Stackable class"
bottom = True
def __init__(self, boxes, settings, fingerjointsettings):
def __init__(self, boxes, settings, fingerjointsettings) -> None:
super().__init__(boxes, settings)
self.fingerjointsettings = fingerjointsettings
@ -1311,7 +1311,7 @@ class Hinge(BaseEdge):
char = 'i'
description = "Straight edge with hinge eye"
def __init__(self, boxes, settings=None, layout=1):
def __init__(self, boxes, settings=None, layout=1) -> None:
super(Hinge, self).__init__(boxes, settings)
if not (0 < layout <= 3):
@ -1400,7 +1400,7 @@ class HingePin(BaseEdge):
char = 'I'
description = "Edge with hinge pin"
def __init__(self, boxes, settings=None, layout=1):
def __init__(self, boxes, settings=None, layout=1) -> None:
super(HingePin, self).__init__(boxes, settings)
if not (0 < layout <= 3):
@ -1576,7 +1576,7 @@ class ChestHinge(BaseEdge):
char = "o"
def __init__(self, boxes, settings=None, reversed=False):
def __init__(self, boxes, settings=None, reversed=False) -> None:
super(ChestHinge, self).__init__(boxes, settings)
self.reversed = reversed
@ -1632,7 +1632,7 @@ class ChestHingeTop(ChestHinge):
char = "p"
def __init__(self, boxes, settings=None, reversed=False):
def __init__(self, boxes, settings=None, reversed=False) -> None:
super(ChestHingeTop, self).__init__(boxes, settings)
self.reversed = reversed
@ -1764,7 +1764,7 @@ class CabinetHingeEdge(BaseEdge):
char = "u"
description = "Edge with cabinet hinges"
def __init__(self, boxes, settings=None, top=False, angled=False):
def __init__(self, boxes, settings=None, top=False, angled=False) -> None:
super(CabinetHingeEdge, self).__init__(boxes, settings)
self.top = top
self.angled = angled
@ -2433,7 +2433,7 @@ class RackEdge(BaseEdge):
description = "Rack (and pinion) Edge"
def __init__(self, boxes, settings):
def __init__(self, boxes, settings) -> None:
super(RackEdge, self).__init__(boxes, settings)
self.gear = gears.Gears(boxes)

View File

@ -1,7 +1,7 @@
class Extents:
__slots__ = "xmin ymin xmax ymax".split()
def __init__(self,xmin=float('inf'),ymin=float('inf'),xmax=float('-inf'),ymax=float('-inf')):
def __init__(self,xmin=float('inf'),ymin=float('inf'),xmax=float('-inf'),ymax=float('-inf')) -> None:
self.xmin = xmin
self.ymin = ymin
self.xmax = xmax
@ -40,5 +40,5 @@ class Extents:
width = property(get_width)
height = property(get_height)
def __repr__(self):
def __repr__(self) -> str:
return f'Extents ({self.xmin},{self.ymin})-({self.xmax},{self.ymax})'

View File

@ -53,7 +53,7 @@ class Formats:
# "" : [('Content-type', '')],
}
def __init__(self):
def __init__(self) -> None:
for cmd in self.pstoedit_candidates:
self.pstoedit = shutil.which(cmd)
if self.pstoedit:

View File

@ -258,7 +258,7 @@ class OptionParser(argparse.ArgumentParser):
class Gears():
def __init__(self, boxes, **kw):
def __init__(self, boxes, **kw) -> None:
# an alternate way to get debug info:
# could use inkex.debug(string) instead...
try:

View File

@ -8,7 +8,7 @@ ui_groups_by_name = {}
class UIGroup:
def __init__(self, name, title=None, description="", image=""):
def __init__(self, name, title=None, description="", image="") -> None:
self.name = name
self.title = title or name
self.description = description

View File

@ -21,7 +21,7 @@ class SlatwallXXX(Boxes): # Change class name!
ui_group = "SlatWall"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)

View File

@ -21,7 +21,7 @@ class BOX(Boxes): # Change class name!
ui_group = "Unstable" # see ./__init__.py for names
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
# Uncomment the settings for the edge types you use

View File

@ -23,7 +23,7 @@ class ABox(Boxes):
ui_group = "Box"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)
self.buildArgParser("x", "y", "h", "outside", "bottom_edge")

View File

@ -127,7 +127,7 @@ protruding underneath.
"""
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings, surroundingspaces=1.0)
@ -780,7 +780,7 @@ class MoorBoxSideEdge(edges.BaseEdge):
Edge for the sides of the moor tiles box
"""
def __init__(self, boxes, corner_length, corner_height, lower_corner):
def __init__(self, boxes, corner_length, corner_height, lower_corner) -> None:
super().__init__(boxes, None)
self.corner_height = corner_height
self.lower_corner = lower_corner
@ -811,7 +811,7 @@ class MoorBoxHoleEdge(edges.BaseEdge):
Edge which does the notches for the moor tiles box
"""
def __init__(self, boxes, height, corner_height, lower_corner):
def __init__(self, boxes, height, corner_height, lower_corner) -> None:
super().__init__(boxes, None)
self.height = height
self.corner_height = corner_height
@ -863,7 +863,7 @@ class BedHeadEdge(edges.BaseEdge):
Edge which does the head side of the Agricola player box
"""
def __init__(self, boxes, hole_depth):
def __init__(self, boxes, hole_depth) -> None:
super().__init__(boxes, None)
self.hole_depth = hole_depth
@ -894,7 +894,7 @@ class Bed2SidesEdge(edges.BaseEdge):
The next edge should be a NoopEdge
"""
def __init__(self, boxes, bed_length, full_head_length, full_foot_height):
def __init__(self, boxes, bed_length, full_head_length, full_foot_height) -> None:
super().__init__(boxes, None)
self.bed_length = bed_length
self.full_head_length = full_head_length
@ -926,7 +926,7 @@ class NoopEdge(edges.BaseEdge):
Edge which does nothing, not even turn or move.
"""
def __init__(self, boxes):
def __init__(self, boxes) -> None:
super().__init__(boxes, None)
def __call__(self, length, **kw):

View File

@ -21,7 +21,7 @@ class AllEdges(Boxes):
ui_group = "Misc"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)

View File

@ -22,7 +22,7 @@ class AngledBox(Boxes):
ui_group = "Box"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)
self.buildArgParser("x", "y", "h", "outside", "bottom_edge")

View File

@ -21,7 +21,7 @@ class AngledCutJig(Boxes): # Change class name!
ui_group = "Misc"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings, surroundingspaces=1.)

View File

@ -19,7 +19,7 @@ from boxes import *
class Arcade(Boxes):
"""Desktop Arcade Machine"""
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)
self.argparser.add_argument(

View File

@ -11,7 +11,7 @@ class Atreus21(Boxes, Keyboard):
half_btn = btn_size / 2
border = 6
def __init__(self):
def __init__(self) -> None:
super().__init__()
self.add_common_keyboard_parameters(
# By default, columns from Atreus 21

View File

@ -30,7 +30,7 @@ plate. The width of the "brim" can also be adjusted with the **edge_width**
See ClosedBox for variant without a base.
"""
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)
self.buildArgParser("x", "y", "h", "outside")

View File

@ -22,7 +22,7 @@ class BayonetBox(Boxes):
description = """Glue together - all outside rings to the bottom, all inside rings to the top."""
ui_group = "Box"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.argparser.add_argument(

View File

@ -48,7 +48,7 @@ class BinTray(Boxes):
ui_group = "Shelf"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.buildArgParser("sx", "sy", "h", "outside", "hole_dD")
self.addSettingsArgs(edges.FingerJointSettings, surroundingspaces=0.5)

View File

@ -21,7 +21,7 @@ class BirdHouse(Boxes):
ui_group = "Unstable" # "Misc"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings, finger=10.0,space=10.0)

View File

@ -26,7 +26,7 @@ Without the "double" option the stand is a bit more narrow.
ui_group = "Misc"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.argparser.add_argument(

View File

@ -22,7 +22,7 @@ class BottleTag(Boxes):
ui_group = "Misc" # see ./__init__.py for names
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.buildArgParser()

View File

@ -93,7 +93,7 @@ class BreadBox(Boxes):
self.polyline(0, 90, h, 90, l, 90, h, 90)
self.move(l, h, move)
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings, surroundingspaces=0.5)

View File

@ -34,7 +34,7 @@ See also LBeam that can serve as compact BurnTest and FlexTest for testing flex
ui_group = "Part"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)

View File

@ -89,7 +89,7 @@ for canned tomatoes:
ui_group = "Misc"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings, finger=2.0, space=2.0, surroundingspaces=0.0)

View File

@ -76,7 +76,7 @@ Details of the lid and rails
Whole box (early version still missing grip rail on the lid):
"""
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)
self.buildArgParser(h=30)

View File

@ -22,7 +22,7 @@ class CardHolder(Boxes):
ui_group = "Shelf"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.GroovedSettings)

View File

@ -24,7 +24,7 @@ class Castle(Boxes):
with towers and gates and walls that can be attached in multiple configurations."""
ui_group = "Unstable"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)

View File

@ -28,7 +28,7 @@ plate.
See BasedBox for variant with a base."""
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)
self.buildArgParser("x", "y", "h", "outside")

View File

@ -30,7 +30,7 @@ class CoffeeCapsuleHolder(Boxes):
You can store your coffee capsule near your espresso machine with this. It works both vertically, or upside down under a shelf.
"""
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.argparser.add_argument(
"--columns",

View File

@ -41,7 +41,7 @@ class CoinDisplay(Boxes):
ui_group = "Misc"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)

View File

@ -21,7 +21,7 @@ class ConcaveKnob(Boxes):
ui_group = "Part"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
# Add non default cli params if needed (see argparse std lib)

View File

@ -21,7 +21,7 @@ class Console(Boxes):
ui_group = "Box"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings, surroundingspaces=.5)

View File

@ -51,7 +51,7 @@ The latches at the back wall lock in place when closed. To open them they need t
To remove the panel you have to press in the four tabs at the side. It is easiest to push them in and then pull the panel up a little bit so the tabs stay in.
"""
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings, surroundingspaces=.5)

View File

@ -22,7 +22,7 @@ class DiceBox(Boxes):
ui_group = "Box"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(
edges.FingerJointSettings,

View File

@ -19,7 +19,7 @@ from boxes import *
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) -> None:
super().__init__(boxes, settings)
self.width = width
self.offset = offset
@ -62,7 +62,7 @@ class DinRailBox(Boxes):
self.move(tw, th, move)
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings, surroundingspaces=.8)

View File

@ -78,7 +78,7 @@ class DiscRack(Boxes):
ui_group = "Shelf"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.buildArgParser(sx="20*10")

View File

@ -41,7 +41,7 @@ Please add mounting holes yourself."""
ui_group = "Misc"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)

View File

@ -22,7 +22,7 @@ class Display(Boxes):
ui_group = "Misc"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.buildArgParser(x=150., h=200.0)

View File

@ -23,7 +23,7 @@ class DisplayCase(Boxes):
ui_group = "Box"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)
self.buildArgParser("x", "y", "h", "outside")

View File

@ -21,7 +21,7 @@ class DisplayShelf(Boxes): # change class name here and below
ui_group = "Shelf"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)

View File

@ -88,7 +88,7 @@ You will likely need to cut each of the dividers you want multiple times.
ui_group = "Tray"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)
self.addSettingsArgs(edges.HandleEdgeSettings)
@ -365,7 +365,7 @@ You will likely need to cut each of the dividers you want multiple times.
class SlottedEdgeDescriptions:
def __init__(self):
def __init__(self) -> None:
self.descriptions = []
def add(self, description):
@ -399,13 +399,13 @@ class StraightEdgeDescription:
round_edge_compensation=0,
outside_ratio=1,
angle_compensation=0,
):
) -> None:
self.asked_length = asked_length
self.round_edge_compensation = round_edge_compensation
self.outside_ratio = outside_ratio
self.angle_compensation = angle_compensation
def __repr__(self):
def __repr__(self) -> str:
return (
"StraightEdgeDescription({0}, round_edge_compensation={1}, angle_compensation={2}, outside_ratio={3})"
).format(
@ -433,7 +433,7 @@ class StraightEdgeDescription:
class Memoizer(dict):
def __init__(self, computation):
def __init__(self, computation) -> None:
self.computation = computation
def __missing__(self, key):
@ -447,14 +447,14 @@ class SlotDescription:
def __init__(
self, width, depth=20, angle=0, radius=0, start_radius=None, end_radius=None
):
) -> None:
self.depth = depth
self.width = width
self.start_radius = radius if start_radius is None else start_radius
self.end_radius = radius if end_radius is None else end_radius
self.angle = angle
def __repr__(self):
def __repr__(self) -> str:
return "SlotDescription({0}, depth={1}, angle={2}, start_radius={3}, end_radius={4})".format(
self.width, self.depth, self.angle, self.start_radius, self.end_radius
)
@ -573,7 +573,7 @@ class DividerNotchesEdge(edges.BaseEdge):
description = "Edge with multiple notches for easier access to dividers"
def __init__(self, boxes, sx):
def __init__(self, boxes, sx) -> None:
super().__init__(boxes, None)
@ -618,7 +618,7 @@ class DividerSlotsEdge(edges.BaseEdge):
description = "Edge with multiple angled rounded slots for dividers"
def __init__(self, boxes, descriptions):
def __init__(self, boxes, descriptions) -> None:
super().__init__(boxes, None)

View File

@ -24,7 +24,7 @@ class DoubleFlexDoorBox(boxes.Boxes):
ui_group = "FlexBox"
def __init__(self):
def __init__(self) -> None:
boxes.Boxes.__init__(self)
self.addSettingsArgs(boxes.edges.FingerJointSettings)
self.addSettingsArgs(boxes.edges.FlexSettings)

View File

@ -22,7 +22,7 @@ class DrillBox(_TopEdge):
ui_group = "Tray"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings,

View File

@ -38,7 +38,7 @@ Start with putting the slots of the inner walls together. Be especially careful
ui_group = "Misc"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.StackableSettings, height=1.0, width=3)

View File

@ -21,7 +21,7 @@ class Edges(Boxes):
webinterface = False
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
def render(self):

View File

@ -22,7 +22,7 @@ class ElectronicsBox(Boxes):
ui_group = "Box"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)
self.buildArgParser("x", "y", "h", "outside")

View File

@ -22,7 +22,7 @@ class EuroRackSkiff(Boxes):
ui_group = "Box"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)
self.buildArgParser("h")

View File

@ -21,7 +21,7 @@ class FanHole(Boxes):
ui_group = "Holes"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.argparser.add_argument(

View File

@ -24,7 +24,7 @@ class FillTest(Boxes): # Change class name!
ui_group = "Part"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(fillHolesSettings, fill_pattern="hex")

View File

@ -24,7 +24,7 @@ class FlexBox(boxes.Boxes):
ui_group = "FlexBox"
def __init__(self):
def __init__(self) -> None:
boxes.Boxes.__init__(self)
self.addSettingsArgs(boxes.edges.FingerJointSettings)
self.addSettingsArgs(boxes.edges.FlexSettings)

View File

@ -22,7 +22,7 @@ class FlexBox2(Boxes):
ui_group = "FlexBox"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)
self.addSettingsArgs(edges.FlexSettings)

View File

@ -22,7 +22,7 @@ class FlexBox3(Boxes):
ui_group = "FlexBox"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings, surroundingspaces=1)
self.addSettingsArgs(edges.FlexSettings)

View File

@ -22,7 +22,7 @@ class FlexBox4(Boxes):
ui_group = "FlexBox"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)
self.addSettingsArgs(edges.FlexSettings)

View File

@ -24,7 +24,7 @@ class FlexBox5(boxes.Boxes):
ui_group = "FlexBox"
def __init__(self):
def __init__(self) -> None:
boxes.Boxes.__init__(self)
self.addSettingsArgs(boxes.edges.FingerJointSettings)
self.addSettingsArgs(boxes.edges.FlexSettings)

View File

@ -22,7 +22,7 @@ class FlexTest(Boxes):
ui_group = "Part"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FlexSettings)
self.buildArgParser("x", "y")

View File

@ -22,7 +22,7 @@ class FlexTest2(Boxes):
ui_group = "Part"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.buildArgParser("x", "y")
self.argparser.add_argument(

View File

@ -20,7 +20,7 @@ from boxes import *
class Folder(Boxes):
"""Book cover with flex for the spine"""
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FlexSettings)
self.buildArgParser("x", "y", "h")

View File

@ -21,7 +21,7 @@ class Gears(Boxes):
ui_group = "Part"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.argparser.add_argument(
"--teeth1", action="store", type=int, default=12,

View File

@ -22,7 +22,7 @@ class GearBox(Boxes):
ui_group = "Part"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)
self.argparser.add_argument(

View File

@ -25,7 +25,7 @@ class GridfinityBase(Boxes):
ui_group = "Tray"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings, space=4, finger=4)
self.argparser.add_argument("--x", type=int, default=3, help="number of grids in X direction")

View File

@ -35,7 +35,7 @@ and many more...
"""
ui_group = "Box"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings, finger=2.0,space=2.0)

View File

@ -21,7 +21,7 @@ class HeartBox(Boxes):
ui_group = "FlexBox"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings, finger=1.0,space=1.0)

View File

@ -28,7 +28,7 @@ Then attach the hinges on the inside of the box and then connect them to lid.
"""
ui_group = "Box"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)
self.addSettingsArgs(edges.CabinetHingeSettings)

View File

@ -22,7 +22,7 @@ class HolePattern(Boxes):
ui_group = "Holes"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(fillHolesSettings, fill_pattern="hex")

View File

@ -22,7 +22,7 @@ class Hook(Boxes):
ui_group = "Misc" # see ./__init__.py for names
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings, surroundingspaces=0.5)

View File

@ -22,7 +22,7 @@ class IntegratedHingeBox(Boxes):
ui_group = "Box"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)
self.addSettingsArgs(edges.ChestHingeSettings)

View File

@ -22,7 +22,7 @@ class JigsawPuzzle(Boxes): # change class name here and below
webinterface = False # Change to make visible in web interface
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.count = 0
self.argparser.add_argument(

View File

@ -31,7 +31,7 @@ For plywood this method works well with a very stiff press fit. Aim for needing
ui_group = "Misc"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(

View File

@ -34,7 +34,7 @@ class Keyboard:
SWITCH_CASE_SIZE = 15.6
FRAME_CUTOUT = 14
def __init__(self):
def __init__(self) -> None:
pass
def add_common_keyboard_parameters(

View File

@ -18,7 +18,7 @@ class Keypad(Boxes, Keyboard):
box_padding = 10
triangle = 25.0
def __init__(self):
def __init__(self) -> None:
super().__init__()
self.argparser.add_argument(
'--h', action='store', type=int, default=30,

View File

@ -60,7 +60,7 @@ class RoundedTriangle(edges.Edge):
class Lamp(Boxes):
webinterface = False
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)
self.buildArgParser(x=220, y=75, h=70)

View File

@ -24,7 +24,7 @@ class LaptopStand(Boxes): # Change class name!
ui_group = "Misc" # see ./__init__.py for names
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.argparser.add_argument(

View File

@ -27,7 +27,7 @@ parts sliding on each other to reduce friction.
ui_group = "Misc"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings, surroundingspaces=0)

View File

@ -21,7 +21,7 @@ class LaserHoldfast(Boxes):
ui_group = "Part"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.buildArgParser(x=25, h=40)

View File

@ -21,7 +21,7 @@ class LBeam(Boxes):
ui_group = "Part"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.buildArgParser("x", "y", "h", "outside")
self.addSettingsArgs(edges.FingerJointSettings)

View File

@ -20,7 +20,7 @@ from boxes.lids import _TopEdge
class MagazineFile(Boxes):
"""Open magazine file"""
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.buildArgParser(x=100, y=200, h=300, hi=0, outside=False)
self.addSettingsArgs(edges.FingerJointSettings)

View File

@ -27,7 +27,7 @@ To allow powering by laptop power supply: flip switch, Lenovo round socket (or a
ui_group = "Misc"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)

View File

@ -23,7 +23,7 @@ class SBCMicroRack(Boxes):
webinterface = True
ui_group = "Shelf" # see ./__init__.py for names
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)

View File

@ -21,7 +21,7 @@ class NemaMount(Boxes):
ui_group = "Part"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)
self.argparser.add_argument(

View File

@ -21,7 +21,7 @@ class NemaPattern(Boxes):
ui_group = "Holes"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)
self.argparser.add_argument(

View File

@ -57,7 +57,7 @@ class NotesHolder(Boxes):
ui_group = "Box"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings, surroundingspaces=1)
self.addSettingsArgs(edges.StackableSettings)

View File

@ -21,7 +21,7 @@ class OpenBox(Boxes):
ui_group = "Box"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.buildArgParser("x", "y", "h", "outside")
self.argparser.add_argument(

View File

@ -45,7 +45,7 @@ class OrganPipe(Boxes): # Change class name!
def getAirSpeed(self, wind_pressure, air_density=1.2):
return (2.0 * (wind_pressure / air_density))**.5
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings, finger=3.0, space=3.0,

View File

@ -28,7 +28,7 @@ class OttoBody(Boxes):
ui_group = "Misc"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)
self.addSettingsArgs(edges.ChestHingeSettings)

View File

@ -29,7 +29,7 @@ class OttoLegs(Boxes):
ui_group = "Misc"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings, finger=1.0, space=1.0,

View File

@ -21,7 +21,7 @@ class OttoSoles(Boxes):
ui_group = "Misc"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.buildArgParser(x=58., y=38.)

View File

@ -23,7 +23,7 @@ class PaintStorage(Boxes):
webinterface = True
ui_group = "Shelf" # see ./__init__.py for names
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)

View File

@ -35,7 +35,7 @@ There is marks in the "outside leftover paper" to help see where to fold
A paper creaser (or bone folder) is also useful.
"""
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.buildArgParser("x", "y", "h")

View File

@ -35,7 +35,7 @@ class PhoneHolder(Boxes):
Default values are currently based on Galaxy S7.
"""
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.argparser.add_argument(
"--phone_height",
@ -213,7 +213,7 @@ class PhoneHolder(Boxes):
class BottomEdge(edges.BaseEdge):
def __init__(self, boxes, support_start_height, support_spacing):
def __init__(self, boxes, support_start_height, support_spacing) -> None:
super().__init__(boxes, None)
self.support_start_height = support_start_height
self.support_spacing = support_spacing
@ -241,7 +241,7 @@ class BottomEdge(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) -> None:
super().__init__(boxes, None)
self.tab_start = tab_start
self.tab_length = tab_length
@ -270,7 +270,7 @@ class SideEdge(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) -> None:
super().__init__(boxes, None)
self.tab_start = tab_start
self.tab_length = tab_length

View File

@ -22,7 +22,7 @@ class Planetary(Boxes):
ui_group = "Part"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.argparser.add_argument(
"--sunteeth", action="store", type=int, default=8,

View File

@ -24,7 +24,7 @@ class Planetary2(Boxes):
description = """Still has issues. The middle planetary gears set must not have a mashing sun gear as it can't be a proper gear set."""
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.buildArgParser("nema_mount")
self.argparser.add_argument(

View File

@ -97,7 +97,7 @@ class Platonic(Boxes):
"icosahedro": (20, 3),
}
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings, surroundingspaces=0)

View File

@ -19,7 +19,7 @@ from boxes import *
class PoleHook(Boxes): # change class name here and below
"""Hook for pole like things to be clamped to another pole"""
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
# Uncomment the settings for the edge types you use

View File

@ -23,7 +23,7 @@ class Pulley(Boxes):
ui_group = "Part"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
# remove cli params you do not need
self.buildArgParser(h=6.)

View File

@ -22,7 +22,7 @@ class Rack19Box(Boxes):
ui_group = "Box"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings, surroundingspaces=0.5)
self.argparser.add_argument(

View File

@ -8,7 +8,7 @@ class Rack19HalfWidth(Boxes):
ui_group = "Box"
def __init__(self):
def __init__(self) -> None:
super().__init__()
self.argparser.add_argument(
'--ru_count', action='store', type=float, default=1,

View File

@ -22,7 +22,7 @@ class RackBox(Boxes):
ui_group = "Box"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings, surroundingspaces=1.2)
self.buildArgParser("x", "y", "h", "outside")

View File

@ -21,7 +21,7 @@ class RectangularWall(Boxes):
ui_group = "Part" # see ./__init__.py for names
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.CabinetHingeSettings)

View File

@ -28,7 +28,7 @@ The lids needs to be glued. For the bayonet lid all outside rings attach to the
ui_group = "Box"
def __init__(self):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings, surroundingspaces=1)
self.buildArgParser("h", "outside")

Some files were not shown because too many files have changed in this diff Show More