| | |
- Alarm
class Alarm |
| |
An object for managing a session-based alarm. At most one alarm per instance can be set at a time; when a new alarm is set, any old one is cancelled. The benefit/drawback of using a session-based alarm is that when the session is closed, any associated alarm is automatically removed. Use an instance of this class to have an alarm deleted when the instance is deleted, or when the owning thread dies. |
| |
Methods defined here:
- __init__(self)
- set_alarm(self, callback, datetime, message, no_alert=0)
- Sets a session alarm. Any existing session alarm managed by this object is removed.
callback:: Of type callable. A callable to call when the alarm expires, or when the alarm request is otherwise completed. An error code is passed to the callback as the sole argument.
datetime:: Of type float. Alarm time.
message:: Of type unicode. Alarm message. Shows in any system alert dialog.
no_alert:: Of type int. Defaults to value 0. A true value indicates that there should be no system alert upon alarm expiration.
- unset_alarm(self)
- Removes any outstanding session alarm that has been set via this object.
| |