Add .create() method to help refactor our tests
@@ -25,9 +25,9 @@ class FormSenderBase(forms.Form):
class NotificationBase(object):
- '''
+ """
Base Notification class
- '''
+ """
form = FormSenderBase
@@ -41,27 +41,31 @@ class NotificationBase(object):
return textwrap.dedent(cls.__doc__)
def _send(self, target, alert):
- '''
+ """
Sender specific implmentation
This function will receive some kind of target value, such as an email
address or post endpoint and an individual alert combined with some
additional alert meta data
- '''
+ """
raise NotImplementedError()
def config(self, key):
- '''
+ """
Plugin specific configuration
This wraps our PROMGEN settings so that a plugin author does not need to
be concerned with how the configuration files are handled but only about
the specific key.
- '''
+ """
try:
return util.setting(key, domain=self.__module__)
except KeyError:
- logger.error('Undefined setting. Please check for %s under %s in settings.yml', key, self.__module__)
+ logger.error(
+ "Undefined setting. Please check for %s under %s in settings.yml",
+ key,
+ self.__module__,
+ )
def render(self, template, context):
s = render_to_string(template, context).strip()
