Author: gwadavel
Date: 2008-12-16 19:02:02 +0100 (Tue, 16 Dec 2008)
New Revision: 3135
Added:
software_suite_v2/software/scripts/login/
software_suite_v2/software/scripts/login/tux_login.py
Log:
Tux welcome you when you log in
Added: software_suite_v2/software/scripts/login/tux_login.py
===================================================================
--- software_suite_v2/software/scripts/login/tux_login.py
(rev 0)
+++ software_suite_v2/software/scripts/login/tux_login.py 2008-12-16
18:02:02 UTC (rev 3135)
@@ -0,0 +1,81 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+#
+# Tux vous souhaite la bienvenue quand vous vous loguer
+#
+# Tux welcome you when you log in
+#
+# V0.0.4 Eric Lescaudron "Gwadavel"
+#
+# A little script for fun, copy, change them and have fun
+#
+# Un petit script pour m'amuser, copiez le, modifiez le et surtout amusez vous
bien
+#
+# Pour l'utiliser, enregistrez le dans votre répertoire home et ajoutez le
+# à votre démmarage de session.
+# Exemple si vous êtes sous gnome allez dans le menu Système --> Préférences
+# --> Sessions --> Ajouter
+# Ajouter un programme de démarrage Nom : TuxWelcome,
+# Commande : /"votre répertoire home"/login.py, Commentaire : Tux vous salue
+# Et validez
+#
+from tuxisalive.api import *
+import os
+from time import localtime, strftime, sleep
+
+# Address and Port of Tux HTTP Server
+
+ip = "127.0.0.1"
+port = 270
+
+#
+username = os.environ['USERNAME']
+lang = os.environ['LANG']
+heure = strftime("%H", localtime()) # Get Hour
+
+
+# For English
+
+locutor = "Ryan"
+matin = "Hello " # morning
+soir = "Good evening " # evening
+welcome = "How are you ? " # politeness
+
+
+# En Francais
+if "fr" in lang:
+ locutor = "Julie "
+ matin = "Bonjour "
+ soir = "Bonsoir "
+ welcome = "comment vas tu ? "
+
+# Morning or Evening
+
+if heure < 17:
+ message = matin
+else:
+ message = soir
+
+# Connect to tux server
+
+tux = TuxAPI(ip, port)
+tux.server.autoConnect(CLIENT_LEVEL_RESTRICTED, 'login', '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):
+ tux.tts.setLocutor(locutor) # set the locutor
+ tux.tts.setPitch(110) # set the Pitch
+# Comment some Lines for less movements
+ tux.eyes.open() # Open the eyes - Ouvre les yeux
+ tux.mouth.open() # open the mouth - ouvre la bouche
+ tux.tts.speak(message) # Tux says - Tux dit
+ tux.flippers.on(4, speed=3) # Move the flippers - Bouge les ailes
+ tux.tts.speak(username)
+ tux.tts.speak(welcome)
+ tux.mouth.close() # close the mouth - ferme la bouche
+tux.access.release()
+tux.server.disconnect()
+tux.destroy()
+
+
Property changes on: software_suite_v2/software/scripts/login/tux_login.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