Commit 15e7387a308eb9ffb3a754c7f19f81eb707262db

Authored by Sergio Oliveira
1 parent 29117f5a

Fixed flake8 warnings/errors

colab/plugins/gitlab/signals.py
... ... @@ -2,15 +2,14 @@ from colab.plugins.utils.signals import AbstractSignal
2 2 from colab.plugins.gitlab.tasks import handling_method
3 3 from colab.signals.signals import register_signal, connect_signal
4 4  
  5 +
5 6 class GitlabSignals(AbstractSignal):
6 7  
7 8 short_name = 'gitlab'
8 9 signals_list = ['gitlab_create_project']
9 10  
10   -
11 11 def register_signal(self):
12 12 register_signal(self.short_name, self.signals_list)
13   -
14 13  
15 14 def connect_signal(self):
16 15 connect_signal(self.signals_list[0], self.short_name, handling_method)
... ...
colab/plugins/utils/apps.py
... ... @@ -13,7 +13,6 @@ class ColabProxiedAppConfig(AppConfig):
13 13 self._import_signals(app_name)
14 14 self.signals.register_signal()
15 15  
16   -
17 16 def _import_signals(self, app_name):
18 17 self.module_path = app_name + '.signals'
19 18 self.module = importlib.import_module(self.module_path)
... ... @@ -27,6 +26,5 @@ class ColabProxiedAppConfig(AppConfig):
27 26 self.signals = module_item()
28 27 break
29 28  
30   -
31 29 def ready(self):
32 30 self.signals.connect_signal()
... ...
colab/plugins/utils/signals.py
... ... @@ -2,7 +2,7 @@
2 2 from abc import abstractmethod
3 3  
4 4  
5   -class AbstractSignal(object)
  5 +class AbstractSignal(object):
6 6  
7 7 @abstractmethod
8 8 def register_signal(self):
... ...
colab/signals/signals.py
  1 +
1 2 from django.dispatch import Signal
2   -from colab.signals.celery import app
3 3  
4 4 from .exceptions import SignalDoesNotExist
5 5  
6   -
7 6 registered_signals = {}
8 7 signal_instances = {}
9 8  
... ... @@ -17,7 +16,7 @@ Signal.__reduce__ = reducer
17 16 def register_signal(plugin_name, list_signals):
18 17 for signal in list_signals:
19 18 if signal in registered_signals:
20   - if not plugin_name in registered_signals[signal]:
  19 + if plugin_name not in registered_signals[signal]:
21 20 registered_signals[signal].append(plugin_name)
22 21 else:
23 22 registered_signals[signal] = []
... ... @@ -28,7 +27,7 @@ def register_signal(plugin_name, list_signals):
28 27 def connect_signal(signal_name, sender, handling_method):
29 28 if signal_name in signal_instances:
30 29 signal_instances[signal_name].connect(handling_method.delay,
31   - sender=sender)
  30 + sender=sender)
32 31 else:
33 32 raise SignalDoesNotExist
34 33  
... ...