def get_contacts(self, doc, tag): path = "./%s/emailAddress" % tag for address in doc.findall(path): name = address.get("OPFContactEmailAddressName") email = address.get("OPFContactEmailAddressAddress") yield EmailIdentity(self.manager, name, email)
def get_identity(self, name, email): return EmailIdentity(self.manager, name, email)
def address_entity(self, address): email = str(address).strip() if email.lower().startswith("mailto:"): email = address[len("mailto:"):] identity = EmailIdentity(self.manager, None, email) return identity.entity