Author: simplet
Date: 2008-12-08 18:42:17 +0100 (Mon, 08 Dec 2008)
New Revision: 3045

Added:
   software_suite_v2/software/scripts/attitune_player/
   software_suite_v2/software/scripts/attitune_player/tuxdroid-attitunes.py
Log:
* a little tool to play attitunes from the command line


Added: software_suite_v2/software/scripts/attitune_player/tuxdroid-attitunes.py
===================================================================
--- software_suite_v2/software/scripts/attitune_player/tuxdroid-attitunes.py    
                        (rev 0)
+++ software_suite_v2/software/scripts/attitune_player/tuxdroid-attitunes.py    
2008-12-08 17:42:17 UTC (rev 3045)
@@ -0,0 +1,28 @@
+#!/usr/bin/python
+# -*- coding: UTF8 -*-
+
+# TODO: ajouter un paramètre pour démarrer l'attitune à un certain endroit ?
+
+from tuxisalive.api import *
+import sys
+
+# Récupération du nom du fichier sur la ligne de commande
+if len(sys.argv) != 2:
+   print "Player de fichier attitunes pour le tuxdroid. [Simplet].\nUSAGE: 
"+sys.argv[0]+" <fichier attitune>"
+   sys.exit()
+
+tux = TuxAPI('127.0.0.1', 270)
+tux.server.autoConnect(CLIENT_LEVEL_RESTRICTED, 'TuxDroidAttitunes', 'NONE')
+tux.server.waitConnected(10.0)
+tux.dongle.waitConnected(10.0)
+tux.radio.waitConnected(10.0)
+if tux.access.waitAcquire(10.0, ACCESS_PRIORITY_NORMAL):
+
+   if tux.attitune.load(sys.argv[1]):
+      tux.attitune.play()
+   else:
+      print "Erreur de chargement du fichier attitune."
+
+tux.access.release()
+tux.server.disconnect()
+tux.destroy()


Property changes on: 
software_suite_v2/software/scripts/attitune_player/tuxdroid-attitunes.py
___________________________________________________________________
Name: svn:executable
   + *


------------------------------------------------------------------------------
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

Reply via email to