mediahandler.util.notify

Module: mediahandler.util.notify

Module contains:

class mediahandler.util.notify.MHPush(settings, disable=False)

Bases: mediahandler.MHObject

An object which contains the all the logic for sending push notifications and raising errors produced by mediahandler.

Arguments:
  • settings

    Required. Dict or MHSettings object.

  • disable

    True/False.

Public methods:

class MHSettings(adict)

Bases: object

Object which serves as a simple structure for storing data as attributes.

MHPush.failure(error_details)

Builds and sends a failure notification.

Required argument:

  • error_details

    String. A message detailing the error that was reported during the add_media() sequence.

MHPush.send_message(conn_msg, msg_title=None)

Wrapper for sending push notifications via 3rd party services.

The function will exit if the disable flag is set.

MHPush.set_settings(adict)

Iteratively converts a dict into MHSettings objects and subsequently into object attributes.

MHPush.success(file_array, skipped=None)

Builds and sends a success notification.

Arguments:

  • file_array

    Required. An array of the files added via the mediahandler.handler.add_media() function.

  • skipped

    Defaults to None. An array of any files that were skipped during the add_media() sequence.