Package comodit_client :: Package api :: Module application :: Class Handler

Class Handler


An application handler. A handler defines actions to execute when one of its associated triggers is "pulled". A trigger is generally the key of a setting. When the value of a setting changes and its key is in the list of triggers associated to a handler, then this handler's actions are executed. There are also 2 reserved triggers: _install and _uninstall which are respectively pulled when installing and uninstalling the application associated to this handler.


See Also: Application

Instance Methods
 
add_action(self, action)
Adds an action to this handler's list.
 
add_trigger(self, trigger)
Adds a triggers to this handler's list.
 
show(self, indent=0)
Prints this handler's state to standard output in a user-friendly way.

Inherited from util.json_wrapper.JsonWrapper: __init__, dump_json, get_json, get_real_json, load_json, print_json, set_json

Inherited from object: __long__, __native__, __nonzero__, __unicode__, next

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties
list of Action actions
The actions associated to this handler.
list of string triggers
The triggers associated to this handler.

Inherited from object: __class__

Method Details

add_action(self, action)

 

Adds an action to this handler's list.

Parameters:

add_trigger(self, trigger)

 

Adds a triggers to this handler's list.

Parameters:
  • trigger (string) - A trigger

show(self, indent=0)

 

Prints this handler's state to standard output in a user-friendly way.

Parameters:
  • indent (int) - The number of spaces to put in front of each displayed line.

Property Details

actions

The actions associated to this handler.

Get Method:
unreachable.actions(self) - The actions associated to this handler.
Set Method:
unreachable.actions(self, actions) - Sets the actions associated to this handler.
Type:
list of Action

triggers

The triggers associated to this handler.

Get Method:
unreachable.triggers(self) - The triggers associated to this handler.
Set Method:
unreachable.triggers(self, triggers) - Sets the triggers associated to this handler.
Type:
list of string