Lines Matching refs:registry

32   >>> registry = AdapterRegistry()
36 >>> registry.register([IR1], IP2, '', 12)
40 >>> registry.lookup([IR1], IP2, '')
55 >>> registry.lookup([IR2], IP2, '')
63 >>> registry.lookup([zope.interface.implementedBy(C2)], IP2, '')
69 >>> registry.lookup([IR1], IP1, '')
71 >>> registry.lookup([IR2], IP1, '')
77 >>> registry.lookup([zope.interface.Interface], IP1, '')
81 >>> registry.lookup([zope.interface.Interface], IP1, '', 42)
89 >>> registry.lookup([IR1], IP3, '')
93 >>> registry.lookup([IR1], IP1, 'bob')
94 >>> registry.register([IR1], IP2, 'bob', "Bob's 12")
95 >>> registry.lookup([IR1], IP1, 'bob')
100 >>> registry.lookup([IR1], IP1)
105 >>> registry.register([IR1], IP1, '', 11)
109 >>> registry.lookup([IR1], IP1, '')
115 >>> registry.register([IR2], IP1, '', 21)
116 >>> registry.lookup([IR2], IP1, '')
125 >>> print registry.registered([IR1], IP1)
128 >>> print registry.registered([IR1], IP2)
131 >>> print registry.registered([IR1], IP2, 'bob')
135 >>> print registry.registered([IR2], IP1)
138 >>> print registry.registered([IR2], IP2)
151 >>> registry.lookup1(IR2, IP1, '')
153 >>> registry.lookup1(IR2, IP1)
175 >>> registry.register([IR], IP1, '', Y)
181 >>> y = registry.queryAdapter(x, IP1)
192 >>> registry.register([IR], IP1, 'bob', Y2)
193 >>> y = registry.queryAdapter(x, IP1, 'bob')
213 >>> registry.register([IR], IP1, 'conditional', factory)
215 >>> registry.queryAdapter(obj, IP1, 'conditional')
218 >>> registry.queryAdapter(obj, IP1, 'conditional') is None
220 >>> registry.queryAdapter(obj, IP1, 'conditional', 'default')
226 >>> y = registry.adapter_hook(IP1, x)
231 >>> y = registry.adapter_hook(IP1, x, 'bob')
246 >>> registry.register([None], IP1, '', 1)
253 >>> registry.lookup([IQ], IP1, '')
258 >>> registry.lookup([IR2], IP1, '')
267 >>> registry.register([zope.interface.implementedBy(C2)], IP1, '', 'C21')
268 >>> registry.lookup([zope.interface.implementedBy(C2)], IP1, '')
278 >>> registry.register((), IQ, '', adapter)
279 >>> registry.lookup((), IQ, '') is adapter
287 >>> registry.register([zope.interface.implementedBy(C2)], IP1, '', None)
288 >>> registry.lookup([zope.interface.implementedBy(C2)], IP1, '')
299 >>> registry.register([IR1, IQ], IP2, '', '1q2')
300 >>> registry.lookup([IR1, IQ], IP2, '')
302 >>> registry.lookup([IR2, IQ], IP1, '')
307 >>> registry.lookup([IR2, IS], IP1, '')
312 >>> registry.lookup([IR2, IQ2], IP1, '')
315 >>> registry.register([IR1, IQ2], IP2, '', '1q22')
316 >>> registry.lookup([IR2, IQ2], IP1, '')
336 >>> registry.register([IR, IQ], IM, '', M)
341 >>> m = registry.queryMultiAdapter((x, q), IM)
351 >>> registry.register([IR, IQ], IM, 'bob', M2)
352 >>> m = registry.queryMultiAdapter((x, q), IM, 'bob')
364 >>> registry.register([None, IQ], IP2, '', 'q2')
365 >>> registry.lookup([IS, IQ], IP2, '')
373 >>> registry.register([], IP2, '', 2)
374 >>> registry.lookup([], IP2, '')
376 >>> registry.lookup([], IP1, '')
385 >>> adapters = list(registry.lookupAll([IR1], IP1))
391 >>> registry.register([IR1, IQ2], IP2, 'bob', '1q2 for bob')
392 >>> adapters = list(registry.lookupAll([IR2, IQ2], IP1))
398 >>> registry.register([], IP2, 'bob', 3)
399 >>> adapters = list(registry.lookupAll([], IP1))
411 >>> registry.subscribe([IR1], IP2, 'sub12 1')
412 >>> registry.subscriptions([IR1], IP2)
419 >>> registry.subscribe([IR1], IP2, 'sub12 2')
420 >>> registry.subscriptions([IR1], IP2)
428 >>> registry.subscribe([None], IP1, 'sub_1')
429 >>> registry.subscriptions([IR2], IP1)
438 >>> registry.subscriptions([IR2], IP1)
440 >>> registry.subscribe([IR1], IP1, 'sub11')
441 >>> registry.subscriptions([IR2], IP1)
443 >>> registry.subscribe([IR2], IP2, 'sub22')
444 >>> registry.subscriptions([IR2], IP1)
446 >>> registry.subscriptions([IR2], IP2)
451 >>> registry.subscribe([IR1, IQ], IP2, 'sub1q2')
452 >>> registry.subscriptions([IR1, IQ], IP2)
458 >>> registry.subscribe([None, IQ], IP2, 'sub_q2')
459 >>> registry.subscriptions([IS, IQ], IP2)
461 >>> registry.subscriptions([IR1, IQ], IP2)
466 >>> list(registry.subscriptions([], IP1))
469 >>> registry.subscribe([], IP2, 'sub2')
470 >>> registry.subscriptions([], IP1)
472 >>> registry.subscribe([], IP1, 'sub1')
473 >>> registry.subscriptions([], IP1)
475 >>> registry.subscriptions([], IP2)
484 >>> registry.unsubscribe([IR1], IP1, 'sub11')
485 >>> registry.subscriptions([IR1], IP1)
491 >>> registry.unsubscribe([IR1], IP2)
492 >>> registry.subscriptions([IR1], IP1)
502 >>> registry.subscribe([IR, IQ], IM, M)
503 >>> registry.subscribe([IR, IQ], IM, M2)
505 >>> subscribers = registry.subscribers((x, q), IM)
520 >>> registry.subscribe([IR, IQ], IM, M3)
521 >>> subscribers = registry.subscribers((x, q), IM)
538 >>> registry.subscribe([IR1], None, handler)
539 >>> registry.subscriptions([IR1], None) == [handler]