def layout(self): T = [] if self.part_labels: T.append(s2d.color(self.part_labels, (125, 200, 60))) if self.pin_labels: T.append(s2d.color(self.pin_labels, (255, 90, 60))) if self.traces: T.append(s2d.color(self.traces, (125, 90, 60))) return T
def shapes(self, labels=True): if labels: T = [] if self.pin_labels: T.append(s2d.color(self.pin_labels, (255, 0, 0))) if self.part_labels: T.append(s2d.color(self.part_labels, (20, 200, 20))) if self.traces: T.append(s2d.color(self.traces, (125, 90, 60))) return T else: return self.traces,
def shapes(self, value): if type(value) not in (list, tuple): raise TypeError( 'cad.shapes must be a list or tuple of MathTree objects') value = map(MathTree.wrap, value) self._shapes = list(value) self._shape = reduce(operator.add, [color(s, None) for s in self.shapes])
def function(self): if len(self.shapes) > 1: return reduce(operator.add, [color(s, None) for s in self.shapes]) elif self.shapes: return self.shapes[0] else: return None
def shapes(self, value): if type(value) not in (list, tuple): raise TypeError('cad.shapes must be a list or tuple of MathTree objects') value = map(MathTree.wrap, value) self._shapes = list(value) self._shape = reduce(operator.add, [color(s, None) for s in self.shapes] )