Author: remi
Date: 2008-11-28 11:22:02 +0100 (Fri, 28 Nov 2008)
New Revision: 2892
Modified:
software_suite_v2/software/http_server_resources/chatter_tux/trunk/HTTPRessource/ResourceChatterTux.py
Log:
* updated chatterChatter resource according the last HTTPServer changes
Modified:
software_suite_v2/software/http_server_resources/chatter_tux/trunk/HTTPRessource/ResourceChatterTux.py
===================================================================
---
software_suite_v2/software/http_server_resources/chatter_tux/trunk/HTTPRessource/ResourceChatterTux.py
2008-11-27 16:48:04 UTC (rev 2891)
+++
software_suite_v2/software/http_server_resources/chatter_tux/trunk/HTTPRessource/ResourceChatterTux.py
2008-11-28 10:22:02 UTC (rev 2892)
@@ -4,22 +4,8 @@
if os.name == 'nt':
# Get the language installation
- # TODO : move this in the HTTP server.
- from _winreg import *
- aReg = ConnectRegistry(None, HKEY_LOCAL_MACHINE)
- aKey = OpenKey(aReg, r"SOFTWARE\Tuxdroid\TuxdroidSetup")
- lang = QueryValueEx(aKey, "Language")
- CloseKey(aKey)
+ CTLocutor = TUXDROID_DEFAULT_LOCUTOR
- CTLangLoc = {
- 'en' : 'Ryan',
- 'fr' : 'Bruno',
- 'nl' : 'Sofie'
- }
-
- CTLocutor = CTLangLoc[lang[0]]
- # end TODO
-
# Default configuration
CTDefaultConf = {
'active' : True,
@@ -27,15 +13,12 @@
# Attempt to read the configuration
CTMyConfFile = "ResourceChatterTux.conf"
- CTMyConf = TDResourceConf().load(CTMyConfFile)
- # If the cofiguration not exists then create it with default values
- if CTMyConf == None:
- TDResourceConf().store(CTMyConfFile, CTDefaultConf)
- CTMyConf = TDResourceConf().load(CTMyConfFile)
+ CTMyConf = TDResourceConf().load(CTMyConfFile, CTDefaultConf)
# Emoticons configuration
- CHATTERTUX_ATT_PATH = os.path.join(MYTUX_PATH, "MyTuxAttitunes",
- "chatterTux")
+ CHATTERTUX_ATT_PATH = os.path.join(TUXDROID_BASE_PATH, "resources",
+ "attitunes", "chatterTux")
+
CTEmoticonToAttitune = {
':d' : os.path.join(CHATTERTUX_ATT_PATH, "Rire.wav"),
'lol' : os.path.join(CHATTERTUX_ATT_PATH, "LOL.wav"),
@@ -75,8 +58,10 @@
CTEmoticonsKeys = CTEmoticonToAttitune.keys()
# Chatter tux exe commands
- CTChatterTuxStart = 'c:/tuxdroid/bin/ChatterTux/chattertux_start.exe'
- CTChatterTuxStop = 'c:/tuxdroid/bin/ChatterTux/chattertux_stop.exe'
+ CTChatterTuxStart = os.path.join(TUXDROID_BASE_PATH, "resources",
+ "tuxhttpserver", "chatterTux", "chattertux_start.exe")
+ CTChatterTuxStop = os.path.join(TUXDROID_BASE_PATH, "resources",
+ "tuxhttpserver", "chatterTux", "chattertux_stop.exe")
# If the service is active then load it at the server launch
if CTMyConf['active']:
@@ -164,7 +149,7 @@
content_struct = copy.deepcopy(DEFAULT_CONTENT_STRUCT)
content_struct['root']['result'] = getStrError(E_TDREST_SUCCESS)
- Glb_Logger.logInfo("Start ChatterTux service.")
+ Glb_ResourcesLog.logInfo("Start ChatterTux service.")
os.system(CTChatterTuxStart)
CTMyConf['active'] = True
@@ -192,7 +177,7 @@
content_struct = copy.deepcopy(DEFAULT_CONTENT_STRUCT)
content_struct['root']['result'] = getStrError(E_TDREST_SUCCESS)
- Glb_Logger.logInfo("Stop ChatterTux service.")
+ Glb_ResourcesLog.logInfo("Stop ChatterTux service.")
os.system(CTChatterTuxStop)
CTMyConf['active'] = False
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn