Package archipelagentiphonenotification :: Module notifications
[hide private]
[frames] | no frames]

Module notifications

source code

Client for the iPhone/iPod Touch `Notifications' app.

This module helps scripts to use the HTTP REST API of the `Notifications' application, which is available for the iPhone and the iPod Touch. It supports finding the user's credentials token, and then sending notification in a synchronous or asynchronous way. This modules provides three functions:

get_credentials() -- Get the user's credentials token send() -- Send a notification, waiting for it to be sent. send_async() -- Send a notification, returning immediately, without waiting for the message to be sent.


Version: 0.1

Author: Thomas Jost <thomas.jost@gmail.com>

Functions [hide private]
 
get_credentials(email, password)
Get the user's credentials token.
source code
 
send(credentials, message, title=None, long_message=None, subtitle=None, long_message_preview=None, message_level=0, silent=False, action_loc_key=None, run_command=None, sound=1, icon_url=None, debug=False)
Send a notification, waiting for the message to be sent.
source code
 
send_async(*args, **kwargs)
Send a notification, returning immediately, without waiting for the message to be sent.
source code
Variables [hide private]
  CREDENTIALS_URL = 'https://www.appnotifications.com/user_sessi...
  SEND_URL = 'https://www.appnotifications.com/account/notificat...
  __package__ = 'archipelagentiphonenotification'
Function Details [hide private]

send(credentials, message, title=None, long_message=None, subtitle=None, long_message_preview=None, message_level=0, silent=False, action_loc_key=None, run_command=None, sound=1, icon_url=None, debug=False)

source code 

Send a notification, waiting for the message to be sent.

The first two arguments (credentials and message) are mandatory, all of the others are optional. They are the same as the various identifiers described in the documentation of the Notifications HTTP REST API (http://appnotifications.com/account/rest_api).

When `debug` is set to `True`, the XML result of the HTTP request is displayed on `sys.stderr`.

This function returns a boolean indicating if the message was sent successfuly.

send_async(*args, **kwargs)

source code 

Send a notification, returning immediately, without waiting for the message to be sent.

This function does return the ID of the thread that does the HTTP request.


Variables Details [hide private]

CREDENTIALS_URL

Value:
'https://www.appnotifications.com/user_session.xml'

SEND_URL

Value:
'https://www.appnotifications.com/account/notifications.xml'