def _get_lib_by_name(self, name): if name in self.libraries: return self.libraries[name] matches = [lib for lib in self.libraries.values() if eq(lib.name, name)] if len(matches) == 1: return matches[0] self._no_library_found(name, multiple=bool(matches))
def _get_lib_by_name(self, name): if name in self.libraries: return self.libraries[name] matches = [ lib for lib in self.libraries.values() if eq(lib.name, name) ] if len(matches) == 1: return matches[0] self._no_library_found(name, multiple=bool(matches))
def _find_keywords(self, owner_name, name): return [owner.handlers.create_runner(name) for owner in chain(self.libraries.values(), self.resources.values()) if eq(owner.name, owner_name) and name in owner.handlers]
def _get_runner_based_on_search_order(self, runners): for libname in self.search_order: for runner in runners: if eq(libname, runner.libname): return [runner] return runners
def _find_keywords(self, owner_name, name): return [ owner.handlers[name] for owner in self.libraries.values() + self.resources.values() if eq(owner.name, owner_name) and name in owner.handlers ]
def _get_handler_based_on_search_order(self, handlers): for libname in self.search_order: for handler in handlers: if eq(libname, handler.libname): return [handler] return handlers
def _find_keywords(self, owner_name, name): return [ owner.handlers.create_runner(name) for owner in chain( self.libraries.values(), self.resources.values()) if eq(owner.name, owner_name) and name in owner.handlers ]
def _find_keywords(self, owner_name, name): return [owner.handlers[name] for owner in self.libraries.values() + self.resources.values() if eq(owner.name, owner_name) and name in owner.handlers]