Author: remi
Date: 2009-03-17 10:43:02 +0100 (Tue, 17 Mar 2009)
New Revision: 4105
Modified:
software_suite_v2/tuxware/tuxdroidserver/trunk/resources/01_robot_system/resourceGadgetFramework.py
software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/Framework.py
software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/GadgetsContainer.py
Log:
* moved the method "stopAllGadgets" from "Framework" to "GadgetsContainer" class
Modified:
software_suite_v2/tuxware/tuxdroidserver/trunk/resources/01_robot_system/resourceGadgetFramework.py
===================================================================
---
software_suite_v2/tuxware/tuxdroidserver/trunk/resources/01_robot_system/resourceGadgetFramework.py
2009-03-17 09:29:52 UTC (rev 4104)
+++
software_suite_v2/tuxware/tuxdroidserver/trunk/resources/01_robot_system/resourceGadgetFramework.py
2009-03-17 09:43:02 UTC (rev 4105)
@@ -515,7 +515,7 @@
headersStruct = self.getDefaultHeadersStruct()
contentStruct = self.getDefaultContentStruct()
contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
- if not resourceGadgetFramework.getFramework().stopAllGadgets():
+ if not
resourceGadgetFramework.getFramework().getGadgetsContainer().stopAllGadgets():
contentStruct['root']['result'] = getStrError(E_TDREST_FAILED)
else:
resourceTTS.stackFlushExceptedUuid("0")
Modified:
software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/Framework.py
===================================================================
--- software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/Framework.py
2009-03-17 09:29:52 UTC (rev 4104)
+++ software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/Framework.py
2009-03-17 09:43:02 UTC (rev 4105)
@@ -96,7 +96,7 @@
"""
def async():
self.__startMutex.acquire()
- self.stopAllGadgets()
+ self.getGadgetsContainer().stopAllGadgets()
self.__logger.logInfo("[Framework] Starting : Begin")
self.__logger.logDebug("[Framework] Stop the previous instance")
self.__frameworkBridge.stop()
@@ -434,26 +434,6 @@
pass
#
--------------------------------------------------------------------------
- # Stop all started gadgets.
- # TODO : Move this to the GadgetsContainer class.
- #
--------------------------------------------------------------------------
- def stopAllGadgets(self):
- """Stop all started gadgets.
- @return: The success.
- """
- if not self.__frameworkBridge.isStarted():
- return False
- cmd = "GADGET"
- subCmd = "STOP_ALL"
- ret = self.__frameworkBridge.sendCommand(cmd, subCmd)
- if ret[0] != "SUCCESS":
- return False
- else:
- for gadget in self.getGadgetsContainer().getGadgets():
-
self._killSubProcessOfAGadget(gadget.getDescription().getUuid())
- return True
-
- #
--------------------------------------------------------------------------
#
#
--------------------------------------------------------------------------
def __onFrameworkEvent(self, args):
Modified:
software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/GadgetsContainer.py
===================================================================
---
software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/GadgetsContainer.py
2009-03-17 09:29:52 UTC (rev 4104)
+++
software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/GadgetsContainer.py
2009-03-17 09:43:02 UTC (rev 4105)
@@ -179,3 +179,25 @@
@return: A Gadget object or None.
"""
return self.getGadgetByName(gadgetName)
+
+ #
--------------------------------------------------------------------------
+ # Stop all started gadgets.
+ #
--------------------------------------------------------------------------
+ def stopAllGadgets(self):
+ """Stop all started gadgets.
+ @return: The success.
+ """
+ framework = self.getFramework()
+ frameworkBridge = framework.getFrameworkBridge()
+ if not frameworkBridge.isStarted():
+ return False
+ cmd = "GADGET"
+ subCmd = "STOP_ALL"
+ ret = frameworkBridge.sendCommand(cmd, subCmd)
+ if ret[0] != "SUCCESS":
+ return False
+ else:
+ for gadget in self.getGadgets():
+ # TODO : Will be removed
+
framework._killSubProcessOfAGadget(gadget.getDescription().getUuid())
+ return True
------------------------------------------------------------------------------
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