1313
1414class  EnumValue (Enum ):
1515    """Helper class to represent enumeration like values""" 
16+ 
1617    def  get_name (self ) ->  str :
1718        raise  NotImplementedError ('Override get_name in subclass' )
1819
1920    def  __str__ (self ) ->  str :
2021        return  '({} {})' .format (self .get_name (), self .value )
2122
2223
23- class  DateValue () :
24+ class  DateValue :
2425    """Helper class to represent a single named date value""" 
26+ 
2527    def  __init__ (self , name : str , date : str ):
2628        self .name  =  name 
2729        self .date  =  date 
@@ -30,8 +32,9 @@ def __str__(self) -> str:
3032        return  '({} {})' .format (self .name , self .date )
3133
3234
33- class  UUIDValue () :
35+ class  UUIDValue :
3436    """Helper class to represent a single named UUID value""" 
37+ 
3538    def  __init__ (self , name : str , uuid : str ):
3639        self .name  =  name 
3740        self .uuid  =  uuid 
@@ -40,8 +43,9 @@ def __str__(self) -> str:
4043        return  '({} {})' .format (self .name , self .uuid )
4144
4245
43- class  BoolValue () :
46+ class  BoolValue :
4447    """Helper class to represent a single named boolean value""" 
48+ 
4549    def  __init__ (self , name : str , value : bool ):
4650        self .name  =  name 
4751        self .value  =  str (value ).lower ()
@@ -50,8 +54,9 @@ def __str__(self) -> str:
5054        return  '({} {})' .format (self .name , self .value )
5155
5256
53- class  StringValue () :
57+ class  StringValue :
5458    """Helper class to represent a single named string value""" 
59+ 
5560    def  __init__ (self , name : str , value : str ):
5661        self .name  =  name 
5762        self .value  =  value 
@@ -60,8 +65,9 @@ def __str__(self) -> str:
6065        return  '({} "{}")' .format (self .name , escape_string (self .value ))
6166
6267
63- class  FloatValue () :
68+ class  FloatValue :
6469    """Helper class to represent a single named float value""" 
70+ 
6571    def  __init__ (self , name : str , value : float ):
6672        self .name  =  name 
6773        self .value  =  value 
@@ -115,7 +121,7 @@ def __init__(self, category: str):
115121        super ().__init__ ('category' , category )
116122
117123
118- class  Position () :
124+ class  Position :
119125    def  __init__ (self , x : float , y : float ):
120126        self .x  =  x 
121127        self .y  =  y 
@@ -124,7 +130,7 @@ def __str__(self) -> str:
124130        return  '(position {} {})' .format (format_float (self .x ), format_float (self .y ))
125131
126132
127- class  Position3D () :
133+ class  Position3D :
128134    def  __init__ (self , x : float , y : float , z : float ):
129135        self .x  =  x 
130136        self .y  =  y 
@@ -143,7 +149,7 @@ def __init__(self, rotation: float):
143149        super ().__init__ ('rotation' , rotation )
144150
145151
146- class  Rotation3D () :
152+ class  Rotation3D :
147153    def  __init__ (self , x : float , y : float , z : float ):
148154        self .x  =  x 
149155        self .y  =  y 
@@ -187,7 +193,7 @@ def __init__(self, grab_area: bool):
187193        super ().__init__ ('grab_area' , grab_area )
188194
189195
190- class  Vertex () :
196+ class  Vertex :
191197    def  __init__ (self , position : Position , angle : Angle ):
192198        self .position  =  position 
193199        self .angle  =  angle 
@@ -196,17 +202,24 @@ def __str__(self) -> str:
196202        return  '(vertex {} {})' .format (self .position , self .angle )
197203
198204
199- class  Layer () :
205+ class  Layer :
200206    def  __init__ (self , layer : str ):
201207        self .layer  =  layer 
202208
203209    def  __str__ (self ) ->  str :
204210        return  '(layer {})' .format (self .layer )
205211
206212
207- class  Polygon ():
208-     def  __init__ (self , uuid : str , layer : Layer , width : Width , fill : Fill ,
209-                  grab_area : GrabArea , vertices : Optional [List [Vertex ]] =  None ):
213+ class  Polygon :
214+     def  __init__ (
215+         self ,
216+         uuid : str ,
217+         layer : Layer ,
218+         width : Width ,
219+         fill : Fill ,
220+         grab_area : GrabArea ,
221+         vertices : Optional [List [Vertex ]] =  None ,
222+     ):
210223        self .uuid  =  uuid 
211224        self .layer  =  layer 
212225        self .width  =  width 
@@ -218,8 +231,9 @@ def add_vertex(self, vertex: Vertex) -> None:
218231        self .vertices .append (vertex )
219232
220233    def  __str__ (self ) ->  str :
221-         ret  =  '(polygon {} {}\n ' .format (self .uuid , self .layer ) + \
222-             ' {} {} {}\n ' .format (self .width , self .fill , self .grab_area )
234+         ret  =  '(polygon {} {}\n ' .format (self .uuid , self .layer ) +  ' {} {} {}\n ' .format (
235+             self .width , self .fill , self .grab_area 
236+         )
223237        ret  +=  indent_entities (self .vertices )
224238        ret  +=  ')' 
225239        return  ret 
@@ -270,9 +284,17 @@ def __init__(self, diameter: float):
270284        super ().__init__ ('diameter' , diameter )
271285
272286
273- class  Circle ():
274-     def  __init__ (self , uuid : str , layer : Layer , width : Width , fill : Fill ,
275-                  grab_area : GrabArea , diameter : Diameter , position : Position ):
287+ class  Circle :
288+     def  __init__ (
289+         self ,
290+         uuid : str ,
291+         layer : Layer ,
292+         width : Width ,
293+         fill : Fill ,
294+         grab_area : GrabArea ,
295+         diameter : Diameter ,
296+         position : Position ,
297+     ):
276298        self .uuid  =  uuid 
277299        self .layer  =  layer 
278300        self .width  =  width 
@@ -283,8 +305,7 @@ def __init__(self, uuid: str, layer: Layer, width: Width, fill: Fill,
283305
284306    def  __str__ (self ) ->  str :
285307        ret  =  '(circle {} {}\n ' .format (self .uuid , self .layer )
286-         ret  +=  ' {} {} {} {} {}\n ' .format (self .width , self .fill , self .grab_area ,
287-                                           self .diameter , self .position )
308+         ret  +=  ' {} {} {} {} {}\n ' .format (self .width , self .fill , self .grab_area , self .diameter , self .position )
288309        ret  +=  ')' 
289310        return  ret 
290311
@@ -294,16 +315,25 @@ def __init__(self, value: str):
294315        super ().__init__ ('value' , value )
295316
296317
297- class  Align () :
318+ class  Align :
298319    def  __init__ (self , align : str ):
299320        self .align  =  align 
300321
301322    def  __str__ (self ) ->  str :
302323        return  '(align {})' .format (self .align )
303324
304325
305- class  Text ():
306-     def  __init__ (self , uuid : str , layer : Layer , value : Value , align : Align , height : Height , position : Position , rotation : Rotation ):
326+ class  Text :
327+     def  __init__ (
328+         self ,
329+         uuid : str ,
330+         layer : Layer ,
331+         value : Value ,
332+         align : Align ,
333+         height : Height ,
334+         position : Position ,
335+         rotation : Rotation ,
336+     ):
307337        self .uuid  =  uuid 
308338        self .layer  =  layer 
309339        self .value  =  value 
@@ -313,6 +343,8 @@ def __init__(self, uuid: str, layer: Layer, value: Value, align: Align, height:
313343        self .rotation  =  rotation 
314344
315345    def  __str__ (self ) ->  str :
316-         return  '(text {} {} {}\n ' .format (self .uuid , self .layer , self .value ) + \
317-                ' {} {} {} {}\n ' .format (self .align , self .height , self .position , self .rotation ) + \
318-                ')' 
346+         return  (
347+             '(text {} {} {}\n ' .format (self .uuid , self .layer , self .value )
348+             +  ' {} {} {} {}\n ' .format (self .align , self .height , self .position , self .rotation )
349+             +  ')' 
350+         )
0 commit comments