[tuxdroid-svn] r4558 - in softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api: . tuxd
Status: Beta
Brought to you by:
ks156
|
From: remi <c2m...@c2...> - 2009-04-18 12:24:16
|
Author: remi
Date: 2009-04-18 14:24:11 +0200 (Sat, 18 Apr 2009)
New Revision: 4558
Modified:
softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/TuxAPI.py
softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/tuxdroid/AttituneManager.py
softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/tuxdroid/Framework.py
softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/tuxdroid/Scheduler.py
Log:
* added methods to wait that the containers has been loaded
Modified: softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/TuxAPI.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/TuxAPI.py 2009-04-18 12:23:40 UTC (rev 4557)
+++ softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/TuxAPI.py 2009-04-18 12:24:11 UTC (rev 4558)
@@ -120,6 +120,16 @@
# Scheduler bindings
self.showTasks = self.scheduler.getTasksContainer().showTasks
self.getTask = self.scheduler.getTasksContainer().getTask
+ # User method bind
+ def userWaitLoaded():
+ ret = self.framework.waitLoaded(5.0, 0.0)
+ if not ret:
+ return False
+ ret = self.attitunes.waitLoaded(5.0, 0.0)
+ if not ret:
+ return False
+ return self.scheduler.waitLoaded(5.0, 1.0)
+ self.user.waitLoaded = userWaitLoaded
# --------------------------------------------------------------------------
# Get the version of this API.
Modified: softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/tuxdroid/AttituneManager.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/tuxdroid/AttituneManager.py 2009-04-18 12:23:40 UTC (rev 4557)
+++ softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/tuxdroid/AttituneManager.py 2009-04-18 12:24:11 UTC (rev 4558)
@@ -63,3 +63,16 @@
ret, result = self._sendCommandFullResultEx(cmd)
if ret:
self.__attitunesContainer._update(result)
+
+ # --------------------------------------------------------------------------
+ # Wait that the attitunes was loaded.
+ # --------------------------------------------------------------------------
+ def waitLoaded(self, timeout = 10.0, absDelay = 1.0):
+ """Wait that the attitunes was loaded.
+ @param timeout: Maximal time to wait.
+ @return: True or False.
+ """
+ ret = self._waitFor(ST_NAME_AM_CONTAINER_DEPLOYED, "True", timeout)
+ if ret:
+ time.sleep(absDelay)
+ return ret
Modified: softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/tuxdroid/Framework.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/tuxdroid/Framework.py 2009-04-18 12:23:40 UTC (rev 4557)
+++ softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/tuxdroid/Framework.py 2009-04-18 12:24:11 UTC (rev 4558)
@@ -75,3 +75,16 @@
result[key]['description']['help_file'])
gadgetsStruct[key] = result[key]
self.__gadgetsContainer._update(gadgetsStruct)
+
+ # --------------------------------------------------------------------------
+ # Wait that the gadgets was loaded.
+ # --------------------------------------------------------------------------
+ def waitLoaded(self, timeout = 10.0, absDelay = 1.0):
+ """Wait that the gadgets was loaded.
+ @param timeout: Maximal time to wait.
+ @return: True or False.
+ """
+ ret = self._waitFor(ST_NAME_FW_CONFIGURATIONS_LOADED, "True", timeout)
+ if ret:
+ time.sleep(absDelay)
+ return ret
Modified: softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/tuxdroid/Scheduler.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/tuxdroid/Scheduler.py 2009-04-18 12:23:40 UTC (rev 4557)
+++ softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/tuxdroid/Scheduler.py 2009-04-18 12:24:11 UTC (rev 4558)
@@ -3,11 +3,12 @@
# Distributed under the terms of the GNU General Public License
# http://www.gnu.org/copyleft/gpl.html
+import time
+
from const.ConstScheduler import *
from tuxisalive.api.scheduler.TasksContainer import TasksContainer
from tuxisalive.api.base.ApiBaseChildResource import ApiBaseChildResource
-
# ------------------------------------------------------------------------------
# Class to control the scheduler.
# ------------------------------------------------------------------------------
@@ -62,3 +63,16 @@
ret, result = self._sendCommandFullResultEx(cmd)
if ret:
self.__tasksContainer._update(result)
+
+ # --------------------------------------------------------------------------
+ # Wait that the tasks was loaded.
+ # --------------------------------------------------------------------------
+ def waitLoaded(self, timeout = 10.0, absDelay = 1.0):
+ """Wait that the tasks was loaded.
+ @param timeout: Maximal time to wait.
+ @return: True or False.
+ """
+ ret = self._waitFor(ST_NAME_SCM_TASKS_LOADED, "True", timeout)
+ if ret:
+ time.sleep(absDelay)
+ return ret
|