From 58c09f73424ce76035a934a6c8a8ab429e051fec Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 10 Dec 2019 05:32:55 +0000 Subject: [PATCH] fix typos, type hinting and missed changes in ModuleManager --- src/ModuleManager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ModuleManager.py b/src/ModuleManager.py index c7b4549f..4625d27a 100644 --- a/src/ModuleManager.py +++ b/src/ModuleManager.py @@ -129,7 +129,7 @@ class ModuleManager(object): def list_modules(self, whitelist: typing.List[str], blacklist: typing.List[str]) -> typing.Dict[str, ModuleDefinition]: core_modules = self._list_modules(self._core_modules) - extra_modules = {} + extra_modules: typing.Dict[str, ModuleDefinition] = {} for directory in self._extra_modules: for name, module in self._list_modules(directory).items(): @@ -180,7 +180,7 @@ class ModuleManager(object): return os.path.basename(path).rsplit(".py", 1)[0].lower() def _module_paths(self, name: str) -> typing.List[str]: paths = [] - for directory in self.directories: + for directory in [self._core_modules]+self._extra_modules: paths.append(os.path.join(directory, name)) return paths def _import_name(self, name: str, context: str) -> str: @@ -289,7 +289,7 @@ class ModuleManager(object): self.log.debug("Module '%s' loaded", [loaded_module.name]) return loaded_module - def _dependency_sort(self, definitions: typing.Dict[str, ModuleDefinition] + def _dependency_sort(self, definitions: typing.List[ModuleDefinition] ) -> typing.List[ModuleDefinition]: definitions_ordered = []