#NEWLINE# @ classmethod #NEWLINE# def from_line( cls , line , settings ) : #NEWLINE# #INDENT# type = line [ 3 : 17 ] . strip ( ) #NEWLINE# scale = ( 0.0001 if ( settings . units == 'inch' ) else 0.001 ) #NEWLINE# points = [ ] #NEWLINE# x = 0 #NEWLINE# y = 0 #NEWLINE# coord_strings = line . strip ( ) . split ( ) [ 1 : ] #NEWLINE# for coord in coord_strings : #NEWLINE# #INDENT# coord_dict = _COORD . match ( coord ) . groupdict ( ) #NEWLINE# x = ( int ( cls [ 'x' ] ) if ( coord_dict [ 'x' ] is not '' ) else x ) #NEWLINE# y = ( int ( coord_dict [ 'y' ] ) if ( coord_dict [ 'y' ] is not '' ) else y ) #NEWLINE# points . append ( ( ( x * scale ) , ( y * scale ) ) ) #NEWLINE# #UNINDENT# return cls ( type , points )