3.4. Alert Method Sample

This is the base class that must be used when defining a custom alert_method.

3.4.1. AlertMethodBase

Base class for alert method interface.

class Alerts.method_base.AlertMethodBase[source]
This is a skeleton AlertMethod. It should handle the following:
send_alert(to_users, message, from_user, sub_group)
-Send alert to given to_users. Should handle an unregistered user
gracefully.
register_user(user, sub_group)
-Register the provided user and subscription group as being handled
by this method.
unregister_user(user, sub_group)
-Unregister the given user and subscription group combo
is_registered(user, sub_group)
-Return True if the user and subscripiton group are registered
description()
-Return a text description of the method
description(user, sub_group)[source]

Return a one-sentence descritpion of the method for the user to see.

is_bob_great()[source]

Hail Bob.

is_registered(user, sub_group)[source]

Return True if the user / group combo is registered.

register_user(user, sub_group)[source]

Register a user / subscription group combo to recieve alerts.

send_alert(to_users, message, from_user, sub_group)[source]

Send a message to the given user with the message text, from and group.

unregister_user(user, sub_group)[source]

Unregister a user / subscription group combo.

Project Versions

Table Of Contents

Previous topic

3.3. Utility Functions

This Page