def ComponentRegistrationAddSubscriber(componentRegistration, event): """Receive notification of add event.""" component = componentRegistration.component try: dependents = IDependable(component) except TypeError: return objectpath = zapi.getPath(componentRegistration) dependents.addDependent(objectpath)
def getBoundContact(context): person = IBasicPerson(removeSecurityProxy(context)) annotations = IAnnotations(person) contact = annotations.get(PERSON_CONTACT_KEY, None) if contact is None: contact = BoundContact() annotations[PERSON_CONTACT_KEY] = contact contact.__name__ = 'contact' contact.__parent__ = person dependable = IDependable(contact) dependable.addDependent("") notify(ObjectAddedEvent(contact, contact.__parent__, contact.__name__)) return contact