( self, name, default )
Get the <svg> attribute with name "name" and default value "default"
    Parse the attribute into a value and associated units.  Then, accept
    no units (''), units of pixels ('px'), and units of percentage ('%').
Get the <svg> attribute with name "name" and default value "default"
    Parse the attribute into a value and associated units.  Then, accept
    no units (''), units of pixels ('px'), and units of percentage ('%').
Get the <svg > attribute with name name and default value default Parse the attribute into a value and associated units . Then accept no units ( ) units of pixels ( px ) and units of percentage ( % ) .
def getLength( self, name, default ):
    '''
    Get the <svg> attribute with name "name" and default value "default"
    Parse the attribute into a value and associated units.  Then, accept
    no units (''), units of pixels ('px'), and units of percentage ('%').
    '''
    str = self.svg.get( name )
    if str:
      v, u = parseLengthWithUnits( str )
      if not v:
        # Couldn't parse the value
        return None
      elif ( u == '' ) or ( u == 'px' ):
        return v
      elif u == '%':
        return float( default ) * v / 100.0
      else:
        # Unsupported units
        return None
    else:
      # No width specified; assume the default value
      return float( default )
def getLength ( self , name , default ) : str = self . svg . get ( name ) if str : v , u = parseLengthWithUnits ( str ) if not v : # Couldn't parse the value return None elif ( u == '' ) or ( u == 'px' ) : return v elif u == '%' : return float ( default ) * v / 100.0 else : # Unsupported units return None else : # No width specified; assume the default value return float ( default )