Author: remi
Date: 2009-03-14 18:22:22 +0100 (Sat, 14 Mar 2009)
New Revision: 4078

Modified:
   
software_suite_v2/tuxware/pytuxisalive/branches/0.3.0/src/tuxisalive/api/gadgets/Gadget.py
Log:
* added a synchronous and an asynchronous gadget start.

Modified: 
software_suite_v2/tuxware/pytuxisalive/branches/0.3.0/src/tuxisalive/api/gadgets/Gadget.py
===================================================================
--- 
software_suite_v2/tuxware/pytuxisalive/branches/0.3.0/src/tuxisalive/api/gadgets/Gadget.py
  2009-03-14 17:20:55 UTC (rev 4077)
+++ 
software_suite_v2/tuxware/pytuxisalive/branches/0.3.0/src/tuxisalive/api/gadgets/Gadget.py
  2009-03-14 17:22:22 UTC (rev 4078)
@@ -4,6 +4,7 @@
 #    http://www.gnu.org/copyleft/gpl.html
 
 from tuxisalive.api.base.ApiBaseChildResource import ApiBaseChildResource
+from tuxisalive.api.tuxdroid.const.ConstFramework import *
 from GadgetDescription import GadgetDescription
 from GadgetParameter import GadgetParameter
 from GadgetToken import GadgetToken
@@ -149,7 +150,7 @@
     # 
--------------------------------------------------------------------------
     # Start this gadget.
     # 
--------------------------------------------------------------------------
-    def start(self, command = None, parameters = {}):
+    def startAsync(self, command = None, parameters = {}):
         """Start this gadget.
         @param command: Command name to start the gadget.
             if command is None, the first command is set.
@@ -182,6 +183,24 @@
         return self._sendCommandBooleanResult(cmd, argsToSend)
 
     # 
--------------------------------------------------------------------------
+    # Start this gadget.
+    # 
--------------------------------------------------------------------------
+    def start(self, command = None, parameters = {}):
+        """Start this gadget.
+        @param command: Command name to start the gadget.
+            if command is None, the first command is set.
+        @param parameters: Parameters of the gadget as dictionary.
+            if no parameter is defined the default ones are set.
+            if a parameter is wrong or missing the default one is set.
+        @return: The success of the gadget start.
+        """
+        if not self.startAsync(command, parameters):
+            return False
+        self._waitFor(ST_NAME_FW_GADGET_STOPPED, self.__description.getUuid(),
+            600.0)
+        return True
+
+    # 
--------------------------------------------------------------------------
     # Stop the gadget.
     # 
--------------------------------------------------------------------------
     def stop(self):


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to