parameters: (self, id, d)
docstring: Breaks up the "d" attribute into individual commands
         and calls "process_svg_path_data_cmd" for each
docstring_summary: Breaks up the "d" attribute into individual commands
         and calls "process_svg_path_data_cmd" for each
docstring_tokens: Breaks up the d attribute into individual commands and calls process_svg_path_data_cmd for each
function: def process_svg_path_data(self, id, d):
      """Breaks up the "d" attribute into individual commands
         and calls "process_svg_path_data_cmd" for each"""
  
      self.d = d
      while (self.d):
        if self.eat_token('\s+'):
          pass # Just eat the spaces
  
        elif self.eat_token('([LMHVZlmhvz])'):
          cmd = self.m.group(1)
          # The following commands take no arguments
          if cmd == "Z" or cmd == "z":
            self.process_svg_path_data_cmd(id, cmd, 0, 0)
  
        elif self.eat_token('([CScsQqTtAa])'):
          print("Unsupported path data command:", self.m.group(1), "in path", id, "\n", file=sys.stderr)
          quit()
  
        elif self.eat_token('([ ,]*[-0-9e.]+)+'):
          # Process list of coordinates following command
          coords = re.split('[ ,]+', self.m.group(0))
          # The following commands take two arguments
          if cmd == "L" or cmd == "l":
            while coords:
              self.process_svg_path_data_cmd(id, cmd, float(coords.pop(0)), float(coords.pop(0)))
          elif cmd == "M":
            while coords:
              self.process_svg_path_data_cmd(id, cmd, float(coords.pop(0)), float(coords.pop(0)))
              # If a MOVETO has multiple points, the subsequent ones are assumed to be LINETO
              cmd = "L"
          elif cmd == "m":
            while coords:
              self.process_svg_path_data_cmd(id, cmd, float(coords.pop(0)), float(coords.pop(0)))
              # If a MOVETO has multiple points, the subsequent ones are assumed to be LINETO
              cmd = "l"
          # Assume all other commands are single argument
          else:
            while coords:
              self.process_svg_path_data_cmd(id, cmd, float(coords.pop(0)), 0)
        else:
          print("Syntax error:", d, "in path", id, "\n", file=sys.stderr)
          quit()
function_tokens: def process_svg_path_data ( self , id , d ) : self . d = d while ( self . d ) : if self . eat_token ( '\s+' ) : pass # Just eat the spaces elif self . eat_token ( '([LMHVZlmhvz])' ) : cmd = self . m . group ( 1 ) # The following commands take no arguments if cmd == "Z" or cmd == "z" : self . process_svg_path_data_cmd ( id , cmd , 0 , 0 ) elif self . eat_token ( '([CScsQqTtAa])' ) : print ( "Unsupported path data command:" , self . m . group ( 1 ) , "in path" , id , "\n" , file = sys . stderr ) quit ( ) elif self . eat_token ( '([ ,]*[-0-9e.]+)+' ) : # Process list of coordinates following command coords = re . split ( '[ ,]+' , self . m . group ( 0 ) ) # The following commands take two arguments if cmd == "L" or cmd == "l" : while coords : self . process_svg_path_data_cmd ( id , cmd , float ( coords . pop ( 0 ) ) , float ( coords . pop ( 0 ) ) ) elif cmd == "M" : while coords : self . process_svg_path_data_cmd ( id , cmd , float ( coords . pop ( 0 ) ) , float ( coords . pop ( 0 ) ) ) # If a MOVETO has multiple points, the subsequent ones are assumed to be LINETO cmd = "L" elif cmd == "m" : while coords : self . process_svg_path_data_cmd ( id , cmd , float ( coords . pop ( 0 ) ) , float ( coords . pop ( 0 ) ) ) # If a MOVETO has multiple points, the subsequent ones are assumed to be LINETO cmd = "l" # Assume all other commands are single argument else : while coords : self . process_svg_path_data_cmd ( id , cmd , float ( coords . pop ( 0 ) ) , 0 ) else : print ( "Syntax error:" , d , "in path" , id , "\n" , file = sys . stderr ) quit ( )