def _key(cls, label, manager): try: # lazily load key key = cls.key if isinstance(key, strings): key = lazyimport(key) # register class key ez_register = manager.ez_register ez_register(ANamespace, label, key) exhaust(imap( lambda x: ez_register(KService, x, label), iter(key.names(True)), )) except AttributeError: key = manager.key(ANamespace, label)
def _events(self, *events): '''calls bound to `events`''' return chain(*tuple(imap(self._event, events)))