def do_contact_person_info(lava):
 cps = []
 if (lava is None):
  return cps
 contact_person = md.ContactPerson
 for ava in lava:
  cper = md.ContactPerson()
  for (key, classpec) in contact_person.c_children.values():
   try:
    value = ava[key]
    data = []
    if isinstance(classpec, list):
     if isinstance(value, basestring):
      data = [classpec[0](text=value)]
     else:
      for val in value:
       data.append(classpec[0](text=val))
    else:
     data = classpec(text=value)
    setattr(cper, key, data)
   except KeyError:
    pass
  for (prop, classpec, _) in contact_person.c_attributes.values():
   try:
    setattr(cper, prop, ava[prop])
   except KeyError:
    pass
  typ = getattr(cper, 'contact_type')
  if (not typ):
   setattr(cper, 'contact_type', 'technical')
  cps.append(cper)
 return cps

def do_contact_person_info ( lava ) : cps = [ ] if ( lava is None ) : return cps contact_person = md . ContactPerson for ava in lava : cper = md . ContactPerson ( ) for ( key , classpec ) in contact_person . c_children . values ( ) : try : value = ava [ key ] data = [ ] if isinstance ( classpec , list ) : if isinstance ( value , basestring ) : data = [ classpec [ 0 ] ( text = value ) ] else : for val in value : data . append ( classpec [ 0 ] ( text = val ) ) else : data = classpec ( text = value ) setattr ( cper , key , data ) except KeyError : pass for ( prop , classpec , _ ) in contact_person . c_attributes . values ( ) : try : setattr ( cper , prop , ava [ prop ] ) except KeyError : pass typ = getattr ( cper , 'contact_type' ) if ( not typ ) : setattr ( cper , 'contact_type' , 'technical' ) cps . append ( cper ) return cps
creates a contactperson instance from configuration information .