def load_subscriber(_context, subscriber): conf = subscriber['config'] conf['handler'] = resolve_or_get(conf.get('handler') or subscriber['klass']) _component_conf(conf) zcml.subscriber( _context, **conf )
def GenerateCollectionTraversal( ctx ): collection_names = [] for k,v in ctx.domain_model.__dict__.items(): if IManagedContainer.providedBy( v ): collection_names.append( k ) if not collection_names: return traverser = CollectionTraverser( *collection_names ) # register collection traversal subscription adapter subscriber( ctx.zcml, for_=(ctx.domain_interface, IPublisherRequest ), factory=traverser, provides=ITraverserPlugin ) adapter( ctx.zcml, for_ = ( ctx.domain_interface, IPublisherRequest ), factory = (PluggableTraverser,), provides = IPublishTraverse )
def _callFUT(self, *args, **kw): from zope.component.zcml import subscriber return subscriber(*args, **kw)
def load_subscriber(_context, subscriber): conf = subscriber['config'] conf['handler'] = resolve_or_get( conf.get('handler') or subscriber['klass']) _component_conf(conf) zcml.subscriber(_context, **conf)