Author: remi
Date: 2009-03-17 10:01:15 +0100 (Tue, 17 Mar 2009)
New Revision: 4103
Modified:
software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/Framework.py
software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/Gadget.py
software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/GadgetParameter.py
software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/GadgetToken.py
software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/GadgetsContainer.py
Log:
* updated comments
* added some variable getters
* added a reference to the Framework object in the GadgetsContainer class
Modified:
software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/Framework.py
===================================================================
--- software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/Framework.py
2009-03-17 08:47:52 UTC (rev 4102)
+++ software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/Framework.py
2009-03-17 09:01:15 UTC (rev 4103)
@@ -33,9 +33,11 @@
'''
#
------------------------------------------------------------------------------
-# Gadget description.
+# Framework class.
#
------------------------------------------------------------------------------
class Framework(object):
+ """Framework class.
+ """
#
--------------------------------------------------------------------------
# Constructor of the class.
@@ -63,7 +65,7 @@
self.__country = "US"
self.__locutor = "Ryan"
self.__pitch = 130
- self.__gadgetsContainer = GadgetsContainer({})
+ self.__gadgetsContainer = GadgetsContainer(self, {})
self.__startMutex = threading.Lock()
self.__logger = SimpleLogger("gadget_framework")
self.__logger.setLevel(LOG_LEVEL_DEBUG)
@@ -316,6 +318,7 @@
#
--------------------------------------------------------------------------
# Start a gadget by it uuid.
+ # TODO : Move this to the Gadget class.
#
--------------------------------------------------------------------------
def startGadgetByUuid(self, gadgetUuid, gadgetCommand, parameters = {}):
"""Start a gadget by it uuid.
@@ -344,6 +347,7 @@
#
--------------------------------------------------------------------------
# Generate a web gadget structure.
+ # TODO : Move this to the Gadget class.
#
--------------------------------------------------------------------------
def generateWebGadgetStructureByUuid(self, gadgetUuid, gadgetCommand,
parameters = {}):
@@ -385,6 +389,7 @@
#
--------------------------------------------------------------------------
# Get the url for a web gadget.
+ # TODO : Move this to the Gadget class.
#
--------------------------------------------------------------------------
def getWebGadgetUrl(self, gadgetUuid, gadgetCommand,
parameters = {}):
@@ -402,6 +407,7 @@
#
--------------------------------------------------------------------------
# Generate the code of a google gadget.
+ # TODO : Move this to the Gadget class.
#
--------------------------------------------------------------------------
def generateGoogleGadgetCode(self, gadgetUuid, gadgetCommand,
parameters = {}):
@@ -427,6 +433,7 @@
#
--------------------------------------------------------------------------
# Start a gadget by it name.
+ # TODO : Move this to the Gadget class.
#
--------------------------------------------------------------------------
def startGadgetByName(self, gadgetName, gadgetCommand, parameters = {}):
"""Start a gadget by it name.
@@ -455,6 +462,8 @@
#
--------------------------------------------------------------------------
# Kill sub-process of a gadget.
+ # TODO : This functionality must be moved to the java gadget-framework,
+ # directly at the method "abort" of the "GadgetInstance.java" source.
#
--------------------------------------------------------------------------
def __killSubProcessOfAGadget(self, gadgetUuid):
"""Kill sub-process of a gadget.
@@ -484,6 +493,7 @@
#
--------------------------------------------------------------------------
# Stop a gadget by it uuid.
+ # TODO : Move this to the Gadget class.
#
--------------------------------------------------------------------------
def stopGadgetByUuid(self, gadgetUuid):
"""Stop a gadget by it uuid.
@@ -504,6 +514,7 @@
#
--------------------------------------------------------------------------
# Stop a gadget by it name.
+ # TODO : Move this to the Gadget class.
#
--------------------------------------------------------------------------
def stopGadgetByName(self, gadgetName):
"""Stop a gadget by it name.
@@ -526,6 +537,7 @@
#
--------------------------------------------------------------------------
# Stop all started gadgets.
+ # TODO : Move this to the GadgetsContainer class.
#
--------------------------------------------------------------------------
def stopAllGadgets(self):
"""Stop all started gadgets.
Modified: software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/Gadget.py
===================================================================
--- software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/Gadget.py
2009-03-17 08:47:52 UTC (rev 4102)
+++ software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/Gadget.py
2009-03-17 09:01:15 UTC (rev 4103)
@@ -8,9 +8,11 @@
from GadgetToken import GadgetToken
#
------------------------------------------------------------------------------
-# Gadget description.
+# Gadget class.
#
------------------------------------------------------------------------------
class Gadget(object):
+ """Gadget class.
+ """
#
--------------------------------------------------------------------------
# Constructor of the class.
Modified:
software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/GadgetParameter.py
===================================================================
---
software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/GadgetParameter.py
2009-03-17 08:47:52 UTC (rev 4102)
+++
software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/GadgetParameter.py
2009-03-17 09:01:15 UTC (rev 4103)
@@ -4,9 +4,11 @@
# http://www.gnu.org/copyleft/gpl.html
#
------------------------------------------------------------------------------
-# Gadget parameter.
+# Gadget parameter class.
#
------------------------------------------------------------------------------
class GadgetParameter(object):
+ """Gadget parameter class.
+ """
#
--------------------------------------------------------------------------
# Constructor of the class.
Modified:
software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/GadgetToken.py
===================================================================
--- software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/GadgetToken.py
2009-03-17 08:47:52 UTC (rev 4102)
+++ software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/GadgetToken.py
2009-03-17 09:01:15 UTC (rev 4103)
@@ -4,9 +4,11 @@
# http://www.gnu.org/copyleft/gpl.html
#
------------------------------------------------------------------------------
-# Gadget description.
+# Gadget token class.
#
------------------------------------------------------------------------------
class GadgetToken(object):
+ """Gadget token class.
+ """
#
--------------------------------------------------------------------------
# Constructor of the class.
Modified:
software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/GadgetsContainer.py
===================================================================
---
software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/GadgetsContainer.py
2009-03-17 08:47:52 UTC (rev 4102)
+++
software_suite_v2/tuxware/tuxdroidserver/trunk/util/gadgets/GadgetsContainer.py
2009-03-17 09:01:15 UTC (rev 4103)
@@ -8,25 +8,39 @@
from Gadget import Gadget
#
------------------------------------------------------------------------------
-# Gadgets container.
+# Gadgets container class.
#
------------------------------------------------------------------------------
class GadgetsContainer(object):
+ """Gadgets container class.
+ """
#
--------------------------------------------------------------------------
# Constructor of the class.
#
--------------------------------------------------------------------------
- def __init__(self, structure):
+ def __init__(self, parent, structure):
"""Constructor of the class.
+ @param parent: Parent Framework object.
@param structure: Gadget container structure as dictionary.
"""
self.__language = "en"
self.__country = "US"
self.__locutor = "Ryan"
self.__pitch = 130
+ self.__gadgets = []
self.__mutex = threading.Lock()
+ self.__parent = parent
self._update(structure)
#
--------------------------------------------------------------------------
+ # Get the parent Framework.
+ #
--------------------------------------------------------------------------
+ def getFramework(self):
+ """Get the parent Framework.
+ @return: A Framework object.
+ """
+ return self.__parent
+
+ #
--------------------------------------------------------------------------
# Get the current container language.
#
--------------------------------------------------------------------------
def getLanguage(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