(spec, parent, attributes=None)
Helper function to generate the right kind of Element given a spec.
Helper function to generate the right kind of Element given a spec.
Helper function to generate the right kind of Element given a spec .
def _make_element(spec, parent, attributes=None):
  """Helper function to generate the right kind of Element given a spec."""
  if (spec.name == constants.WORLDBODY
      or (spec.name == constants.SITE
          and (parent.tag == constants.BODY
               or parent.tag == constants.WORLDBODY))):
    return _AttachableElement(spec, parent, attributes)
  elif isinstance(parent, _AttachmentFrame):
    return _AttachmentFrameChild(spec, parent, attributes)
  elif spec.name == constants.DEFAULT:
    return _DefaultElement(spec, parent, attributes)
  elif spec.name == constants.ACTUATOR:
    return _ActuatorElement(spec, parent, attributes)
  else:
    return _ElementImpl(spec, parent, attributes)
def _make_element ( spec , parent , attributes = None ) : if ( spec . name == constants . WORLDBODY or ( spec . name == constants . SITE and ( parent . tag == constants . BODY or parent . tag == constants . WORLDBODY ) ) ) : return _AttachableElement ( spec , parent , attributes ) elif isinstance ( parent , _AttachmentFrame ) : return _AttachmentFrameChild ( spec , parent , attributes ) elif spec . name == constants . DEFAULT : return _DefaultElement ( spec , parent , attributes ) elif spec . name == constants . ACTUATOR : return _ActuatorElement ( spec , parent , attributes ) else : return _ElementImpl ( spec , parent , attributes )