Fix linter errors

This commit is contained in:
Christophe Bedard 2019-12-31 13:58:25 -05:00
parent 154ad1af7d
commit 96fac6b737
2 changed files with 8 additions and 7 deletions

View file

@ -425,11 +425,10 @@ class AutoProcessor():
:param kwargs: the kwargs to provide when instanciating EventHandler subclasses :param kwargs: the kwargs to provide when instanciating EventHandler subclasses
""" """
handlers = self.get_applicable_event_handlers(events) handlers = self.get_applicable_event_handlers(events)
processor = Processor( Processor(
*handlers, *handlers,
**kwargs, **kwargs,
) ).process(events)
processor.process(events)
@staticmethod @staticmethod
def get_applicable_event_handlers( def get_applicable_event_handlers(
@ -487,7 +486,7 @@ class AutoProcessor():
try: try:
instance = handler_class(**kwargs) instance = handler_class(**kwargs)
handlers.append(instance) handlers.append(instance)
except: except RuntimeError:
pass pass
return handlers return handlers
@ -497,7 +496,9 @@ class AutoProcessor():
) -> Set[Type]: ) -> Set[Type]:
"""Get all subclasses of a class recursively.""" """Get all subclasses of a class recursively."""
return set(cls.__subclasses__()) | { return set(cls.__subclasses__()) | {
subsubcls for subcls in cls.__subclasses__() for subsubcls in AutoProcessor._get_subclasses(subcls) subsubcls
for subcls in cls.__subclasses__()
for subsubcls in AutoProcessor._get_subclasses(subcls)
} }
@staticmethod @staticmethod
@ -511,7 +512,7 @@ class AutoProcessor():
full_name = package.__name__ + '.' + name full_name = package.__name__ + '.' + name
results[full_name] = importlib.import_module(full_name) results[full_name] = importlib.import_module(full_name)
if recursive and is_pkg: if recursive and is_pkg:
results.update(_import_event_handler_submodules(full_name)) results.update(AutoProcessor._import_event_handler_submodules(full_name))
return results return results

View file

@ -22,4 +22,4 @@ def main():
input_path = get_input_path() input_path = get_input_path()
events = load_file(input_path) events = load_file(input_path)
processor = AutoProcessor(events) AutoProcessor(events)