Author: remi
Date: 2008-12-18 15:17:29 +0100 (Thu, 18 Dec 2008)
New Revision: 3194
Modified:
software_suite_v2/tuxware/pytuxisalive/trunk/src/installer.nsi
software_suite_v2/tuxware/pytuxisalive/trunk/src/setup.py
software_suite_v2/tuxware/pytuxisalive/trunk/src/setup_only_api.py
software_suite_v2/tuxware/pytuxisalive/trunk/src/tuxisalive/lib/osl/TuxOSL.py
software_suite_v2/tuxware/pytuxisalive/trunk/src/tuxisalive/lib/osl/libtuxosl.dll
software_suite_v2/tuxware/pytuxisalive/trunk/src/tuxisalive/version.py
Log:
* merged the "complete refactoring" branches with the trunk
Modified: software_suite_v2/tuxware/pytuxisalive/trunk/src/installer.nsi
===================================================================
--- software_suite_v2/tuxware/pytuxisalive/trunk/src/installer.nsi
2008-12-18 14:14:35 UTC (rev 3193)
+++ software_suite_v2/tuxware/pytuxisalive/trunk/src/installer.nsi
2008-12-18 14:17:29 UTC (rev 3194)
@@ -4,7 +4,7 @@
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "Tuxisalive python package"
-!define PRODUCT_VERSION "0.1.2"
+!define PRODUCT_VERSION "0.2.1"
; Output names
!define FINAL_INSTALLER_EXE "pyTuxisaliveInstaller_${PRODUCT_VERSION}.exe"
Modified: software_suite_v2/tuxware/pytuxisalive/trunk/src/setup.py
===================================================================
--- software_suite_v2/tuxware/pytuxisalive/trunk/src/setup.py 2008-12-18
14:14:35 UTC (rev 3193)
+++ software_suite_v2/tuxware/pytuxisalive/trunk/src/setup.py 2008-12-18
14:17:29 UTC (rev 3194)
@@ -68,7 +68,7 @@
PACKAGE_BASE_PATH = get_python_lib()
setup(name = 'tuxisalive',
- version = '0.1.2',
+ version = '0.2.1',
description = 'Python utilities for Tuxdroid',
author = 'Remi Jocaille',
author_email = '[email protected]',
@@ -97,7 +97,7 @@
# Install the package (.so files only)
#
setup(name = 'tuxisalive',
- version = '0.1.2',
+ version = '0.2.1',
description = 'Python utilities for Tuxdroid',
author = 'Remi Jocaille',
author_email = '[email protected]',
Modified: software_suite_v2/tuxware/pytuxisalive/trunk/src/setup_only_api.py
===================================================================
--- software_suite_v2/tuxware/pytuxisalive/trunk/src/setup_only_api.py
2008-12-18 14:14:35 UTC (rev 3193)
+++ software_suite_v2/tuxware/pytuxisalive/trunk/src/setup_only_api.py
2008-12-18 14:17:29 UTC (rev 3194)
@@ -44,7 +44,7 @@
# Install the package
#
setup(name = 'tuxapi',
- version = '0.1.2',
+ version = '0.2.1',
description = 'Python API for Tuxdroid',
author = 'Remi Jocaille',
author_email = '[email protected]',
Modified:
software_suite_v2/tuxware/pytuxisalive/trunk/src/tuxisalive/lib/osl/TuxOSL.py
===================================================================
---
software_suite_v2/tuxware/pytuxisalive/trunk/src/tuxisalive/lib/osl/TuxOSL.py
2008-12-18 14:14:35 UTC (rev 3193)
+++
software_suite_v2/tuxware/pytuxisalive/trunk/src/tuxisalive/lib/osl/TuxOSL.py
2008-12-18 14:17:29 UTC (rev 3194)
@@ -147,6 +147,8 @@
self.__logger.logError(txt)
txt = "The shared library was not handled in your application."
self.__logger.logError(txt)
+ self.__started = False
+ self.__startedMutex = threading.Lock()
#
--------------------------------------------------------------------------
# Register a callback function to the "status" event.
@@ -199,24 +201,50 @@
if ret == E_TUXOSL_NOERROR:
self.__logger.logInfo("Libtuxosl successfuly started.")
+ self.__setStarted(True)
voicesList = self.GetStatusValue(SW_ID_OSL_TTS0_VOICE_LIST)
self.__logger.logInfo(voicesList)
else:
+ self.__setStarted(False)
self.__logger.logError("Libtuxosl can't start : code(%d)
expl(%s)."\
% (ret, self.StrError(ret)))
return ret
#
--------------------------------------------------------------------------
+ # Set the run state of tuxosl.
+ #
--------------------------------------------------------------------------
+ def __setStarted(self, value):
+ """Set the run state of tuxosl.
+ @param value: State.
+ """
+ self.__startedMutex.acquire()
+ self.__started = value
+ self.__startedMutex.release()
+
+ #
--------------------------------------------------------------------------
+ # Get the run state of tuxosl.
+ #
--------------------------------------------------------------------------
+ def getStarted(self):
+ """Get the run state of tuxosl.
+ @return: The state.
+ """
+ self.__startedMutex.acquire()
+ result = self.__started
+ self.__startedMutex.release()
+ return result
+
+ #
--------------------------------------------------------------------------
# Stop libtuxosl.
#
--------------------------------------------------------------------------
def Stop(self):
"""Stop libtuxosl.
"""
- if self.tux_osl_lib == None:
+ if (self.tux_osl_lib == None) or not self.getStarted():
return
self.__logger.logInfo("Stop the library.")
+ self.__setStarted(False)
self.tux_osl_lib.TuxOSL_Stop()
#
--------------------------------------------------------------------------
@@ -237,7 +265,7 @@
@param command: Command to execute.
@return: The success of the command performing.
"""
- if self.tux_osl_lib == None:
+ if (self.tux_osl_lib == None) or not self.getStarted():
return E_TUXOSL_PARSERISDISABLED
ret = self.tux_osl_lib.TuxOSL_PerformCommand(c_double(delay),
@@ -258,7 +286,7 @@
@param file_path: Macro commands file path.
@return: The success of the performing.
"""
- if self.tux_osl_lib == None:
+ if (self.tux_osl_lib == None) or not self.getStarted():
return E_TUXOSL_PARSERISDISABLED
ret = self.tux_osl_lib.TuxOSL_PerformMacroFile(c_char_p(file_path))
@@ -277,7 +305,7 @@
@param macro: Macro commands text.
@return: The success of the performing.
"""
- if self.tux_osl_lib == None:
+ if (self.tux_osl_lib == None) or not self.getStarted():
return E_TUXOSL_PARSERISDISABLED
ret = self.tux_osl_lib.TuxOSL_PerformMacroText(c_char_p(macro))
@@ -296,7 +324,7 @@
def ClearCommandStack(self):
"""Clear the stack of delayed commands.
"""
- if self.tux_osl_lib == None:
+ if (self.tux_osl_lib == None) or not self.getStarted():
return
self.tux_osl_lib.TuxOSL_ClearCommandStack()
@@ -313,7 +341,7 @@
@param name: Status name.
@return: The identifier as Integer.
"""
- if self.tux_osl_lib == None:
+ if (self.tux_osl_lib == None) or not self.getStarted():
return -1
idc = c_int(0)
@@ -338,7 +366,7 @@
@param id: Identifier of the status.
@return: The name of the status or "UNDEFINED".
"""
- if self.tux_osl_lib == None:
+ if (self.tux_osl_lib == None) or not self.getStarted():
return "UNDEFINED"
result = " " * 256
@@ -374,7 +402,7 @@
@param id: Identifier of the status.
@return: The state of the status or "UNDEFINED".
"""
- if self.tux_osl_lib == None:
+ if (self.tux_osl_lib == None) or not self.getStarted():
return "UNDEFINED"
result = " " * 256
@@ -400,7 +428,7 @@
@param id: Identifier of the status.
@return: The value of the status or "UNDEFINED".
"""
- if self.tux_osl_lib == None:
+ if (self.tux_osl_lib == None) or not self.getStarted():
return "UNDEFINED"
result = " " * 256
@@ -425,7 +453,7 @@
"""Get the state of all statuses.
@return: The state of all statuses.
"""
- if self.tux_osl_lib == None:
+ if (self.tux_osl_lib == None) or not self.getStarted():
return ""
result = " " * 8182
@@ -446,7 +474,7 @@
@param status: The state of the status.
@return: A tokens list.
"""
- if self.tux_osl_lib == None:
+ if (self.tux_osl_lib == None) or not self.getStarted():
return []
result = status.split(":")
@@ -470,7 +498,7 @@
'type' : 'string'
}
- if self.tux_osl_lib == None:
+ if (self.tux_osl_lib == None) or not self.getStarted():
return result
status_s = self.TokenizeStatus(status)
@@ -500,6 +528,9 @@
if self.tux_osl_lib == None:
return "Shared library not found"
+ if not self.getStarted():
+ return "Tuxosl is not started"
+
result = self.tux_osl_lib.TuxOSL_StrError(c_int(error_code))
return c_char_p(result).value
Modified:
software_suite_v2/tuxware/pytuxisalive/trunk/src/tuxisalive/lib/osl/libtuxosl.dll
===================================================================
(Binary files differ)
Modified: software_suite_v2/tuxware/pytuxisalive/trunk/src/tuxisalive/version.py
===================================================================
--- software_suite_v2/tuxware/pytuxisalive/trunk/src/tuxisalive/version.py
2008-12-18 14:14:35 UTC (rev 3193)
+++ software_suite_v2/tuxware/pytuxisalive/trunk/src/tuxisalive/version.py
2008-12-18 14:17:29 UTC (rev 3194)
@@ -10,7 +10,7 @@
# http://www.gnu.org/copyleft/gpl.html
name = 'tuxisalive'
-version = '0.1.2'
+version = '0.2.1'
author = "Remi Jocaille ([email protected])"
description = "Utilities for Tuxdroid."
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn