Author: remi
Date: 2009-04-07 01:01:57 +0200 (Tue, 07 Apr 2009)
New Revision: 4374

Modified:
   
software_suite_v2/tuxware/pytuxisalive/branches/0.3.0/src/tuxisalive/api/attitunes/Attitune.py
Log:
* added a method to schedule the start command of an attitune

Modified: 
software_suite_v2/tuxware/pytuxisalive/branches/0.3.0/src/tuxisalive/api/attitunes/Attitune.py
===================================================================
--- 
software_suite_v2/tuxware/pytuxisalive/branches/0.3.0/src/tuxisalive/api/attitunes/Attitune.py
      2009-04-06 22:56:40 UTC (rev 4373)
+++ 
software_suite_v2/tuxware/pytuxisalive/branches/0.3.0/src/tuxisalive/api/attitunes/Attitune.py
      2009-04-06 23:01:57 UTC (rev 4374)
@@ -6,6 +6,7 @@
 import time
 
 from tuxisalive.api.base.ApiBaseChildResource import ApiBaseChildResource
+from tuxisalive.api.scheduler.Task import Task
 from tuxisalive.api.tuxdroid.const.ConstAttitunes import *
 from AttituneDescription import AttituneDescription
 
@@ -96,3 +97,33 @@
         """
         cmd = "attitune_manager/stop_attitune?"
         return self._sendCommandBooleanResult(cmd)
+        
+    # 
--------------------------------------------------------------------------
+    # Schedule the start command of this attitune.
+    # 
--------------------------------------------------------------------------
+    def scheduleStart(self, type = "ONCE DELAYED", name = None,
+        weekMask = [True, True, True, True, True, True, True], date = None,
+        time = "00:00:10"):
+        """Schedule the start command of this attitune.
+        @param type: <EVERY X|EVERY X FROM FULL HOUR|DAILY AT|ONCE AT|
+                      ONCE DELAYED>
+                     Default value is the "ONCE DELAYED".
+        @param name: Task name.
+                     Default value is attitune name.
+        @param weekMask: Week mask as list of 7 booleans.
+                    Default is [True, True, True, True, True, True, True]
+        @param date: Task date as string "YYYY/MM/DD".
+                    Default is None (no date defined)
+        @param time: Task time as string "HH:MM:SS".
+                    Default is "00:00:10".
+        @return: The success of the request.
+        """
+        if name == None:
+            name = self.getDescription().getName()
+        argsToSend = Task.formatRequestArguments(type, name, weekMask, date,
+            time)
+        if argsToSend == None:
+            return False
+        argsToSend['attitune_name'] = self.getDescription().getName()
+        cmd = "task_creation/play_attitune?"
+        return self._sendCommandBooleanResult(cmd, argsToSend)


------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to