linetypes.py

changeset 4
8eb83f200486
parent 3
1dc58f44d556
child 7
0ab0d61ccee8
--- a/linetypes.py	Mon Dec 11 00:46:35 2017 +0200
+++ b/linetypes.py	Tue Dec 12 11:50:18 2017 +0200
@@ -34,19 +34,19 @@
             return '0 // ' + self.text
 
 class SubfileReference:
-    def __init__(self, *, color, subfile_path, anchor, matrix):
-        self.color, self.subfile_path, = color, subfile_path
+    def __init__(self, *, colour, subfile_path, anchor, matrix):
+        self.colour, self.subfile_path, = colour, subfile_path
         self.anchor, self.matrix = anchor, matrix
     def __repr__(self):
         return str.format('linetypes.SubfileReference(' \
-            'color = {color!r}, ' \
+            'colour = {colour!r}, ' \
             'subfile_path = {subfile_path!r}, ' \
             'anchor = {anchor!r}, ' \
             'matrix = {matrix!r})', **self.__dict__)
     def textual_representation(self):
         args = [
             1,
-            self.color,
+            self.colour,
             *self.anchor.coordinates,
             *self.matrix.values,
             self.subfile_path,
@@ -54,18 +54,18 @@
         return ' '.join(ldraw_str(arg) for arg in args)
 
 class BasePolygon:
-    def __init__(self, *, color, geometry):
-        self.color, self.geometry = color, geometry
+    def __init__(self, *, colour, geometry):
+        self.colour, self.geometry = colour, geometry
     def __repr__(self):
         return str.format('linetypes.{typename}(' \
-            'color = {color!r}, ' \
+            'colour = {colour!r}, ' \
             'geometry = {geometry!r})',
             typename = type(self).__name__,
-            color = self.color,
+            colour = self.colour,
             geometry = self.geometry,
         )
     def base_textual_representation(self):
-        args = [self.color]
+        args = [self.colour]
         for vertex in self.geometry.vertices:
             args += vertex.coordinates
         return ' '.join(ldraw_str(arg) for arg in args)
@@ -83,13 +83,13 @@
         return '4 ' + self.base_textual_representation()
 
 class Contour(LineSegment):
-    def __init__(self, *, color, geometry, control_points):
-        super().__init__(color = color, geometry = geometry)
+    def __init__(self, *, colour, geometry, control_points):
+        super().__init__(colour = colour, geometry = geometry)
         self.control_points = control_points
         assert(len(self.control_points) == 2)
     def __repr__(self):
         return str.format('linetypes.Contour(' \
-            'color = {color!r}, ' \
+            'colour = {colour!r}, ' \
             'geometry = {geometry!r}, ' \
             'control_points = {control_points!r})', **self.__dict__)
     def textual_representation(self):

mercurial