make __call__() abstract for BaseEdge; and inherit OutSetEdge from Edge

This commit is contained in:
Stefan Grosshauser 2018-01-18 14:56:33 +01:00
parent e725bf2dc4
commit 07f88cd8e5
1 changed files with 8 additions and 3 deletions

View File

@ -19,6 +19,7 @@ import math
import inspect import inspect
import argparse import argparse
import re import re
import abc
from boxes import gears from boxes import gears
@ -261,9 +262,9 @@ class BaseEdge(object):
"""Hack for using unalter code form Boxes class""" """Hack for using unalter code form Boxes class"""
return getattr(self.boxes, name) return getattr(self.boxes, name)
@abc.abstractmethod
def __call__(self, length, **kw): def __call__(self, length, **kw):
"""Draw edge of length mm""" pass
self.edge(length, tabs=2)
def startwidth(self): def startwidth(self):
"""Amount of space the beginning of the edge is set below the inner space of the part """ """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' char = 'e'
description = "Straight Edge" 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""" """Straight edge out set by one thickness"""
char = 'E' char = 'E'
description = "Straight Edge (outset by thickness)" description = "Straight Edge (outset by thickness)"