childcount.commands

Please see with ChildCount+ for information on what forms and commands are.

childcount.commands.CCCommand

Module defining ChildCount+ command object.

class childcount.commands.CCCommand.CCCommand(message, params)[source]

CCCommand is the abstract base class used to define new SMS commands.

Command definitions should inherit from CCCommand, should define KEYWORDS and should implement the self.process method.

Load command data.

Parameters:
  • message (rapidsms.Message) – The SMS object that called this command
  • params (list) – A list of “arguments” to this command (like sys.argv)
KEYWORDS

A dictionary of two-character language codes to a list of keyword names for this command. For example the command “FAMILY” might have a KEYWORDS that looks like:

KEYWORDS = {
    'en': ['family', 'fam'],
    'fr': ['famille', 'fam'],
}
message

The rapidsms.Message object that is being processed by this command.

params

A list of parameters to this command – like the sys.argv for a python script.

process()[source]

Run the command.

You should override this method in your command definition.

Returns:True if command is successful (otherwise raises an exception)

Pre-Defined Commands

There are a variety of commands already defined in apps/childcount/commands. Consult them before writing a new command.

Table Of Contents

Previous topic

childcount

Next topic

childcount.dashboard_sections

This Page