View Single Post
Posts: 74 | Thanked: 34 times | Joined on Jan 2008
#6
#!/usr/bin/env python
#simple example to issue a command using python and maemo alarmed RTC tool
# look at /var/cache/alarmd/alarm_queue.ini for the full queue
import time,alarm

if __name__ == '__main__':
event = alarm.Event()
event.appid = 'lovelyName'
event.alarm_time = time.time() +10
action = event.add_actions(1)[0]
action.flags |= alarm.ACTION_WHEN_TRIGGERED | alarm.ACTION_TYPE_EXEC
action.command = 'touch /tmp/alarm.txt'
cookie = alarm.add_event(event)
print cookie

Last edited by niv; 2011-04-28 at 14:45.
 

The Following 2 Users Say Thank You to niv For This Useful Post: