Author: remi
Date: 2008-12-15 10:17:59 +0100 (Mon, 15 Dec 2008)
New Revision: 3123
Modified:
software_suite_v2/software/http_server_resources/chatter_tux/trunk/HTTPRessource/ResourceChatterTux.py
Log:
* added a service to retrieve the current resource state. (chatter_tux/state?)
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-12-15 09:16:47 UTC (rev 3122)
+++
software_suite_v2/software/http_server_resources/chatter_tux/trunk/HTTPRessource/ResourceChatterTux.py
2008-12-15 09:17:59 UTC (rev 3123)
@@ -83,7 +83,7 @@
# Function to play emoticon asynchronously
def CTPlayEmoticonAsync(emoticon):
mediaToPlay = CTEmoticonToAttitune[emoticon]
-
+
if not os.path.isfile(str(mediaToPlay)):
return
@@ -209,3 +209,24 @@
funct_chatter_tux_stop,
"ChatterTux",
"Stop the service.")
+
+# -------------------------------------------------------------------------
+# /chatter_tux/state?
+# -------------------------------------------------------------------------
+def funct_chatter_tux_state(id_client, parameters):
+ global CTMyConf
+
+ content_struct = copy.deepcopy(DEFAULT_CONTENT_STRUCT)
+ content_struct['root']['result'] = getStrError(E_TDREST_SUCCESS)
+ content_struct['root']['data'] = {}
+ content_struct['root']['data']['state'] = CTMyConf['active']
+
+ content = structToXML(content_struct, True)
+
+ return DEFAULT_HEADERS, content
+
+Glb_ServiceContainer.createService('/chatter_tux/state?',
+ TDCC_LEVEL_FREE_CLIENT,
+ funct_chatter_tux_state,
+ "ChatterTux",
+ "Get the state of the service.")
------------------------------------------------------------------------------
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