Beispiel #1
0
 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))
Beispiel #2
0
 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))
Beispiel #3
0
 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]
Beispiel #4
0
 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
Beispiel #5
0
 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
     ]
Beispiel #6
0
 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
Beispiel #7
0
 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
     ]
Beispiel #8
0
 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
Beispiel #9
0
 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]
Beispiel #10
0
 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