def test_add_person(self): from npoapi.xml import mediaupdate program = mediaupdate.program(type="CLIP", avType="MIXED") program.title.append(mediaupdate.titleUpdateType("hoi ", type="MAIN")) program.broadcaster.append("VPRO") program.credits = pyxb.BIND() person = mediaupdate.personUpdateType(role=media.roleType.ACTOR, givenName="Pietje", familyName="Puk") program.credits.append(person) print(program.toxml())
def title(object: mediaupdate.mediaUpdateType, textualType, string: str): if string: title = mediaupdate.titleUpdateType(MediaBackendUtil.strip_tags(string)) if type(textualType) is str: title.type = getattr(media.textualTypeEnum, textualType) else: title.type = textualType object.title.append(title) return title else: MediaBackendUtil.logger.debug("Not appending title because it is empty") return None