Author: remi
Date: 2009-03-23 12:32:08 +0100 (Mon, 23 Mar 2009)
New Revision: 4178
Modified:
software_suite_v2/tuxware/tuxdroidserver/trunk/util/applicationserver/gadget/interpreters/GadgetInterpreter.py
software_suite_v2/tuxware/tuxdroidserver/trunk/util/applicationserver/gadget/interpreters/GadgetInterpreterJava.py
software_suite_v2/tuxware/tuxdroidserver/trunk/util/applicationserver/gadget/interpreters/GadgetInterpreterPython.py
Log:
* added doc comments.
Modified:
software_suite_v2/tuxware/tuxdroidserver/trunk/util/applicationserver/gadget/interpreters/GadgetInterpreter.py
===================================================================
---
software_suite_v2/tuxware/tuxdroidserver/trunk/util/applicationserver/gadget/interpreters/GadgetInterpreter.py
2009-03-23 11:22:08 UTC (rev 4177)
+++
software_suite_v2/tuxware/tuxdroidserver/trunk/util/applicationserver/gadget/interpreters/GadgetInterpreter.py
2009-03-23 11:32:08 UTC (rev 4178)
@@ -16,11 +16,11 @@
"""
#
--------------------------------------------------------------------------
- #
+ # Constructor of the class.
#
--------------------------------------------------------------------------
def __init__(self):
+ """Constructor of the class.
"""
- """
self.__shellEnv = {}
self.__workingPath = None
self.__executable = None
@@ -33,19 +33,24 @@
self.__onNotificationThrowedCallback = None
#
--------------------------------------------------------------------------
- #
+ # Prepare the shell commands list.
#
--------------------------------------------------------------------------
def prepareCommand(self):
+ """Prepare the shell commands list.
+ Prepare the shell commands list.
+ @return: A shell commands as list.
"""
- """
return []
#
--------------------------------------------------------------------------
- #
+ # Set the parameters list which will passed to the gadget through the os
+ # environment variables.
#
--------------------------------------------------------------------------
def setParameters(self, parameters):
+ """Set the parameters list which will passed to the gadget through the
+ os environment variables.
+ @param parameters: Parameters as dictionary.
"""
- """
self.__shellEnv = {}
for key in parameters.keys():
self.__shellEnv[str("tgp_%s" % key)] = str(parameters[key])
@@ -62,51 +67,66 @@
self.__workingPath = workingPath
#
--------------------------------------------------------------------------
- #
+ # Get the working path (cwd) of the interpreter.
#
--------------------------------------------------------------------------
def getWorkingPath(self):
+ """Get the working path (cwd) of the interpreter.
+ @return: A directory path.
"""
- """
return self.__workingPath
#
--------------------------------------------------------------------------
- #
+ # Set the executable.
#
--------------------------------------------------------------------------
def setExecutable(self, executable):
+ """Set the executable.
+ @param executable: Executable as string.
"""
- """
self.__executable = executable
#
--------------------------------------------------------------------------
- #
+ # Get the executable.
#
--------------------------------------------------------------------------
def getExecutable(self):
+ """Get the executable.
+ @return: A string.
"""
- """
return self.__executable
#
--------------------------------------------------------------------------
- #
+ # Set the gadget started event callback.
#
--------------------------------------------------------------------------
def setOnGadgetStartedCallback(self, funct):
+ """Set the gadget started event callback.
+ @param funct: Function pointer.
+ Function prototype:
+ def onInterpreterStarted():
+ pass
"""
- """
self.__onGadgetStartedCallback = funct
#
--------------------------------------------------------------------------
- #
+ # Set the gadget stopped event callback.
#
--------------------------------------------------------------------------
def setOnGadgetStoppedCallback(self, funct):
+ """Set the gadget stopped event callback.
+ @param funct: Function pointer.
+ Function prototype:
+ def onInterpreterStopped():
+ pass
"""
- """
self.__onGadgetStoppedCallback = funct
#
--------------------------------------------------------------------------
- #
+ # Set the gadget notification event callback.
#
--------------------------------------------------------------------------
def setOnNotificationThrowedCallback(self, funct):
+ """Set the gadget notification event callback.
+ @param funct: Function pointer.
+ Function prototype:
+ def onInterpreterNotification(messageId, *args):
+ pass
"""
- """
self.__onNotificationThrowedCallback = funct
#
--------------------------------------------------------------------------
@@ -133,20 +153,22 @@
return result
#
--------------------------------------------------------------------------
- #
+ # Get if the interpreter is running or not.
#
--------------------------------------------------------------------------
def isRun(self):
- """
+ """Get if the interpreter is running or not.
@return: True or False.
"""
return self.__getRun()
#
--------------------------------------------------------------------------
- #
+ # Start the interpreter.
#
--------------------------------------------------------------------------
def run(self, command, daemon = False):
+ """Start the interpreter.
+ @param command: Gadget command.
+ @param daemon: Is daemon or not.
"""
- """
if self.__getRun():
return
self.__daemon = daemon
@@ -169,11 +191,11 @@
time.sleep(0.1)
#
--------------------------------------------------------------------------
- #
+ # Abort the current execution of the interpreter.
#
--------------------------------------------------------------------------
def abort(self):
+ """Abort the current execution of the interpreter.
"""
- """
if not self.__getRun():
return
if self.__daemon:
@@ -193,11 +215,11 @@
os.system("kill -9 " + str(self.__process.pid))
#
--------------------------------------------------------------------------
- #
+ # Loop to handling the stdout messages.
#
--------------------------------------------------------------------------
def __stdOutLoop(self):
+ """Loop to handling the stdout messages.
"""
- """
if self.__onGadgetStartedCallback != None:
self.__onGadgetStartedCallback()
while self.__getRun():
Modified:
software_suite_v2/tuxware/tuxdroidserver/trunk/util/applicationserver/gadget/interpreters/GadgetInterpreterJava.py
===================================================================
---
software_suite_v2/tuxware/tuxdroidserver/trunk/util/applicationserver/gadget/interpreters/GadgetInterpreterJava.py
2009-03-23 11:22:08 UTC (rev 4177)
+++
software_suite_v2/tuxware/tuxdroidserver/trunk/util/applicationserver/gadget/interpreters/GadgetInterpreterJava.py
2009-03-23 11:32:08 UTC (rev 4178)
@@ -43,11 +43,11 @@
self.addClassPath(os.path.join(workingPath, 'libraries'))
#
--------------------------------------------------------------------------
- # Prepare the shell command list.
+ # Prepare the shell commands list.
#
--------------------------------------------------------------------------
def prepareCommand(self):
- """Prepare the shell command list.
- @return: A shell command as list.
+ """Prepare the shell commands list.
+ @return: A shell commands as list.
"""
# Get the jar files in the library
fClassPath = ''
Modified:
software_suite_v2/tuxware/tuxdroidserver/trunk/util/applicationserver/gadget/interpreters/GadgetInterpreterPython.py
===================================================================
---
software_suite_v2/tuxware/tuxdroidserver/trunk/util/applicationserver/gadget/interpreters/GadgetInterpreterPython.py
2009-03-23 11:22:08 UTC (rev 4177)
+++
software_suite_v2/tuxware/tuxdroidserver/trunk/util/applicationserver/gadget/interpreters/GadgetInterpreterPython.py
2009-03-23 11:32:08 UTC (rev 4178)
@@ -13,11 +13,11 @@
"""
#
--------------------------------------------------------------------------
- # Prepare the shell command list.
+ # Prepare the shell commands list.
#
--------------------------------------------------------------------------
def prepareCommand(self):
- """Prepare the shell command list.
- @return: A shell command as list.
+ """Prepare the shell commands list.
+ @return: A shell commands as list.
"""
command = [
'python',
------------------------------------------------------------------------------
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