From 07f88cd8e542ac7e0503ae23ae23341cf661bd8a Mon Sep 17 00:00:00 2001 From: Stefan Grosshauser Date: Thu, 18 Jan 2018 14:56:33 +0100 Subject: [PATCH] make __call__() abstract for BaseEdge; and inherit OutSetEdge from Edge --- boxes/edges.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/boxes/edges.py b/boxes/edges.py index d383408..6f7fe2b 100644 --- a/boxes/edges.py +++ b/boxes/edges.py @@ -19,6 +19,7 @@ import math import inspect import argparse import re +import abc from boxes import gears @@ -261,9 +262,9 @@ class BaseEdge(object): """Hack for using unalter code form Boxes class""" return getattr(self.boxes, name) + @abc.abstractmethod def __call__(self, length, **kw): - """Draw edge of length mm""" - self.edge(length, tabs=2) + pass def startwidth(self): """Amount of space the beginning of the edge is set below the inner space of the part """ @@ -294,8 +295,12 @@ class Edge(BaseEdge): char = 'e' description = "Straight Edge" + def __call__(self, length, bedBolts=None, bedBoltSettings=None, **kw): + """Draw edge of length mm""" + self.edge(length, tabs=2) -class OutSetEdge(BaseEdge): + +class OutSetEdge(Edge): """Straight edge out set by one thickness""" char = 'E' description = "Straight Edge (outset by thickness)"