[tuxdroid-svn] r5490 - in software_suite_v3/smart-core/smart-server/branches/user_mode: . resource
Status: Beta
Brought to you by:
ks156
Author: ks156
Date: 2009-09-24 12:35:51 +0200 (Thu, 24 Sep 2009)
New Revision: 5490
Added:
software_suite_v3/smart-core/smart-server/branches/user_mode/translation/tts_fixes/de.po
Modified:
software_suite_v3/smart-core/smart-server/branches/user_mode/TDSAutoUpdater.py
software_suite_v3/smart-core/smart-server/branches/user_mode/installer.nsi
software_suite_v3/smart-core/smart-server/branches/user_mode/resources/04_robot_content_interactions/00_resourceRobotContentInteractions.py
software_suite_v3/smart-core/smart-server/branches/user_mode/translation/Translation.py
software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/de.po
software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/en.po
software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/nl.po
software_suite_v3/smart-core/smart-server/branches/user_mode/util/player/mplayer/Mplayer.py
software_suite_v3/smart-core/smart-server/branches/user_mode/version.py
Log:
* Merged rev 5431 to 5489 from trunk into user_mode
Modified: software_suite_v3/smart-core/smart-server/branches/user_mode/TDSAutoUpdater.py
===================================================================
--- software_suite_v3/smart-core/smart-server/branches/user_mode/TDSAutoUpdater.py 2009-09-22 15:08:33 UTC (rev 5489)
+++ software_suite_v3/smart-core/smart-server/branches/user_mode/TDSAutoUpdater.py 2009-09-24 10:35:51 UTC (rev 5490)
@@ -23,7 +23,7 @@
from util.misc import URLTools
from util.logger import *
-DIST_STATE = "online"
+DIST_STATE = "beta-test"
PART_CONF_SRC_URL = 0
PART_CONF_DEST = 1
Modified: software_suite_v3/smart-core/smart-server/branches/user_mode/installer.nsi
===================================================================
--- software_suite_v3/smart-core/smart-server/branches/user_mode/installer.nsi 2009-09-22 15:08:33 UTC (rev 5489)
+++ software_suite_v3/smart-core/smart-server/branches/user_mode/installer.nsi 2009-09-24 10:35:51 UTC (rev 5490)
@@ -4,7 +4,7 @@
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "Smart Server"
-!define PRODUCT_VERSION "0.4.2-b1"
+!define PRODUCT_VERSION "0.4.2-b2"
; Output names
!define FINAL_INSTALLER_EXE "SmartServerInstaller_${PRODUCT_VERSION}.exe"
Modified: software_suite_v3/smart-core/smart-server/branches/user_mode/resources/04_robot_content_interactions/00_resourceRobotContentInteractions.py
===================================================================
--- software_suite_v3/smart-core/smart-server/branches/user_mode/resources/04_robot_content_interactions/00_resourceRobotContentInteractions.py 2009-09-22 15:08:33 UTC (rev 5489)
+++ software_suite_v3/smart-core/smart-server/branches/user_mode/resources/04_robot_content_interactions/00_resourceRobotContentInteractions.py 2009-09-24 10:35:51 UTC (rev 5490)
@@ -44,6 +44,8 @@
self.__startStopPauseMutex = threading.Lock()
self.__execStarted = False
self.__execPaused = False
+ self.__language = resourcePluginsServer.getPluginsContainer().getLanguage()
+ self.__translations = Translation("tts_fixes")
def getPluginInterpreterContext(self):
"""
@@ -270,6 +272,7 @@
if not self.executionIsStarted():
resourceTuxDriver.closeMouth()
return
+ text = self.__translations.fixeWordsInText(text, self.__language)
resourceTuxOSL.ttsSpeak(text, locutor, pitch)
if not self.executionIsStarted():
resourceTuxDriver.closeMouth()
@@ -465,7 +468,8 @@
if ugcObj.getDescription().getUuid() == uuid:
self.__onDemandIndex = i
self.computeOnDemandDictForThumbnailBar()
- break
+ return True
+ return False
def computeOnDemandDictForThumbnailBar(self):
"""
@@ -583,6 +587,7 @@
messages = pguContext.getMessagesHistory()
result['count'] = len(messages)
for i, message in enumerate(messages):
+ """
if not String.isUtf8(message):
try:
tmp = message.decode("latin-1", "ignore")
@@ -590,6 +595,7 @@
except:
pass
message = String.toUtf8(message)
+ """
result['msg_%d' % i] = message
return result
self.__bfPguContextMutex.acquire()
@@ -944,7 +950,7 @@
return
ugc.start(ugc.getDefaultRunCommandName())
- def startCurrentGadget(self):
+ def startCurrentGadget(self, ugc = None):
"""
"""
if not self.isStarted():
@@ -959,7 +965,8 @@
return
# Else load current selected on demand gadget
if len(self.__onDemandList) > 0:
- ugc = self.__onDemandList[self.__onDemandIndex]
+ if ugc == None:
+ ugc = self.__onDemandList[self.__onDemandIndex]
if not self.__checkLastStopActionTime():
return
t = threading.Thread(target = ugc.start, args = (ugc.getDefaultRunCommandName(),))
@@ -1391,8 +1398,12 @@
headersStruct = self.getDefaultHeadersStruct()
contentStruct = self.getDefaultContentStruct()
uuid = parameters['uuid']
- resourceRobotContentInteractions.getPguContextsManager().selectOnDemandByUuid(uuid)
- t = threading.Thread(target = resourceRobotContentInteractions.getPguContextsManager().startCurrentGadget)
+ if resourceRobotContentInteractions.getPguContextsManager().selectOnDemandByUuid(uuid):
+ ugc = None
+ else:
+ ugc = resourceUgcServer.getUgcContainer().getUgcByUuid(uuid)
+ t = threading.Thread(target = resourceRobotContentInteractions.getPguContextsManager().startCurrentGadget,
+ args = (ugc,))
t.start()
contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
return headersStruct, contentStruct
Modified: software_suite_v3/smart-core/smart-server/branches/user_mode/translation/Translation.py
===================================================================
--- software_suite_v3/smart-core/smart-server/branches/user_mode/translation/Translation.py 2009-09-22 15:08:33 UTC (rev 5489)
+++ software_suite_v3/smart-core/smart-server/branches/user_mode/translation/Translation.py 2009-09-24 10:35:51 UTC (rev 5490)
@@ -44,6 +44,18 @@
language = "en"
return self.__i18nList[language].getDictionnary()
+ def fixeWordsInText(self, text, language):
+ """
+ """
+ translations = self.getTranslations(language)
+ splitedText = text.lower().split(" ")
+ fixedText = ""
+ for i, word in enumerate(splitedText):
+ if translations.has_key(word):
+ splitedText[i] = translations[word]
+ fixedText += splitedText[i] + " "
+ return fixedText
+
def getMsgIDList(self):
"""
"""
Copied: software_suite_v3/smart-core/smart-server/branches/user_mode/translation/tts_fixes/de.po (from rev 5489, software_suite_v3/smart-core/smart-server/trunk/translation/tts_fixes/de.po)
===================================================================
--- software_suite_v3/smart-core/smart-server/branches/user_mode/translation/tts_fixes/de.po (rev 0)
+++ software_suite_v3/smart-core/smart-server/branches/user_mode/translation/tts_fixes/de.po 2009-09-24 10:35:51 UTC (rev 5490)
@@ -0,0 +1,23 @@
+msgid "current_menu_is"
+msgstr "current menu is"
+
+msgid "skype"
+msgstr "skajp"
+
+msgid "tux"
+msgstr "tux"
+
+msgid "droid"
+msgstr "droid"
+
+msgid "tuxdroid"
+msgstr "tuxdroid"
+
+msgid "twitter"
+msgstr "twitter"
+
+msgid "facebook"
+msgstr "fejsbouck"
+
+msgid "gadget"
+msgstr "kadchet"
Modified: software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/de.po
===================================================================
--- software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/de.po 2009-09-22 15:08:33 UTC (rev 5489)
+++ software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/de.po 2009-09-24 10:35:51 UTC (rev 5490)
@@ -161,7 +161,7 @@
msgstr "Online-Dokumentation"
msgid "documentation_url"
-msgstr "http://www.kysoh.com/documentation-3?set_language=de"
+msgstr "http://www.kysoh.com/documentation?set_language=en"
msgid "global_settings"
msgstr "Allgemeine Einstellungen"
Modified: software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/en.po
===================================================================
--- software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/en.po 2009-09-22 15:08:33 UTC (rev 5489)
+++ software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/en.po 2009-09-24 10:35:51 UTC (rev 5490)
@@ -161,7 +161,7 @@
msgstr "Online documentation"
msgid "documentation_url"
-msgstr "http://www.kysoh.com/documentation-3?set_language=en"
+msgstr "http://www.kysoh.com/documentation?set_language=en"
msgid "global_settings"
msgstr "Global settings"
Modified: software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/nl.po
===================================================================
--- software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/nl.po 2009-09-22 15:08:33 UTC (rev 5489)
+++ software_suite_v3/smart-core/smart-server/branches/user_mode/translation/wi_user/nl.po 2009-09-24 10:35:51 UTC (rev 5490)
@@ -161,7 +161,7 @@
msgstr "Online documentatie"
msgid "documentation_url"
-msgstr "http://www.kysoh.com/documentation-3?set_language=nl"
+msgstr "http://www.kysoh.com/documentatie?set_language=nl"
msgid "global_settings"
msgstr "Algemene configuratie"
Modified: software_suite_v3/smart-core/smart-server/branches/user_mode/util/player/mplayer/Mplayer.py
===================================================================
--- software_suite_v3/smart-core/smart-server/branches/user_mode/util/player/mplayer/Mplayer.py 2009-09-22 15:08:33 UTC (rev 5489)
+++ software_suite_v3/smart-core/smart-server/branches/user_mode/util/player/mplayer/Mplayer.py 2009-09-24 10:35:51 UTC (rev 5490)
@@ -148,10 +148,11 @@
"-slave",
"-ao",
self.__device,
- #"-nocache",
"-playlist",
uri,
]
+ if uri.lower().find("mms") == 0:
+ uri = "http" + uri[3:]
if uri.lower().find(".m3u") == -1:
if uri.lower().find("http") == 0:
cmd.pop(4)
@@ -171,39 +172,9 @@
try:
buffer = self.__process.stdout.read(100)
except:
- buffer = ""
- if len(buffer) == 0:
- pass
- # No data from mplayer indicates that the program is closed.
- # Then stop the module.
- #if self.onStreamLoosedCallback != None:
- # self.onStreamLoosedCallback()
- #self.stop()
- else:
- buffer = buffer.replace("\r", "\n")
- buffer = incompleteLine + buffer
- bufferLines = buffer.split("\n")
- if len(bufferLines) == 1:
- incompleteLine = bufferLines[0]
- else:
- incompleteLine = bufferLines[-1]
- for line in bufferLines[:-1]:
- line = line[:-1]
- if len(line) == 0:
- continue
- if line[0] == "A":
- matchedIdx = line.rfind("%")
- if matchedIdx != -1:
- bs = line[matchedIdx - 2 : matchedIdx]
- try:
- audioBufferState = int(bs)
- except:
- continue
- if audioBufferState < 5:
- # Audio buffer is underflow.
- # Then restart the module.
- #print "BUFFER UNDERFLOW"
- self.restart()
+ time.sleep(0.1)
+ self.stop()
+ break
# --------------------------------------------------------------------------
# Send a command to mplayer.
Modified: software_suite_v3/smart-core/smart-server/branches/user_mode/version.py
===================================================================
--- software_suite_v3/smart-core/smart-server/branches/user_mode/version.py 2009-09-22 15:08:33 UTC (rev 5489)
+++ software_suite_v3/smart-core/smart-server/branches/user_mode/version.py 2009-09-24 10:35:51 UTC (rev 5490)
@@ -7,7 +7,7 @@
# Distributed under the terms of the GNU General Public License
# http://www.gnu.org/copyleft/gpl.html
-version = '0.4.2-b1'
+version = '0.4.2-b2'
author = "Remi Jocaille (rem...@c2...)"
licence = "GPL"
date = "2009"
|