Author: remi
Date: 2009-04-06 18:05:08 +0200 (Mon, 06 Apr 2009)
New Revision: 4359

Modified:
   
software_suite_v2/tuxware/tuxdroidserver/trunk/resources/01_robot_system/resourceScheduler.py
Log:
* fixed a bug in the weekMask string parsing
* added a service to get the informations about the tasks

Modified: 
software_suite_v2/tuxware/tuxdroidserver/trunk/resources/01_robot_system/resourceScheduler.py
===================================================================
--- 
software_suite_v2/tuxware/tuxdroidserver/trunk/resources/01_robot_system/resourceScheduler.py
       2009-04-06 16:03:48 UTC (rev 4358)
+++ 
software_suite_v2/tuxware/tuxdroidserver/trunk/resources/01_robot_system/resourceScheduler.py
       2009-04-06 16:05:08 UTC (rev 4359)
@@ -85,9 +85,6 @@
 
     def weekMaskStringToList(self, weekMaskString):
         result = [True, True, True, True, True, True, True]
-        if weekMaskString <= 2:
-            return result
-        weekMaskString = weekMaskString[1:-1]
         try:
             splitedStr = weekMaskString.split(",")
             if len(splitedStr) == 7:
@@ -252,6 +249,32 @@
 resourcesManager.addResource(resourceScheduler)
 
 # 
------------------------------------------------------------------------------
+# Declaration of the service "tasks_infos".
+# 
------------------------------------------------------------------------------
+class TDSServiceSchedulerTasksInfos(TDSService):
+
+    def configure(self):
+        self.parametersDict = {}
+        self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
+        self.exclusiveExecution = False
+        self.name = "tasks_infos"
+        self.comment = "Get the informations about the tasks."
+
+    def execute(self, id, parameters):
+        headersStruct = self.getDefaultHeadersStruct()
+        contentStruct = self.getDefaultContentStruct()
+        contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
+        tasks = resourceScheduler.getScheduler().getTasks()
+        for i, task in enumerate(tasks):
+            d_name = "data|%d" % i
+            struct = task.getDictionary()
+            contentStruct['root'][d_name] = struct
+        return headersStruct, contentStruct
+
+# Register the service into the resource
+resourceScheduler.addService(TDSServiceSchedulerTasksInfos)
+
+# 
------------------------------------------------------------------------------
 # Declaration of the service "clear".
 # 
------------------------------------------------------------------------------
 class TDSServiceSchedulerClear(TDSService):


------------------------------------------------------------------------------
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to