tux-droid-svn Mailing List for Tux Droid CE (Page 59)
Status: Beta
Brought to you by:
ks156
You can subscribe to this list here.
| 2007 |
Jan
|
Feb
(32) |
Mar
(108) |
Apr
(71) |
May
(38) |
Jun
(128) |
Jul
(1) |
Aug
(14) |
Sep
(77) |
Oct
(104) |
Nov
(90) |
Dec
(71) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(81) |
Feb
(18) |
Mar
(40) |
Apr
(102) |
May
(151) |
Jun
(74) |
Jul
(151) |
Aug
(257) |
Sep
(447) |
Oct
(379) |
Nov
(404) |
Dec
(430) |
| 2009 |
Jan
(173) |
Feb
(236) |
Mar
(519) |
Apr
(300) |
May
(112) |
Jun
(232) |
Jul
(314) |
Aug
(58) |
Sep
(203) |
Oct
(293) |
Nov
(26) |
Dec
(109) |
| 2010 |
Jan
(19) |
Feb
(25) |
Mar
(33) |
Apr
(1) |
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: jerome <c2m...@c2...> - 2009-04-23 11:50:39
|
Author: jerome
Date: 2009-04-23 13:50:31 +0200 (Thu, 23 Apr 2009)
New Revision: 4580
Modified:
software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/resources/gadget.pot
software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramTV.java
software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramsTvFr.java
Log:
* Added tts message when no programs are available for the selected time frame.
Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/resources/gadget.pot
===================================================================
--- software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/resources/gadget.pot 2009-04-23 10:43:35 UTC (rev 4579)
+++ software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/resources/gadget.pot 2009-04-23 11:50:31 UTC (rev 4580)
@@ -94,3 +94,6 @@
msgid "Please re-configure your gadget to get a TV program list."
msgstr ""
+msgid "I didn't find any TV programs according to your selected time frame."
+msgstr ""
+
Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramTV.java
===================================================================
--- software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramTV.java 2009-04-23 10:43:35 UTC (rev 4579)
+++ software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramTV.java 2009-04-23 11:50:31 UTC (rev 4580)
@@ -49,7 +49,7 @@
gadget.throwMessage("No TV program for now");
}
}
-
+
//Morning program.
if(configuration.getGiveMorning())
{
@@ -62,6 +62,11 @@
Vector<Program> morning = SimplePrograms.sortMorning(programme);
+ if(morning.size() == 0)
+ {
+ gadget.throwMessage("I didn't find any TV programs according to your selected time frame.");
+ }
+
for(Program oneProgram : morning)
{
if(!configuration.getGiveProgramDescription() || (oneProgram.getDescription().equalsIgnoreCase("undefined")))
@@ -86,6 +91,12 @@
}
Vector<Program> afternoon = SimplePrograms.sortAfternoon(programme);
+
+ if(afternoon.size() == 0)
+ {
+ gadget.throwMessage("I didn't find any TV programs according to your selected time frame.");
+ }
+
for(Program oneProgram : afternoon)
{
@@ -111,6 +122,12 @@
}
Vector<Program> evening = SimplePrograms.sortEvening(programme);
+
+ if(evening.size() == 0)
+ {
+ gadget.throwMessage("I didn't find any TV programs according to your selected time frame.");
+ }
+
for(Program oneProgram : evening)
{
if(!configuration.getGiveProgramDescription() || (oneProgram.getDescription().equalsIgnoreCase("undefined")))
Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramsTvFr.java
===================================================================
--- software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramsTvFr.java 2009-04-23 10:43:35 UTC (rev 4579)
+++ software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramsTvFr.java 2009-04-23 11:50:31 UTC (rev 4580)
@@ -106,13 +106,19 @@
*/
public void giveProgram(Vector<Program> programme)
{
- throwMessage("On {0}", programme.get(0).getChannel());
//Give now playing program.
if(this.configuration().getGiveNowPlaying())
{
Program nowPlaying = SimplePrograms.getNowPlaying(programme);
- throwMessage("Now playing on {0}, {1}", nowPlaying.getChannel(), nowPlaying.getTitle());
+ if(nowPlaying != null)
+ {
+ throwMessage("Now playing on {0}, {1}", nowPlaying.getChannel(), nowPlaying.getTitle());
+ }
+ else
+ {
+ throwMessage("No TV program for now");
+ }
}
//Morning program.
@@ -127,6 +133,11 @@
Vector<Program> morning = SimplePrograms.sortMorning(programme);
+ if(morning.size() == 0)
+ {
+ throwMessage("I didn't find any TV programs according to your selected time frame.");
+ }
+
for(Program oneProgram : morning)
{
if(!this.configuration().getGiveProgramDescription())
@@ -151,6 +162,12 @@
}
Vector<Program> afternoon = SimplePrograms.sortAfternoon(programme);
+
+ if(afternoon.size() == 0)
+ {
+ throwMessage("I didn't find any TV programs according to your selected time frame.");
+ }
+
for(Program oneProgram : afternoon)
{
@@ -176,6 +193,12 @@
}
Vector<Program> evening = SimplePrograms.sortEvening(programme);
+
+ if(evening.size() == 0)
+ {
+ throwMessage("I didn't find any TV programs according to your selected time frame.");
+ }
+
for(Program oneProgram : evening)
{
if(!this.configuration().getGiveProgramDescription())
|
|
From: jerome <c2m...@c2...> - 2009-04-23 10:43:43
|
Author: jerome
Date: 2009-04-23 12:43:35 +0200 (Thu, 23 Apr 2009)
New Revision: 4579
Modified:
software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramTV.java
software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramsTvFr.java
Log:
* Inverted tts order ( on yyy your morning ==> Your morning ... on yyy ).
Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramTV.java
===================================================================
--- software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramTV.java 2009-04-23 10:39:07 UTC (rev 4578)
+++ software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramTV.java 2009-04-23 10:43:35 UTC (rev 4579)
@@ -49,15 +49,17 @@
gadget.throwMessage("No TV program for now");
}
}
- else
- {
- gadget.throwMessage("On {0}", programme.get(0).getChannel());
- }
//Morning program.
if(configuration.getGiveMorning())
{
gadget.throwMessage("Your morning TV Programs");
+
+ if(!configuration.getGiveNowPlaying())
+ {
+ gadget.throwMessage("On {0}", programme.get(0).getChannel());
+ }
+
Vector<Program> morning = SimplePrograms.sortMorning(programme);
for(Program oneProgram : morning)
@@ -77,6 +79,12 @@
if (configuration.getGiveAfternoon())
{
gadget.throwMessage("Your afternoon TV Programs");
+
+ if(!configuration.getGiveNowPlaying())
+ {
+ gadget.throwMessage("On {0}", programme.get(0).getChannel());
+ }
+
Vector<Program> afternoon = SimplePrograms.sortAfternoon(programme);
for(Program oneProgram : afternoon)
{
@@ -96,6 +104,12 @@
if(configuration.getGiveEvening())
{
gadget.throwMessage("Your evening TV Programs");
+
+ if(!configuration.getGiveNowPlaying())
+ {
+ gadget.throwMessage("On {0}", programme.get(0).getChannel());
+ }
+
Vector<Program> evening = SimplePrograms.sortEvening(programme);
for(Program oneProgram : evening)
{
Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramsTvFr.java
===================================================================
--- software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramsTvFr.java 2009-04-23 10:39:07 UTC (rev 4578)
+++ software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramsTvFr.java 2009-04-23 10:43:35 UTC (rev 4579)
@@ -114,16 +114,17 @@
Program nowPlaying = SimplePrograms.getNowPlaying(programme);
throwMessage("Now playing on {0}, {1}", nowPlaying.getChannel(), nowPlaying.getTitle());
}
- else
- {
- throwMessage("On {0}", programme.get(0).getChannel());
- }
//Morning program.
if(this.configuration().getGiveMorning())
{
throwMessage("Your morning TV Programs");
+ if(!this.configuration().getGiveNowPlaying())
+ {
+ throwMessage("On {0}", programme.get(0).getChannel());
+ }
+
Vector<Program> morning = SimplePrograms.sortMorning(programme);
for(Program oneProgram : morning)
@@ -143,6 +144,12 @@
if (this.configuration().getGiveAfternoon())
{
throwMessage("Your afternoon TV Programs");
+
+ if(!this.configuration().getGiveNowPlaying())
+ {
+ throwMessage("On {0}", programme.get(0).getChannel());
+ }
+
Vector<Program> afternoon = SimplePrograms.sortAfternoon(programme);
for(Program oneProgram : afternoon)
{
@@ -162,6 +169,12 @@
if(this.configuration().getGiveEvening())
{
throwMessage("Your evening TV Programs");
+
+ if(!this.configuration().getGiveNowPlaying())
+ {
+ throwMessage("On {0}", programme.get(0).getChannel());
+ }
+
Vector<Program> evening = SimplePrograms.sortEvening(programme);
for(Program oneProgram : evening)
{
|
|
From: jerome <c2m...@c2...> - 2009-04-23 10:39:13
|
Author: jerome
Date: 2009-04-23 12:39:07 +0200 (Thu, 23 Apr 2009)
New Revision: 4578
Modified:
software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/resources/gadget.pot
software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramTV.java
software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramsTvFr.java
Log:
* Updated strings.
Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/resources/gadget.pot
===================================================================
--- software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/resources/gadget.pot 2009-04-22 13:15:25 UTC (rev 4577)
+++ software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/resources/gadget.pot 2009-04-23 10:39:07 UTC (rev 4578)
@@ -76,7 +76,7 @@
msgid "On {0}"
msgstr ""
-msgid "The program for your morning"
+msgid "Your morning TV Programs"
msgstr ""
msgid "{0}, {1}"
@@ -85,10 +85,10 @@
msgid "{0}, {1}, {2}"
msgstr ""
-msgid "The program for your afternoon"
+msgid "Your afternoon TV Programs"
msgstr ""
-msgid "The program for your evening"
+msgid "Your evening TV Programs"
msgstr ""
msgid "Please re-configure your gadget to get a TV program list."
Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramTV.java
===================================================================
--- software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramTV.java 2009-04-22 13:15:25 UTC (rev 4577)
+++ software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramTV.java 2009-04-23 10:39:07 UTC (rev 4578)
@@ -57,7 +57,7 @@
//Morning program.
if(configuration.getGiveMorning())
{
- gadget.throwMessage("The program for your morning");
+ gadget.throwMessage("Your morning TV Programs");
Vector<Program> morning = SimplePrograms.sortMorning(programme);
for(Program oneProgram : morning)
@@ -76,7 +76,7 @@
//Afternoon program.
if (configuration.getGiveAfternoon())
{
- gadget.throwMessage("The program for your afternoon");
+ gadget.throwMessage("Your afternoon TV Programs");
Vector<Program> afternoon = SimplePrograms.sortAfternoon(programme);
for(Program oneProgram : afternoon)
{
@@ -95,7 +95,7 @@
//Evening program.
if(configuration.getGiveEvening())
{
- gadget.throwMessage("The program for your evening");
+ gadget.throwMessage("Your evening TV Programs");
Vector<Program> evening = SimplePrograms.sortEvening(programme);
for(Program oneProgram : evening)
{
Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramsTvFr.java
===================================================================
--- software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramsTvFr.java 2009-04-22 13:15:25 UTC (rev 4577)
+++ software_suite_v2/software/gadgets/tuxdroid-gadget-programsTV/trunk/tuxdroid-gadget-programsTV/src/com/kysoh/tvPrograms/gadget/GadgetProgramsTvFr.java 2009-04-23 10:39:07 UTC (rev 4578)
@@ -122,7 +122,7 @@
//Morning program.
if(this.configuration().getGiveMorning())
{
- throwMessage("The program for your morning");
+ throwMessage("Your morning TV Programs");
Vector<Program> morning = SimplePrograms.sortMorning(programme);
@@ -142,7 +142,7 @@
//Afternoon program.
if (this.configuration().getGiveAfternoon())
{
- throwMessage("The program for your afternoon");
+ throwMessage("Your afternoon TV Programs");
Vector<Program> afternoon = SimplePrograms.sortAfternoon(programme);
for(Program oneProgram : afternoon)
{
@@ -161,7 +161,7 @@
//Evening program.
if(this.configuration().getGiveEvening())
{
- throwMessage("The program for your evening");
+ throwMessage("Your evening TV Programs");
Vector<Program> evening = SimplePrograms.sortEvening(programme);
for(Program oneProgram : evening)
{
|
|
From: Gwadavel <c2m...@c2...> - 2009-04-22 13:15:50
|
Author: Gwadavel
Date: 2009-04-22 15:15:25 +0200 (Wed, 22 Apr 2009)
New Revision: 4577
Modified:
softwares_suite_v3/community/script/pidgin/trunk/tux_pidgin.py
Log:
Use gtk instead gobject, add stop icon in systray to stop the script
Modified: softwares_suite_v3/community/script/pidgin/trunk/tux_pidgin.py
===================================================================
--- softwares_suite_v3/community/script/pidgin/trunk/tux_pidgin.py 2009-04-22 07:08:21 UTC (rev 4576)
+++ softwares_suite_v3/community/script/pidgin/trunk/tux_pidgin.py 2009-04-22 13:15:25 UTC (rev 4577)
@@ -60,7 +60,7 @@
import dbus
import dbus.glib
import dbus.decorators
-import gobject
+import gtk
import os
import re
import time
@@ -225,6 +225,11 @@
tux.mouth.close()
tux.access.release()
+def on_end_program(e):
+ tux.server.disconnect()
+ tux.destroy()
+ gtk.main_quit()
+
# Main
tux = TuxAPI(tgp_ip, tgp_port)
@@ -261,8 +266,8 @@
dbus_interface = "im.pidgin.purple.PurpleInterface",
signal_name = "ReceivedChatMsg")
-loop = gobject.MainLoop()
-loop.run()
+icon = gtk.status_icon_new_from_stock(gtk.STOCK_STOP)
+icon.connect("activate", on_end_program)
+icon.set_visible(True)
-tux.server.disconnect()
-tux.destroy()
+gtk.main()
|
|
From: Gwadavel <c2m...@c2...> - 2009-04-22 07:08:31
|
Author: Gwadavel Date: 2009-04-22 09:08:21 +0200 (Wed, 22 Apr 2009) New Revision: 4576 Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-battery/ Removed: software_suite_v2/software/gadgets/tuxdroid-gadget-battery/ Log: It's gadget for API version 0.3.0 Copied: softwares_suite_v3/community/gadget/tuxdroid-gadget-battery (from rev 4575, software_suite_v2/software/gadgets/tuxdroid-gadget-battery) |
|
From: Gwadavel <c2m...@c2...> - 2009-04-21 16:04:08
|
Author: Gwadavel
Date: 2009-04-21 18:03:44 +0200 (Tue, 21 Apr 2009)
New Revision: 4575
Modified:
softwares_suite_v3/community/script/pidgin/trunk/tux_pidgin.py
Log:
Now Tux don't say your message
Modified: softwares_suite_v3/community/script/pidgin/trunk/tux_pidgin.py
===================================================================
--- softwares_suite_v3/community/script/pidgin/trunk/tux_pidgin.py 2009-04-21 11:49:35 UTC (rev 4574)
+++ softwares_suite_v3/community/script/pidgin/trunk/tux_pidgin.py 2009-04-21 16:03:44 UTC (rev 4575)
@@ -146,6 +146,7 @@
if tux.server.waitConnected(10.0):
if tux.dongle.waitConnected(10.0):
if tux.radio.waitConnected(10.0):
+ tux.tts.setEncoding("utf-8")
return True
else:
print "radio not connected"
@@ -157,6 +158,17 @@
print "server not connected"
return False
+def account():
+ """ List of your alias """
+
+ list_alias = []
+ for acctID in purple.PurpleAccountsGetAllActive():
+ alias = purple.PurpleAccountGetAlias(acctID)
+ if alias == "":
+ alias = purple.PurpleAccountGetUsername(acctID).split("@")[0]
+ list_alias.append(alias)
+ return list_alias
+
def away():
""" Test status away ou available """
@@ -181,6 +193,8 @@
alias = purple.PurpleBuddyGetAlias(buddy)
else:
alias = name
+ if alias in all_alias:
+ return
if tgp_cia and alias[:3].upper() == "CIA":
text = LANGUAGE["commit"]
else:
@@ -216,7 +230,7 @@
tux = TuxAPI(tgp_ip, tgp_port)
if not tuxConnect():
sys.exit(1)
-tux.tts.setEncoding("utf-8")
+
lang()
bus = dbus.SessionBus()
@@ -229,6 +243,10 @@
tux_speak(LANGUAGE["pidginoff"])
sys.exit(1)
+tux_speak(LANGUAGE["pidginon"])
+
+all_alias = account()
+
if tgp_im:
bus.add_signal_receiver(received_im_msg,
dbus_interface = "im.pidgin.purple.PurpleInterface",
@@ -243,8 +261,6 @@
dbus_interface = "im.pidgin.purple.PurpleInterface",
signal_name = "ReceivedChatMsg")
-tux_speak(LANGUAGE["pidginon"])
-
loop = gobject.MainLoop()
loop.run()
|
|
From: remi <c2m...@c2...> - 2009-04-21 11:49:44
|
Author: remi
Date: 2009-04-21 13:49:35 +0200 (Tue, 21 Apr 2009)
New Revision: 4574
Modified:
softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/gadgets/Gadget.py
Log:
* updated method to update the gadgets parameters of the configured gadgets
Modified: softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/gadgets/Gadget.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/gadgets/Gadget.py 2009-04-21 11:41:05 UTC (rev 4573)
+++ softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/gadgets/Gadget.py 2009-04-21 11:49:35 UTC (rev 4574)
@@ -175,6 +175,19 @@
return result
# --------------------------------------------------------------------------
+ # Get the hidden parameters name list.
+ # --------------------------------------------------------------------------
+ def getHiddenParametersName(self):
+ """Get the hidden parameters name list.
+ @return: A list of strings.
+ """
+ result = []
+ for parameter in self.__parameters:
+ if not parameter.isVisible():
+ result.append(parameter.getName())
+ return result
+
+ # --------------------------------------------------------------------------
# Get if the Gadget object is a configuration or an original gadget.
# --------------------------------------------------------------------------
def isConfiguration(self):
@@ -484,12 +497,15 @@
# --------------------------------------------------------------------------
# Update the parameters of the configured gadget.
# --------------------------------------------------------------------------
- def updateParameters(self, parameters = {}, hiddenParameters = []):
+ def updateParameters(self, parameters = {}, hiddenParameters = None):
"""Update the parameters of the configured gadget.
@param parameters: Parameters of the gadget as dictionary.
if no parameter is defined the default ones are set.
if a parameter is wrong or missing the default one is set.
@param hiddenParameters: Hidden parameters list.
+ if no list (None value) is defined the previous ones are set.
+ if you want reinitializing the default list, you must to pass an
+ empty list.
@return: The success of the command.
* This method only work with a configured gadget.
"""
@@ -497,6 +513,8 @@
return False
if not self._checkObjectType('parameters', parameters, 'dict'):
return False
+ if hiddenParameters == None:
+ hiddenParameters = self.getHiddenParametersName()
args = ""
for key in parameters.keys():
args += "%s=%s|" % (key, parameters[key])
|
|
From: remi <c2m...@c2...> - 2009-04-21 11:41:17
|
Author: remi
Date: 2009-04-21 13:41:05 +0200 (Tue, 21 Apr 2009)
New Revision: 4573
Added:
software_suite_v2/software/tuxdroid_software_updater/trunk/locale/ar/
software_suite_v2/software/tuxdroid_software_updater/trunk/locale/ar/LC_MESSAGES/
software_suite_v2/software/tuxdroid_software_updater/trunk/locale/ar/LC_MESSAGES/default.mo
software_suite_v2/software/tuxdroid_software_updater/trunk/locale/ar/LC_MESSAGES/default.po
software_suite_v2/software/tuxdroid_software_updater/trunk/locale/da/
software_suite_v2/software/tuxdroid_software_updater/trunk/locale/da/LC_MESSAGES/
software_suite_v2/software/tuxdroid_software_updater/trunk/locale/da/LC_MESSAGES/default.mo
software_suite_v2/software/tuxdroid_software_updater/trunk/locale/da/LC_MESSAGES/default.po
software_suite_v2/software/tuxdroid_software_updater/trunk/locale/no/
software_suite_v2/software/tuxdroid_software_updater/trunk/locale/no/LC_MESSAGES/
software_suite_v2/software/tuxdroid_software_updater/trunk/locale/no/LC_MESSAGES/default.mo
software_suite_v2/software/tuxdroid_software_updater/trunk/locale/no/LC_MESSAGES/default.po
software_suite_v2/software/tuxdroid_software_updater/trunk/locale/pt/
software_suite_v2/software/tuxdroid_software_updater/trunk/locale/pt/LC_MESSAGES/
software_suite_v2/software/tuxdroid_software_updater/trunk/locale/pt/LC_MESSAGES/default.mo
software_suite_v2/software/tuxdroid_software_updater/trunk/locale/pt/LC_MESSAGES/default.po
software_suite_v2/software/tuxdroid_software_updater/trunk/locale/sv/
software_suite_v2/software/tuxdroid_software_updater/trunk/locale/sv/LC_MESSAGES/
software_suite_v2/software/tuxdroid_software_updater/trunk/locale/sv/LC_MESSAGES/default.mo
software_suite_v2/software/tuxdroid_software_updater/trunk/locale/sv/LC_MESSAGES/default.po
Modified:
software_suite_v2/software/tuxdroid_software_updater/trunk/LanguageSelectionGUI.pas
software_suite_v2/software/tuxdroid_software_updater/trunk/Unit1.dfm
software_suite_v2/software/tuxdroid_software_updater/trunk/Unit1.pas
Log:
* added more languages in the software updater
Modified: software_suite_v2/software/tuxdroid_software_updater/trunk/LanguageSelectionGUI.pas
===================================================================
--- software_suite_v2/software/tuxdroid_software_updater/trunk/LanguageSelectionGUI.pas 2009-04-21 10:27:47 UTC (rev 4572)
+++ software_suite_v2/software/tuxdroid_software_updater/trunk/LanguageSelectionGUI.pas 2009-04-21 11:41:05 UTC (rev 4573)
@@ -53,6 +53,16 @@
WriteString('Language', 'es');
if Combobox1.Text = 'German' then
WriteString('Language', 'de');
+ if Combobox1.Text = 'Arabic' then
+ WriteString('Language', 'ar');
+ if Combobox1.Text = 'Danish' then
+ WriteString('Language', 'da');
+ if Combobox1.Text = 'Swedish' then
+ WriteString('Language', 'sv');
+ if Combobox1.Text = 'Norwegian' then
+ WriteString('Language', 'no');
+ if Combobox1.Text = 'Portuguese' then
+ WriteString('Language', 'pt');
TUXDROID_INSTALL_LANGUAGE := ReadString('Language');
CloseKey;
end;
Modified: software_suite_v2/software/tuxdroid_software_updater/trunk/Unit1.dfm
===================================================================
--- software_suite_v2/software/tuxdroid_software_updater/trunk/Unit1.dfm 2009-04-21 10:27:47 UTC (rev 4572)
+++ software_suite_v2/software/tuxdroid_software_updater/trunk/Unit1.dfm 2009-04-21 11:41:05 UTC (rev 4573)
@@ -449,6 +449,31 @@
RadioItem = True
OnClick = German1Click
end
+ object Arabic1: TMenuItem
+ Caption = 'Arabic'
+ RadioItem = True
+ OnClick = Arabic1Click
+ end
+ object Swedish1: TMenuItem
+ Caption = 'Swedish'
+ RadioItem = True
+ OnClick = Swedish1Click
+ end
+ object Danish1: TMenuItem
+ Caption = 'Danish'
+ RadioItem = True
+ OnClick = Danish1Click
+ end
+ object Norwegian1: TMenuItem
+ Caption = 'Norwegian'
+ RadioItem = True
+ OnClick = Norwegian1Click
+ end
+ object Portuguese1: TMenuItem
+ Caption = 'Portuguese'
+ RadioItem = True
+ OnClick = Portuguese1Click
+ end
end
object Help1: TMenuItem
Caption = 'Help'
Modified: software_suite_v2/software/tuxdroid_software_updater/trunk/Unit1.pas
===================================================================
--- software_suite_v2/software/tuxdroid_software_updater/trunk/Unit1.pas 2009-04-21 10:27:47 UTC (rev 4572)
+++ software_suite_v2/software/tuxdroid_software_updater/trunk/Unit1.pas 2009-04-21 11:41:05 UTC (rev 4573)
@@ -81,6 +81,11 @@
Spanish1: TMenuItem;
German1: TMenuItem;
InfoDownloadPKCaption: TLabel;
+ Arabic1: TMenuItem;
+ Swedish1: TMenuItem;
+ Danish1: TMenuItem;
+ Norwegian1: TMenuItem;
+ Portuguese1: TMenuItem;
procedure FormCreate(Sender: TObject);
procedure UpdateTimerTimer(Sender: TObject);
procedure InstallButtonClick(Sender: TObject);
@@ -113,6 +118,11 @@
procedure Label4Click(Sender: TObject);
procedure Label4MouseEnter(Sender: TObject);
procedure Label4MouseLeave(Sender: TObject);
+ procedure Arabic1Click(Sender: TObject);
+ procedure Swedish1Click(Sender: TObject);
+ procedure Danish1Click(Sender: TObject);
+ procedure Norwegian1Click(Sender: TObject);
+ procedure Portuguese1Click(Sender: TObject);
private
{ Darations priv }
procedure changeLanguage(Sender: TObject; langISOCode : string);
@@ -363,8 +373,16 @@
form1.Italian1.Checked := true;
if TUXDROID_INSTALL_LANGUAGE = 'es' then
form1.Spanish1.Checked := true;
- if TUXDROID_INSTALL_LANGUAGE = 'de' then
- form1.German1.Checked := true;
+ if TUXDROID_INSTALL_LANGUAGE = 'ar' then
+ form1.Arabic1.Checked := true;
+ if TUXDROID_INSTALL_LANGUAGE = 'sv' then
+ form1.Swedish1.Checked := true;
+ if TUXDROID_INSTALL_LANGUAGE = 'da' then
+ form1.Danish1.Checked := true;
+ if TUXDROID_INSTALL_LANGUAGE = 'no' then
+ form1.Norwegian1.Checked := true;
+ if TUXDROID_INSTALL_LANGUAGE = 'pt' then
+ form1.Portuguese1.Checked := true;
end;
{*
@@ -1619,6 +1637,51 @@
end;
{*
+ * \Brief select Arabic.
+ *}
+procedure TForm1.Arabic1Click(Sender: TObject);
+begin
+ TMenuItem(Sender).Checked := true;
+ changeLanguage(Sender, 'ar');
+end;
+
+{*
+ * \Brief select Swedish.
+ *}
+procedure TForm1.Swedish1Click(Sender: TObject);
+begin
+ TMenuItem(Sender).Checked := true;
+ changeLanguage(Sender, 'sv');
+end;
+
+{*
+ * \Brief select Danish.
+ *}
+procedure TForm1.Danish1Click(Sender: TObject);
+begin
+ TMenuItem(Sender).Checked := true;
+ changeLanguage(Sender, 'da');
+end;
+
+{*
+ * \Brief select Norwegian.
+ *}
+procedure TForm1.Norwegian1Click(Sender: TObject);
+begin
+ TMenuItem(Sender).Checked := true;
+ changeLanguage(Sender, 'no');
+end;
+
+{*
+ * \Brief select Portuguese.
+ *}
+procedure TForm1.Portuguese1Click(Sender: TObject);
+begin
+ TMenuItem(Sender).Checked := true;
+ changeLanguage(Sender, 'pt');
+end;
+
+{*
* \brief Hyperlink to www.kysoh.com
*}
procedure TForm1.Label4Click(Sender: TObject);
Added: software_suite_v2/software/tuxdroid_software_updater/trunk/locale/ar/LC_MESSAGES/default.mo
===================================================================
(Binary files differ)
Property changes on: software_suite_v2/software/tuxdroid_software_updater/trunk/locale/ar/LC_MESSAGES/default.mo
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Name: svn:keywords
+ Id
Added: software_suite_v2/software/tuxdroid_software_updater/trunk/locale/ar/LC_MESSAGES/default.po
===================================================================
--- software_suite_v2/software/tuxdroid_software_updater/trunk/locale/ar/LC_MESSAGES/default.po (rev 0)
+++ software_suite_v2/software/tuxdroid_software_updater/trunk/locale/ar/LC_MESSAGES/default.po 2009-04-21 11:41:05 UTC (rev 4573)
@@ -0,0 +1,169 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"POT-Creation-Date: 2008-11-02 12:00\n"
+"PO-Revision-Date: 2008-12-11 09:06+0100\n"
+"Last-Translator: Rémi Jocaille <rem...@c2...>\n"
+"Language-Team: French <rem...@c2...>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-Language: Arabic\n"
+"X-Poedit-Country: ARABIC\n"
+
+# About Dialog ---------------------------------------------------------------
+msgid "About Tuxdroid Software Updater"
+msgstr "About Tux Droid Software Updater"
+
+msgid "About text"
+msgstr ""
+"Tux Droid Software Updater\n"
+"\n"
+"Version 0.0.1\n"
+"\n"
+"Copyright (C) 2008 Kysoh <rem...@c2...>"
+
+msgid "OK"
+msgstr "OK"
+
+# Main GUI ---------------------------------------------------------------
+msgid "Tuxdroid Software Updater"
+msgstr "Tux Droid Software Updater"
+
+msgid "Files"
+msgstr "Files"
+
+msgid "Check for updates"
+msgstr "Check for updates"
+
+msgid "Quit"
+msgstr "Quit"
+
+msgid "Settings"
+msgstr "Settings"
+
+msgid "Public versions"
+msgstr "Public versions"
+
+msgid "Beta versions (on test)"
+msgstr "Beta versions (on test)"
+
+msgid "Alpha versions (unstable)"
+msgstr "Alpha versions (unstable)"
+
+msgid "Language"
+msgstr "Language"
+
+msgid "Help"
+msgstr "Help"
+
+msgid "About"
+msgstr "About"
+
+msgid "Install"
+msgstr "Install"
+
+msgid "Next"
+msgstr "Next"
+
+msgid "Abord"
+msgstr "Abort"
+
+# User messages ---------------------------------------------------------------
+msgid "Updates name"
+msgstr "Updates name"
+
+msgid "Updates size"
+msgstr "Updates size"
+
+msgid "Total download size ( %.3f Mo )"
+msgstr "Total download size ( %.3f MB )"
+
+msgid "Please wait ..."
+msgstr "Please wait ..."
+
+msgid "This can take some minutes."
+msgstr "This can take some minutes."
+
+msgid "No Internet connection available !"
+msgstr "No Internet connection available !"
+
+msgid "Sorry, the server is currently in maintenance."
+msgstr "Sorry, the server is currently in maintenance."
+
+msgid "Your Tuxdroid is up to date !"
+msgstr "Your Tux Droid is up to date !"
+
+msgid "Get your Tuxdroid up to date !"
+msgstr "Get your Tux Droid up to date !"
+
+msgid "Click Install to start the updating."
+msgstr "Click Install to start the updating."
+
+msgid "Removed : "
+msgstr "Removed : "
+
+msgid "New : "
+msgstr "New : "
+
+msgid "Updated : "
+msgstr "Updated : "
+
+msgid "Downloading"
+msgstr "Downloading"
+
+msgid "Sorry, the server is currently in maintenance. Click Next"
+msgstr "Sorry, the server is currently in maintenance. Click Next"
+
+msgid "Error while downloading the file"
+msgstr "Error while downloading the file"
+
+msgid "Download complete. Click Next"
+msgstr "Downloading complete. Click Next"
+
+msgid "Downloading aborded"
+msgstr "Downloading aborted"
+
+msgid "Abording the download ..."
+msgstr "Aborting the download ..."
+
+msgid "Kill troublesome tasks"
+msgstr "Kill troublesome tasks"
+
+msgid "Uninstalling (This can take few minutes) ..."
+msgstr "Uninstalling (This can take a few minutes) ..."
+
+msgid "Deleting ..."
+msgstr "Deleting ..."
+
+msgid "Installing (This can take few minutes) ..."
+msgstr "Installing (This can take a few minutes) ..."
+
+msgid "Copying ..."
+msgstr "Copying ..."
+
+msgid "Delete the temporary files"
+msgstr "Delete the temporary files"
+
+msgid "Update the data base of installed packages"
+msgstr "Update the database of installed packages"
+
+msgid "Reload the Tuxdroid system"
+msgstr "Reloading the Tux Droid system"
+
+msgid "The installation has been finished !"
+msgstr "The installation has been finished !"
+
+msgid "Tuxdroid Software Updater (AUTOMATIC MODE)"
+msgstr "Tux Droid Software Updater (AUTOMATIC MODE)"
+
+msgid "TTSLanguageName"
+msgstr "Arabic"
+
+msgid "Audio card trouble"
+msgstr ""
+"A problem was detected with your audio cards configuration !\n"
+"Please change your default audio card to \"TuxDroid-Audio\" instead of \"TuxDroid-TTS\" !\n"
+"\n"
+"The \"Audio devices\" window will be opened after closing this window."
+
Property changes on: software_suite_v2/software/tuxdroid_software_updater/trunk/locale/ar/LC_MESSAGES/default.po
___________________________________________________________________
Name: svn:keywords
+ Id
Added: software_suite_v2/software/tuxdroid_software_updater/trunk/locale/da/LC_MESSAGES/default.mo
===================================================================
(Binary files differ)
Property changes on: software_suite_v2/software/tuxdroid_software_updater/trunk/locale/da/LC_MESSAGES/default.mo
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Name: svn:keywords
+ Id
Added: software_suite_v2/software/tuxdroid_software_updater/trunk/locale/da/LC_MESSAGES/default.po
===================================================================
--- software_suite_v2/software/tuxdroid_software_updater/trunk/locale/da/LC_MESSAGES/default.po (rev 0)
+++ software_suite_v2/software/tuxdroid_software_updater/trunk/locale/da/LC_MESSAGES/default.po 2009-04-21 11:41:05 UTC (rev 4573)
@@ -0,0 +1,169 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"POT-Creation-Date: 2008-11-02 12:00\n"
+"PO-Revision-Date: 2008-12-11 09:06+0100\n"
+"Last-Translator: Rémi Jocaille <rem...@c2...>\n"
+"Language-Team: French <rem...@c2...>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-Language: Danish\n"
+"X-Poedit-Country: DANISH\n"
+
+# About Dialog ---------------------------------------------------------------
+msgid "About Tuxdroid Software Updater"
+msgstr "About Tux Droid Software Updater"
+
+msgid "About text"
+msgstr ""
+"Tux Droid Software Updater\n"
+"\n"
+"Version 0.0.1\n"
+"\n"
+"Copyright (C) 2008 Kysoh <rem...@c2...>"
+
+msgid "OK"
+msgstr "OK"
+
+# Main GUI ---------------------------------------------------------------
+msgid "Tuxdroid Software Updater"
+msgstr "Tux Droid Software Updater"
+
+msgid "Files"
+msgstr "Files"
+
+msgid "Check for updates"
+msgstr "Check for updates"
+
+msgid "Quit"
+msgstr "Quit"
+
+msgid "Settings"
+msgstr "Settings"
+
+msgid "Public versions"
+msgstr "Public versions"
+
+msgid "Beta versions (on test)"
+msgstr "Beta versions (on test)"
+
+msgid "Alpha versions (unstable)"
+msgstr "Alpha versions (unstable)"
+
+msgid "Language"
+msgstr "Language"
+
+msgid "Help"
+msgstr "Help"
+
+msgid "About"
+msgstr "About"
+
+msgid "Install"
+msgstr "Install"
+
+msgid "Next"
+msgstr "Next"
+
+msgid "Abord"
+msgstr "Abort"
+
+# User messages ---------------------------------------------------------------
+msgid "Updates name"
+msgstr "Updates name"
+
+msgid "Updates size"
+msgstr "Updates size"
+
+msgid "Total download size ( %.3f Mo )"
+msgstr "Total download size ( %.3f MB )"
+
+msgid "Please wait ..."
+msgstr "Please wait ..."
+
+msgid "This can take some minutes."
+msgstr "This can take some minutes."
+
+msgid "No Internet connection available !"
+msgstr "No Internet connection available !"
+
+msgid "Sorry, the server is currently in maintenance."
+msgstr "Sorry, the server is currently in maintenance."
+
+msgid "Your Tuxdroid is up to date !"
+msgstr "Your Tux Droid is up to date !"
+
+msgid "Get your Tuxdroid up to date !"
+msgstr "Get your Tux Droid up to date !"
+
+msgid "Click Install to start the updating."
+msgstr "Click Install to start the updating."
+
+msgid "Removed : "
+msgstr "Removed : "
+
+msgid "New : "
+msgstr "New : "
+
+msgid "Updated : "
+msgstr "Updated : "
+
+msgid "Downloading"
+msgstr "Downloading"
+
+msgid "Sorry, the server is currently in maintenance. Click Next"
+msgstr "Sorry, the server is currently in maintenance. Click Next"
+
+msgid "Error while downloading the file"
+msgstr "Error while downloading the file"
+
+msgid "Download complete. Click Next"
+msgstr "Downloading complete. Click Next"
+
+msgid "Downloading aborded"
+msgstr "Downloading aborted"
+
+msgid "Abording the download ..."
+msgstr "Aborting the download ..."
+
+msgid "Kill troublesome tasks"
+msgstr "Kill troublesome tasks"
+
+msgid "Uninstalling (This can take few minutes) ..."
+msgstr "Uninstalling (This can take a few minutes) ..."
+
+msgid "Deleting ..."
+msgstr "Deleting ..."
+
+msgid "Installing (This can take few minutes) ..."
+msgstr "Installing (This can take a few minutes) ..."
+
+msgid "Copying ..."
+msgstr "Copying ..."
+
+msgid "Delete the temporary files"
+msgstr "Delete the temporary files"
+
+msgid "Update the data base of installed packages"
+msgstr "Update the database of installed packages"
+
+msgid "Reload the Tuxdroid system"
+msgstr "Reloading the Tux Droid system"
+
+msgid "The installation has been finished !"
+msgstr "The installation has been finished !"
+
+msgid "Tuxdroid Software Updater (AUTOMATIC MODE)"
+msgstr "Tux Droid Software Updater (AUTOMATIC MODE)"
+
+msgid "TTSLanguageName"
+msgstr "Danish"
+
+msgid "Audio card trouble"
+msgstr ""
+"A problem was detected with your audio cards configuration !\n"
+"Please change your default audio card to \"TuxDroid-Audio\" instead of \"TuxDroid-TTS\" !\n"
+"\n"
+"The \"Audio devices\" window will be opened after closing this window."
+
Property changes on: software_suite_v2/software/tuxdroid_software_updater/trunk/locale/da/LC_MESSAGES/default.po
___________________________________________________________________
Name: svn:keywords
+ Id
Added: software_suite_v2/software/tuxdroid_software_updater/trunk/locale/no/LC_MESSAGES/default.mo
===================================================================
(Binary files differ)
Property changes on: software_suite_v2/software/tuxdroid_software_updater/trunk/locale/no/LC_MESSAGES/default.mo
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Name: svn:keywords
+ Id
Added: software_suite_v2/software/tuxdroid_software_updater/trunk/locale/no/LC_MESSAGES/default.po
===================================================================
--- software_suite_v2/software/tuxdroid_software_updater/trunk/locale/no/LC_MESSAGES/default.po (rev 0)
+++ software_suite_v2/software/tuxdroid_software_updater/trunk/locale/no/LC_MESSAGES/default.po 2009-04-21 11:41:05 UTC (rev 4573)
@@ -0,0 +1,169 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"POT-Creation-Date: 2008-11-02 12:00\n"
+"PO-Revision-Date: 2008-12-11 09:06+0100\n"
+"Last-Translator: Rémi Jocaille <rem...@c2...>\n"
+"Language-Team: French <rem...@c2...>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-Language: Norwegian\n"
+"X-Poedit-Country: NORWEGIAN\n"
+
+# About Dialog ---------------------------------------------------------------
+msgid "About Tuxdroid Software Updater"
+msgstr "About Tux Droid Software Updater"
+
+msgid "About text"
+msgstr ""
+"Tux Droid Software Updater\n"
+"\n"
+"Version 0.0.1\n"
+"\n"
+"Copyright (C) 2008 Kysoh <rem...@c2...>"
+
+msgid "OK"
+msgstr "OK"
+
+# Main GUI ---------------------------------------------------------------
+msgid "Tuxdroid Software Updater"
+msgstr "Tux Droid Software Updater"
+
+msgid "Files"
+msgstr "Files"
+
+msgid "Check for updates"
+msgstr "Check for updates"
+
+msgid "Quit"
+msgstr "Quit"
+
+msgid "Settings"
+msgstr "Settings"
+
+msgid "Public versions"
+msgstr "Public versions"
+
+msgid "Beta versions (on test)"
+msgstr "Beta versions (on test)"
+
+msgid "Alpha versions (unstable)"
+msgstr "Alpha versions (unstable)"
+
+msgid "Language"
+msgstr "Language"
+
+msgid "Help"
+msgstr "Help"
+
+msgid "About"
+msgstr "About"
+
+msgid "Install"
+msgstr "Install"
+
+msgid "Next"
+msgstr "Next"
+
+msgid "Abord"
+msgstr "Abort"
+
+# User messages ---------------------------------------------------------------
+msgid "Updates name"
+msgstr "Updates name"
+
+msgid "Updates size"
+msgstr "Updates size"
+
+msgid "Total download size ( %.3f Mo )"
+msgstr "Total download size ( %.3f MB )"
+
+msgid "Please wait ..."
+msgstr "Please wait ..."
+
+msgid "This can take some minutes."
+msgstr "This can take some minutes."
+
+msgid "No Internet connection available !"
+msgstr "No Internet connection available !"
+
+msgid "Sorry, the server is currently in maintenance."
+msgstr "Sorry, the server is currently in maintenance."
+
+msgid "Your Tuxdroid is up to date !"
+msgstr "Your Tux Droid is up to date !"
+
+msgid "Get your Tuxdroid up to date !"
+msgstr "Get your Tux Droid up to date !"
+
+msgid "Click Install to start the updating."
+msgstr "Click Install to start the updating."
+
+msgid "Removed : "
+msgstr "Removed : "
+
+msgid "New : "
+msgstr "New : "
+
+msgid "Updated : "
+msgstr "Updated : "
+
+msgid "Downloading"
+msgstr "Downloading"
+
+msgid "Sorry, the server is currently in maintenance. Click Next"
+msgstr "Sorry, the server is currently in maintenance. Click Next"
+
+msgid "Error while downloading the file"
+msgstr "Error while downloading the file"
+
+msgid "Download complete. Click Next"
+msgstr "Downloading complete. Click Next"
+
+msgid "Downloading aborded"
+msgstr "Downloading aborted"
+
+msgid "Abording the download ..."
+msgstr "Aborting the download ..."
+
+msgid "Kill troublesome tasks"
+msgstr "Kill troublesome tasks"
+
+msgid "Uninstalling (This can take few minutes) ..."
+msgstr "Uninstalling (This can take a few minutes) ..."
+
+msgid "Deleting ..."
+msgstr "Deleting ..."
+
+msgid "Installing (This can take few minutes) ..."
+msgstr "Installing (This can take a few minutes) ..."
+
+msgid "Copying ..."
+msgstr "Copying ..."
+
+msgid "Delete the temporary files"
+msgstr "Delete the temporary files"
+
+msgid "Update the data base of installed packages"
+msgstr "Update the database of installed packages"
+
+msgid "Reload the Tuxdroid system"
+msgstr "Reloading the Tux Droid system"
+
+msgid "The installation has been finished !"
+msgstr "The installation has been finished !"
+
+msgid "Tuxdroid Software Updater (AUTOMATIC MODE)"
+msgstr "Tux Droid Software Updater (AUTOMATIC MODE)"
+
+msgid "TTSLanguageName"
+msgstr "Norwegian"
+
+msgid "Audio card trouble"
+msgstr ""
+"A problem was detected with your audio cards configuration !\n"
+"Please change your default audio card to \"TuxDroid-Audio\" instead of \"TuxDroid-TTS\" !\n"
+"\n"
+"The \"Audio devices\" window will be opened after closing this window."
+
Property changes on: software_suite_v2/software/tuxdroid_software_updater/trunk/locale/no/LC_MESSAGES/default.po
___________________________________________________________________
Name: svn:keywords
+ Id
Added: software_suite_v2/software/tuxdroid_software_updater/trunk/locale/pt/LC_MESSAGES/default.mo
===================================================================
(Binary files differ)
Property changes on: software_suite_v2/software/tuxdroid_software_updater/trunk/locale/pt/LC_MESSAGES/default.mo
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Name: svn:keywords
+ Id
Added: software_suite_v2/software/tuxdroid_software_updater/trunk/locale/pt/LC_MESSAGES/default.po
===================================================================
--- software_suite_v2/software/tuxdroid_software_updater/trunk/locale/pt/LC_MESSAGES/default.po (rev 0)
+++ software_suite_v2/software/tuxdroid_software_updater/trunk/locale/pt/LC_MESSAGES/default.po 2009-04-21 11:41:05 UTC (rev 4573)
@@ -0,0 +1,169 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"POT-Creation-Date: 2008-11-02 12:00\n"
+"PO-Revision-Date: 2008-12-11 09:06+0100\n"
+"Last-Translator: Rémi Jocaille <rem...@c2...>\n"
+"Language-Team: French <rem...@c2...>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-Language: Portuguese\n"
+"X-Poedit-Country: PORTUGUESE\n"
+
+# About Dialog ---------------------------------------------------------------
+msgid "About Tuxdroid Software Updater"
+msgstr "About Tux Droid Software Updater"
+
+msgid "About text"
+msgstr ""
+"Tux Droid Software Updater\n"
+"\n"
+"Version 0.0.1\n"
+"\n"
+"Copyright (C) 2008 Kysoh <rem...@c2...>"
+
+msgid "OK"
+msgstr "OK"
+
+# Main GUI ---------------------------------------------------------------
+msgid "Tuxdroid Software Updater"
+msgstr "Tux Droid Software Updater"
+
+msgid "Files"
+msgstr "Files"
+
+msgid "Check for updates"
+msgstr "Check for updates"
+
+msgid "Quit"
+msgstr "Quit"
+
+msgid "Settings"
+msgstr "Settings"
+
+msgid "Public versions"
+msgstr "Public versions"
+
+msgid "Beta versions (on test)"
+msgstr "Beta versions (on test)"
+
+msgid "Alpha versions (unstable)"
+msgstr "Alpha versions (unstable)"
+
+msgid "Language"
+msgstr "Language"
+
+msgid "Help"
+msgstr "Help"
+
+msgid "About"
+msgstr "About"
+
+msgid "Install"
+msgstr "Install"
+
+msgid "Next"
+msgstr "Next"
+
+msgid "Abord"
+msgstr "Abort"
+
+# User messages ---------------------------------------------------------------
+msgid "Updates name"
+msgstr "Updates name"
+
+msgid "Updates size"
+msgstr "Updates size"
+
+msgid "Total download size ( %.3f Mo )"
+msgstr "Total download size ( %.3f MB )"
+
+msgid "Please wait ..."
+msgstr "Please wait ..."
+
+msgid "This can take some minutes."
+msgstr "This can take some minutes."
+
+msgid "No Internet connection available !"
+msgstr "No Internet connection available !"
+
+msgid "Sorry, the server is currently in maintenance."
+msgstr "Sorry, the server is currently in maintenance."
+
+msgid "Your Tuxdroid is up to date !"
+msgstr "Your Tux Droid is up to date !"
+
+msgid "Get your Tuxdroid up to date !"
+msgstr "Get your Tux Droid up to date !"
+
+msgid "Click Install to start the updating."
+msgstr "Click Install to start the updating."
+
+msgid "Removed : "
+msgstr "Removed : "
+
+msgid "New : "
+msgstr "New : "
+
+msgid "Updated : "
+msgstr "Updated : "
+
+msgid "Downloading"
+msgstr "Downloading"
+
+msgid "Sorry, the server is currently in maintenance. Click Next"
+msgstr "Sorry, the server is currently in maintenance. Click Next"
+
+msgid "Error while downloading the file"
+msgstr "Error while downloading the file"
+
+msgid "Download complete. Click Next"
+msgstr "Downloading complete. Click Next"
+
+msgid "Downloading aborded"
+msgstr "Downloading aborted"
+
+msgid "Abording the download ..."
+msgstr "Aborting the download ..."
+
+msgid "Kill troublesome tasks"
+msgstr "Kill troublesome tasks"
+
+msgid "Uninstalling (This can take few minutes) ..."
+msgstr "Uninstalling (This can take a few minutes) ..."
+
+msgid "Deleting ..."
+msgstr "Deleting ..."
+
+msgid "Installing (This can take few minutes) ..."
+msgstr "Installing (This can take a few minutes) ..."
+
+msgid "Copying ..."
+msgstr "Copying ..."
+
+msgid "Delete the temporary files"
+msgstr "Delete the temporary files"
+
+msgid "Update the data base of installed packages"
+msgstr "Update the database of installed packages"
+
+msgid "Reload the Tuxdroid system"
+msgstr "Reloading the Tux Droid system"
+
+msgid "The installation has been finished !"
+msgstr "The installation has been finished !"
+
+msgid "Tuxdroid Software Updater (AUTOMATIC MODE)"
+msgstr "Tux Droid Software Updater (AUTOMATIC MODE)"
+
+msgid "TTSLanguageName"
+msgstr "Portuguese"
+
+msgid "Audio card trouble"
+msgstr ""
+"A problem was detected with your audio cards configuration !\n"
+"Please change your default audio card to \"TuxDroid-Audio\" instead of \"TuxDroid-TTS\" !\n"
+"\n"
+"The \"Audio devices\" window will be opened after closing this window."
+
Property changes on: software_suite_v2/software/tuxdroid_software_updater/trunk/locale/pt/LC_MESSAGES/default.po
___________________________________________________________________
Name: svn:keywords
+ Id
Added: software_suite_v2/software/tuxdroid_software_updater/trunk/locale/sv/LC_MESSAGES/default.mo
===================================================================
(Binary files differ)
Property changes on: software_suite_v2/software/tuxdroid_software_updater/trunk/locale/sv/LC_MESSAGES/default.mo
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Name: svn:keywords
+ Id
Added: software_suite_v2/software/tuxdroid_software_updater/trunk/locale/sv/LC_MESSAGES/default.po
===================================================================
--- software_suite_v2/software/tuxdroid_software_updater/trunk/locale/sv/LC_MESSAGES/default.po (rev 0)
+++ software_suite_v2/software/tuxdroid_software_updater/trunk/locale/sv/LC_MESSAGES/default.po 2009-04-21 11:41:05 UTC (rev 4573)
@@ -0,0 +1,169 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"POT-Creation-Date: 2008-11-02 12:00\n"
+"PO-Revision-Date: 2008-12-11 09:06+0100\n"
+"Last-Translator: Rémi Jocaille <rem...@c2...>\n"
+"Language-Team: French <rem...@c2...>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-Language: Swedish\n"
+"X-Poedit-Country: SWEDISH\n"
+
+# About Dialog ---------------------------------------------------------------
+msgid "About Tuxdroid Software Updater"
+msgstr "About Tux Droid Software Updater"
+
+msgid "About text"
+msgstr ""
+"Tux Droid Software Updater\n"
+"\n"
+"Version 0.0.1\n"
+"\n"
+"Copyright (C) 2008 Kysoh <rem...@c2...>"
+
+msgid "OK"
+msgstr "OK"
+
+# Main GUI ---------------------------------------------------------------
+msgid "Tuxdroid Software Updater"
+msgstr "Tux Droid Software Updater"
+
+msgid "Files"
+msgstr "Files"
+
+msgid "Check for updates"
+msgstr "Check for updates"
+
+msgid "Quit"
+msgstr "Quit"
+
+msgid "Settings"
+msgstr "Settings"
+
+msgid "Public versions"
+msgstr "Public versions"
+
+msgid "Beta versions (on test)"
+msgstr "Beta versions (on test)"
+
+msgid "Alpha versions (unstable)"
+msgstr "Alpha versions (unstable)"
+
+msgid "Language"
+msgstr "Language"
+
+msgid "Help"
+msgstr "Help"
+
+msgid "About"
+msgstr "About"
+
+msgid "Install"
+msgstr "Install"
+
+msgid "Next"
+msgstr "Next"
+
+msgid "Abord"
+msgstr "Abort"
+
+# User messages ---------------------------------------------------------------
+msgid "Updates name"
+msgstr "Updates name"
+
+msgid "Updates size"
+msgstr "Updates size"
+
+msgid "Total download size ( %.3f Mo )"
+msgstr "Total download size ( %.3f MB )"
+
+msgid "Please wait ..."
+msgstr "Please wait ..."
+
+msgid "This can take some minutes."
+msgstr "This can take some minutes."
+
+msgid "No Internet connection available !"
+msgstr "No Internet connection available !"
+
+msgid "Sorry, the server is currently in maintenance."
+msgstr "Sorry, the server is currently in maintenance."
+
+msgid "Your Tuxdroid is up to date !"
+msgstr "Your Tux Droid is up to date !"
+
+msgid "Get your Tuxdroid up to date !"
+msgstr "Get your Tux Droid up to date !"
+
+msgid "Click Install to start the updating."
+msgstr "Click Install to start the updating."
+
+msgid "Removed : "
+msgstr "Removed : "
+
+msgid "New : "
+msgstr "New : "
+
+msgid "Updated : "
+msgstr "Updated : "
+
+msgid "Downloading"
+msgstr "Downloading"
+
+msgid "Sorry, the server is currently in maintenance. Click Next"
+msgstr "Sorry, the server is currently in maintenance. Click Next"
+
+msgid "Error while downloading the file"
+msgstr "Error while downloading the file"
+
+msgid "Download complete. Click Next"
+msgstr "Downloading complete. Click Next"
+
+msgid "Downloading aborded"
+msgstr "Downloading aborted"
+
+msgid "Abording the download ..."
+msgstr "Aborting the download ..."
+
+msgid "Kill troublesome tasks"
+msgstr "Kill troublesome tasks"
+
+msgid "Uninstalling (This can take few minutes) ..."
+msgstr "Uninstalling (This can take a few minutes) ..."
+
+msgid "Deleting ..."
+msgstr "Deleting ..."
+
+msgid "Installing (This can take few minutes) ..."
+msgstr "Installing (This can take a few minutes) ..."
+
+msgid "Copying ..."
+msgstr "Copying ..."
+
+msgid "Delete the temporary files"
+msgstr "Delete the temporary files"
+
+msgid "Update the data base of installed packages"
+msgstr "Update the database of installed packages"
+
+msgid "Reload the Tuxdroid system"
+msgstr "Reloading the Tux Droid system"
+
+msgid "The installation has been finished !"
+msgstr "The installation has been finished !"
+
+msgid "Tuxdroid Software Updater (AUTOMATIC MODE)"
+msgstr "Tux Droid Software Updater (AUTOMATIC MODE)"
+
+msgid "TTSLanguageName"
+msgstr "Swedish"
+
+msgid "Audio card trouble"
+msgstr ""
+"A problem was detected with your audio cards configuration !\n"
+"Please change your default audio card to \"TuxDroid-Audio\" instead of \"TuxDroid-TTS\" !\n"
+"\n"
+"The \"Audio devices\" window will be opened after closing this window."
+
Property changes on: software_suite_v2/software/tuxdroid_software_updater/trunk/locale/sv/LC_MESSAGES/default.po
___________________________________________________________________
Name: svn:keywords
+ Id
|
|
From: remi <c2m...@c2...> - 2009-04-21 10:28:08
|
Author: remi
Date: 2009-04-21 12:27:47 +0200 (Tue, 21 Apr 2009)
New Revision: 4572
Modified:
softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/gadgets/Gadget.py
Log:
* updated methods to update the gadgets parameters of the configured gadgets
Modified: softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/gadgets/Gadget.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/gadgets/Gadget.py 2009-04-21 10:27:28 UTC (rev 4571)
+++ softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/gadgets/Gadget.py 2009-04-21 10:27:47 UTC (rev 4572)
@@ -484,11 +484,12 @@
# --------------------------------------------------------------------------
# Update the parameters of the configured gadget.
# --------------------------------------------------------------------------
- def updateParameters(self, parameters = {}):
+ def updateParameters(self, parameters = {}, hiddenParameters = []):
"""Update the parameters of the configured gadget.
@param parameters: Parameters of the gadget as dictionary.
if no parameter is defined the default ones are set.
if a parameter is wrong or missing the default one is set.
+ @param hiddenParameters: Hidden parameters list.
@return: The success of the command.
* This method only work with a configured gadget.
"""
@@ -501,9 +502,13 @@
args += "%s=%s|" % (key, parameters[key])
if len(args) > 0:
args = args[:-1]
+ hParams = ""
+ for h in hiddenParameters:
+ hParams += "%s|" % h
argsToSend = {
'uuid' : self.__description.getUuid(),
'parameters' : args,
+ 'hiddenParameters' : hParams,
}
cmd = "gadget_framework/update_configuration_parameters?"
return self._sendCommandBooleanResult(cmd, argsToSend)
|
|
From: remi <c2m...@c2...> - 2009-04-21 10:27:40
|
Author: remi
Date: 2009-04-21 12:27:28 +0200 (Tue, 21 Apr 2009)
New Revision: 4571
Modified:
softwares_suite_v3/kysoh/tuxware/server/trunk/resources/01_robot_system/resourceGadgetFramework.py
softwares_suite_v3/kysoh/tuxware/server/trunk/util/applicationserver/gadget/ConfiguredGadget.py
softwares_suite_v3/kysoh/tuxware/server/trunk/util/applicationserver/gadget/Gadget.py
Log:
* updated methods to update the gadgets parameters of the configured gadgets
Modified: softwares_suite_v3/kysoh/tuxware/server/trunk/resources/01_robot_system/resourceGadgetFramework.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/server/trunk/resources/01_robot_system/resourceGadgetFramework.py 2009-04-21 09:51:21 UTC (rev 4570)
+++ softwares_suite_v3/kysoh/tuxware/server/trunk/resources/01_robot_system/resourceGadgetFramework.py 2009-04-21 10:27:28 UTC (rev 4571)
@@ -353,17 +353,19 @@
else:
return False
- def updateConfigurationParameters(self, gadgetUuid, parameters):
+ def updateConfigurationParameters(self, gadgetUuid, parameters,
+ hiddenParameters):
"""Update the parameters of a configured gadget.
@param gadgetUuid: Gadget uuid.
@param parameters: Parameters.
+ @param hiddenParameters: Hidden parameters list.
@return: The success.
"""
gadget = self.__gadgetsContainer.getGadgetByUuid(gadgetUuid)
if gadget != None:
if not gadget.isConfiguration():
return False
- gadget.updateParameters(parameters)
+ gadget.updateParameters(parameters, hiddenParameters)
self.__gadgetsContainer.storeConfiguration(gadget)
self.__publishEvents(True, ST_NAME_FW_CONFIGURATIONS_LOADED,
["True",])
@@ -896,6 +898,7 @@
self.parametersDict = {
'uuid' : 'string',
'parameters' : 'string',
+ 'hiddenParameters' : 'string'
}
self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
self.exclusiveExecution = False
@@ -913,8 +916,9 @@
param = paramStruct.split("=")
if len(param) == 2:
params[param[0]] = param[1]
+ hiddenParameters = parameters['hiddenParameters'].split("|")
if not resourceGadgetFramework.updateConfigurationParameters(uuid,
- params):
+ params, hiddenParameters):
contentStruct['root']['result'] = getStrError(E_TDREST_FAILED)
return headersStruct, contentStruct
Modified: softwares_suite_v3/kysoh/tuxware/server/trunk/util/applicationserver/gadget/ConfiguredGadget.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/server/trunk/util/applicationserver/gadget/ConfiguredGadget.py 2009-04-21 09:51:21 UTC (rev 4570)
+++ softwares_suite_v3/kysoh/tuxware/server/trunk/util/applicationserver/gadget/ConfiguredGadget.py 2009-04-21 10:27:28 UTC (rev 4571)
@@ -12,7 +12,7 @@
except:
from md5 import md5
-from Gadget import Gadget
+from Gadget import *
# ------------------------------------------------------------------------------
# ConfiguredGadget class.
@@ -51,7 +51,7 @@
if key == parameter.getName():
parameter.setDefaultValue(configuration['parameters'][key])
if parameter.getName() in configuration['hiddenParameters']:
- parameter.setVisible(False)
+ parameter.setVisible("false")
# Set the gadget description
self.getDescription().setUuid(configuration['description']['uuid'])
self.getDescription().setName(configuration['description']['name'])
@@ -80,15 +80,22 @@
# --------------------------------------------------------------------------
# Update the parameter.
# --------------------------------------------------------------------------
- def updateParameters(self, parameters):
+ def updateParameters(self, parameters, hiddenParameters = []):
"""Update the parameter.
@param parameters: Gadget parameters.
+ @param hiddenParameters: Hidden parameters list.
"""
self.__configuration['parameters'] = parameters
+ self.__configuration['hiddenParameters'] = hiddenParameters
for parameter in self.getParameters():
for key in parameters.keys():
if key == parameter.getName():
parameter.setDefaultValue(parameters[key])
+ if parameter.getName() not in INTERNAL_PARAMETERS_LIST:
+ if parameter.getName() in hiddenParameters:
+ parameter.setVisible("false")
+ else:
+ parameter.setVisible("true")
# --------------------------------------------------------------------------
# Update the name.
Modified: softwares_suite_v3/kysoh/tuxware/server/trunk/util/applicationserver/gadget/Gadget.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/server/trunk/util/applicationserver/gadget/Gadget.py 2009-04-21 09:51:21 UTC (rev 4570)
+++ softwares_suite_v3/kysoh/tuxware/server/trunk/util/applicationserver/gadget/Gadget.py 2009-04-21 10:27:28 UTC (rev 4571)
@@ -21,6 +21,8 @@
# Default list of the supported language.
SUPPORTED_LANGUAGES_LIST = ["en", "fr", "nl", "es", "it", "pt", "ar", "da",
"de", "no", "sv",]
+# Internal parameters list
+INTERNAL_PARAMETERS_LIST = ["traces", "language", "country", "locutor", "pitch"]
# ------------------------------------------------------------------------------
# Gadget class.
|
|
From: remi <c2m...@c2...> - 2009-04-21 09:51:34
|
Author: remi
Date: 2009-04-21 11:51:21 +0200 (Tue, 21 Apr 2009)
New Revision: 4570
Modified:
softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/gadgets/Gadget.py
Log:
* hidden parameters list is now passed to the gadget configurations
Modified: softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/gadgets/Gadget.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/gadgets/Gadget.py 2009-04-21 09:51:01 UTC (rev 4569)
+++ softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/gadgets/Gadget.py 2009-04-21 09:51:21 UTC (rev 4570)
@@ -427,13 +427,15 @@
# --------------------------------------------------------------------------
# Create a configured gadget from this gadget.
# --------------------------------------------------------------------------
- def createConfiguration(self, name = None, parameters = {}):
+ def createConfiguration(self, name = None, parameters = {},
+ hiddenParameters = []):
"""Create a configured gadget from this gadget.
@param name: Name of the configuration.
if name is None, the gadget name is set.
@param parameters: Parameters of the gadget as dictionary.
if no parameter is defined the default ones are set.
if a parameter is wrong or missing the default one is set.
+ @param hiddenParameters: Hidden parameters list.
@return: The success of the configuration creation.
"""
if name == None:
@@ -447,10 +449,14 @@
args += "%s=%s|" % (key, parameters[key])
if len(args) > 0:
args = args[:-1]
+ hParams = ""
+ for h in hiddenParameters:
+ hParams += "%s|" % h
argsToSend = {
'uuid' : self.__description.getUuid(),
'name' : name,
'parameters' : args,
+ 'hiddenParameters' : hParams,
}
cmd = "gadget_framework/create_configuration?"
return self._sendCommandBooleanResult(cmd, argsToSend)
|
|
From: remi <c2m...@c2...> - 2009-04-21 09:51:20
|
Author: remi
Date: 2009-04-21 11:51:01 +0200 (Tue, 21 Apr 2009)
New Revision: 4569
Modified:
softwares_suite_v3/kysoh/tuxware/server/trunk/resources/01_robot_system/resourceGadgetFramework.py
softwares_suite_v3/kysoh/tuxware/server/trunk/util/applicationserver/gadget/ConfiguredGadget.py
Log:
* hidden parameters list is now passed to the gadget configurations
Modified: softwares_suite_v3/kysoh/tuxware/server/trunk/resources/01_robot_system/resourceGadgetFramework.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/server/trunk/resources/01_robot_system/resourceGadgetFramework.py 2009-04-21 09:48:41 UTC (rev 4568)
+++ softwares_suite_v3/kysoh/tuxware/server/trunk/resources/01_robot_system/resourceGadgetFramework.py 2009-04-21 09:51:01 UTC (rev 4569)
@@ -317,17 +317,19 @@
return True
return False
- def createConfiguration(self, gadgetUuid, parameters, name):
+ def createConfiguration(self, gadgetUuid, parameters, name,
+ hiddenParameters):
"""Create a configuration of a gadget.
@param gadgetUuid: Gadget uuid.
@param parameters: Parameters.
@param name: Name of the configured gadget.
+ @param hiddenParameters: Hidden parameters list.
@return: The success.
"""
gadget = self.__gadgetsContainer.getGadgetByUuid(gadgetUuid)
if gadget != None:
configuredGadget = ConfiguredGadget.createConfiguredGadget(gadget,
- parameters, name)
+ parameters, name, hiddenParameters)
self.__gadgetsContainer.insertConfiguration(configuredGadget)
return True
else:
@@ -829,6 +831,7 @@
'uuid' : 'string',
'parameters' : 'string',
'name' : 'string',
+ 'hiddenParameters' : 'string'
}
self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
self.exclusiveExecution = False
@@ -846,9 +849,10 @@
param = paramStruct.split("=")
if len(param) == 2:
params[param[0]] = param[1]
+ hiddenParameters = parameters['hiddenParameters'].split("|")
name = parameters['name']
if not resourceGadgetFramework.createConfiguration(uuid, params,
- name):
+ name, hiddenParameters):
contentStruct['root']['result'] = getStrError(E_TDREST_FAILED)
return headersStruct, contentStruct
Modified: softwares_suite_v3/kysoh/tuxware/server/trunk/util/applicationserver/gadget/ConfiguredGadget.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/server/trunk/util/applicationserver/gadget/ConfiguredGadget.py 2009-04-21 09:48:41 UTC (rev 4568)
+++ softwares_suite_v3/kysoh/tuxware/server/trunk/util/applicationserver/gadget/ConfiguredGadget.py 2009-04-21 09:51:01 UTC (rev 4569)
@@ -50,6 +50,8 @@
for key in configuration['parameters'].keys():
if key == parameter.getName():
parameter.setDefaultValue(configuration['parameters'][key])
+ if parameter.getName() in configuration['hiddenParameters']:
+ parameter.setVisible(False)
# Set the gadget description
self.getDescription().setUuid(configuration['description']['uuid'])
self.getDescription().setName(configuration['description']['name'])
@@ -149,11 +151,12 @@
# --------------------------------------------------------------------------
# Create a configured gadget.
# --------------------------------------------------------------------------
- def createConfiguredGadget(gadget, parameters, name):
+ def createConfiguredGadget(gadget, parameters, name, hiddenParameters = []):
"""Create a configured gadget.
@param gadget: Gadget parent.
@param parameters: Gadget parameters.
@param name: Name of the configured gadget.
+ @param hiddenParameters: Hidden parameters list.
@return: A new ConfiguredGadget object.
"""
parent = gadget.getContainer()
@@ -172,6 +175,7 @@
'uuid' : gadgetUuid,
},
'parameters' : parameters,
+ 'hiddenParameters' : hiddenParameters,
'command' : gadget.getDefaultRunCommandName(),
'originalGadgetUuid' : originalGadgetUuid,
}
@@ -227,6 +231,8 @@
finally:
f.close()
try:
+ if not configuration.has_key('hiddenParameters'):
+ configuration['hiddenParameters'] = []
# Get the original gadget
originalGadgetUuid = configuration['originalGadgetUuid']
gadgetFound = False
|
|
From: remi <c2m...@c2...> - 2009-04-21 09:49:04
|
Author: remi
Date: 2009-04-21 11:48:41 +0200 (Tue, 21 Apr 2009)
New Revision: 4568
Modified:
softwares_suite_v3/kysoh/tuxware/server/trunk/data/xsl/web_gadget.xsl
Log:
* removed a popup
Modified: softwares_suite_v3/kysoh/tuxware/server/trunk/data/xsl/web_gadget.xsl
===================================================================
--- softwares_suite_v3/kysoh/tuxware/server/trunk/data/xsl/web_gadget.xsl 2009-04-21 08:53:34 UTC (rev 4567)
+++ softwares_suite_v3/kysoh/tuxware/server/trunk/data/xsl/web_gadget.xsl 2009-04-21 09:48:41 UTC (rev 4568)
@@ -58,7 +58,6 @@
var url = "/gadget_framework/start_gadget_by_uuid?command=";
url += command + "&uuid=" + uuid;
url += "¶meters=" + parametersString;
- alert(url);
url += "&rndTag=" + Math.random();
document.getElementById("fake_image").src = url;
}
|
|
From: remi <c2m...@c2...> - 2009-04-21 08:53:48
|
Author: remi
Date: 2009-04-21 10:53:34 +0200 (Tue, 21 Apr 2009)
New Revision: 4567
Modified:
softwares_suite_v3/kysoh/tuxware/server/trunk/data/css/gadget.css
softwares_suite_v3/kysoh/tuxware/server/trunk/data/xsl/web_gadget.xsl
softwares_suite_v3/kysoh/tuxware/server/trunk/resources/01_robot_system/resourceGadgetFramework.py
softwares_suite_v3/kysoh/tuxware/server/trunk/util/applicationserver/gadget/WebGadgetTools.py
Log:
* improved web gadgets parameters
Modified: softwares_suite_v3/kysoh/tuxware/server/trunk/data/css/gadget.css
===================================================================
--- softwares_suite_v3/kysoh/tuxware/server/trunk/data/css/gadget.css 2009-04-21 08:52:46 UTC (rev 4566)
+++ softwares_suite_v3/kysoh/tuxware/server/trunk/data/css/gadget.css 2009-04-21 08:53:34 UTC (rev 4567)
@@ -67,4 +67,4 @@
border-style:solid;
border-width:0px;
width:177px;
-}
\ No newline at end of file
+}
Modified: softwares_suite_v3/kysoh/tuxware/server/trunk/data/xsl/web_gadget.xsl
===================================================================
--- softwares_suite_v3/kysoh/tuxware/server/trunk/data/xsl/web_gadget.xsl 2009-04-21 08:52:46 UTC (rev 4566)
+++ softwares_suite_v3/kysoh/tuxware/server/trunk/data/xsl/web_gadget.xsl 2009-04-21 08:53:34 UTC (rev 4567)
@@ -28,12 +28,19 @@
for (var i = 0; i < parameters.length; i++)
{
var param = parameters[i];
- if ((param.type != 'button') && (param.id != 'unvisible'))
+ if ((param.type != 'button') && (param.id != 'unvisible') && (param.name != ''))
{
if (param.type == 'checkbox')
{
parametersString += param.name + '=' + param.checked + '|';
}
+ else if (param.type == 'radio')
+ {
+ if (param.checked)
+ {
+ parametersString += param.name + '=' + param.value.replace('&', '&&') + '|';
+ }
+ }
else
{
parametersString += param.name + '=' + param.value.replace('&', '&&') + '|';
@@ -51,6 +58,7 @@
var url = "/gadget_framework/start_gadget_by_uuid?command=";
url += command + "&uuid=" + uuid;
url += "¶meters=" + parametersString;
+ alert(url);
url += "&rndTag=" + Math.random();
document.getElementById("fake_image").src = url;
}
@@ -133,11 +141,11 @@
<tr bgcolor="#D7D8DA">
<td align="right" width="180">
<span class="paramName">
- <xsl:value-of select="description"/> :
+ <xsl:value-of select="description"/>:
</span>
</td>
<td>
- <!-- Parameter is "string" then show it as "input" -->
+ <!-- Parameter is "string" then show it as "text" -->
<xsl:if test="type = 'string'">
<xsl:element name="input">
<xsl:attribute name="class">text</xsl:attribute>
@@ -151,6 +159,67 @@
<xsl:attribute name="size">20</xsl:attribute>
</xsl:element>
</xsl:if>
+ <!-- Parameter is "file" then show it as "text" -->
+ <xsl:if test="type = 'file'">
+ <xsl:element name="input">
+ <xsl:attribute name="class">text</xsl:attribute>
+ <xsl:attribute name="type">text</xsl:attribute>
+ <xsl:attribute name="name">
+ <xsl:value-of select="name"/>
+ </xsl:attribute>
+ <xsl:attribute name="value">
+ <xsl:value-of select="default_value"/>
+ </xsl:attribute>
+ <xsl:attribute name="size">20</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <!-- Parameter is "directory" then show it as "text" -->
+ <xsl:if test="type = 'directory'">
+ <xsl:element name="input">
+ <xsl:attribute name="class">text</xsl:attribute>
+ <xsl:attribute name="type">text</xsl:attribute>
+ <xsl:attribute name="name">
+ <xsl:value-of select="name"/>
+ </xsl:attribute>
+ <xsl:attribute name="value">
+ <xsl:value-of select="default_value"/>
+ </xsl:attribute>
+ <xsl:attribute name="size">20</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <!-- Parameter is "increment" then show it as "text" -->
+ <xsl:if test="type = 'increment'">
+ <xsl:element name="input">
+ <xsl:attribute name="class">text</xsl:attribute>
+ <xsl:attribute name="type">text</xsl:attribute>
+ <xsl:attribute name="name">
+ <xsl:value-of select="name"/>
+ </xsl:attribute>
+ <xsl:attribute name="value">
+ <xsl:value-of select="default_value"/>
+ </xsl:attribute>
+ <xsl:attribute name="size">20</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <!-- Parameter is "booleans" then show it as "radio buttons" -->
+ <xsl:if test="type = 'booleans'">
+ <xsl:for-each select="enum_values/*">
+ <xsl:element name="input">
+ <xsl:attribute name="type">radio</xsl:attribute>
+ <xsl:attribute name="class">checkbox</xsl:attribute>
+ <xsl:attribute name="name">
+ <xsl:value-of select="../../name"/>
+ </xsl:attribute>
+ <xsl:attribute name="value">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ <xsl:if test=". = ../../default_value">
+ <xsl:attribute name="checked">true</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:value-of select="."/><xsl:element name="br"/>
+ </xsl:for-each>
+ </xsl:if>
<!-- Parameter is "integer" then show it as "input" -->
<xsl:if test="type = 'integer'">
<xsl:element name="input">
@@ -173,7 +242,9 @@
<xsl:attribute name="name">
<xsl:value-of select="name"/>
</xsl:attribute>
- <xsl:attribute name="value">********</xsl:attribute>
+ <xsl:attribute name="value">
+ <xsl:value-of select="default_value"/>
+ </xsl:attribute>
<xsl:attribute name="size">20</xsl:attribute>
</xsl:element>
</xsl:if>
@@ -192,7 +263,7 @@
</xsl:if>
</xsl:element>
</xsl:if>
- <!-- Parameter is "enum" then show it as "input" -->
+ <!-- Parameter is "enum" then show it as "combobox" -->
<xsl:if test="type = 'enum'">
<xsl:element name="select">
<xsl:attribute name="class">select</xsl:attribute>
Modified: softwares_suite_v3/kysoh/tuxware/server/trunk/resources/01_robot_system/resourceGadgetFramework.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/server/trunk/resources/01_robot_system/resourceGadgetFramework.py 2009-04-21 08:52:46 UTC (rev 4566)
+++ softwares_suite_v3/kysoh/tuxware/server/trunk/resources/01_robot_system/resourceGadgetFramework.py 2009-04-21 08:53:34 UTC (rev 4567)
@@ -511,7 +511,7 @@
d_name = "data|%.3d" % i
structure = WebGadgetTools.generateWebGadgetStructure(gadget,
'/gadget_framework/web_gadget?',
- gadget.getDefaultRunCommandName(), {})
+ gadget.getDefaultRunCommandName(), {}, [])
structure['commands'] = {}
for j, command in enumerate(gadget.getCommands()):
c_name = "command_%.3d" % j
@@ -548,7 +548,7 @@
d_name = "data|%d" % i
structure = WebGadgetTools.generateWebGadgetStructure(gadget,
'/gadget_framework/web_gadget?',
- gadget.getDefaultRunCommandName(), {})
+ gadget.getDefaultRunCommandName(), {}, [])
#del structure['command']
structure['commands'] = {}
for j, command in enumerate(gadget.getCommands()):
@@ -573,6 +573,7 @@
'uuid' : 'string',
'command' : 'string',
'parameters' : 'string',
+ 'hiddenlist' : 'string',
}
self.minimalUserLevel = TDS_CLIENT_LEVEL_ANONYMOUS
self.exclusiveExecution = False
@@ -591,13 +592,14 @@
param = paramStruct.split("=")
if len(param) == 2:
params[param[0]] = param[1]
+ hList = parameters['hiddenlist'].split("|")
uuid = parameters['uuid']
gadget = resourceGadgetFramework.getGadgetsContainer().getGadgetByUuid(uuid)
structure = None
if gadget != None:
structure = WebGadgetTools.generateWebGadgetStructure(gadget,
- '/gadget_framework/web_gadget?',
- parameters['command'], params)
+ '/gadget_framework/web_gadget?', parameters['command'], params,
+ hList)
if structure == None:
contentStruct['root']['result'] = getStrError(E_TDREST_FAILED)
else:
Modified: softwares_suite_v3/kysoh/tuxware/server/trunk/util/applicationserver/gadget/WebGadgetTools.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/server/trunk/util/applicationserver/gadget/WebGadgetTools.py 2009-04-21 08:52:46 UTC (rev 4566)
+++ softwares_suite_v3/kysoh/tuxware/server/trunk/util/applicationserver/gadget/WebGadgetTools.py 2009-04-21 08:53:34 UTC (rev 4567)
@@ -41,12 +41,14 @@
# --------------------------------------------------------------------------
# Get the url for a web gadget.
# --------------------------------------------------------------------------
- def getWebGadgetUrl(gadget, baseUrl, command, parameters = {}):
+ def getWebGadgetUrl(gadget, baseUrl, command, parameters = {},
+ hiddenList = []):
"""Get the url for a web gadget.
@param gadget: Gadget object.
@param baseUrl: Base url of the web gadgets.
@param command: Gadget command.
@param parameters: Parameters dictionary.
+ @param hiddenList: List of parameters to hide.
@return: A web url.
"""
params = ""
@@ -54,20 +56,27 @@
if len(params) > 0:
params += "|"
params += "%s=%s" % (key, parameters[key])
+ hList = ""
+ for h in hiddenList:
+ if len(hList) > 0:
+ hList += "|"
+ hList += h
uuid = gadget.getDescription().getUuid()
- url = "%suuid=%s&command=%s¶meters=%s" % (baseUrl, uuid, command,
- params)
+ url = "%suuid=%s&command=%s¶meters=%s&hiddenlist=%s" % (baseUrl,
+ uuid, command, params, hList)
return url
# --------------------------------------------------------------------------
# Generate a web gadget structure.
# --------------------------------------------------------------------------
- def generateWebGadgetStructure(gadget, baseUrl, command, parameters = {}):
+ def generateWebGadgetStructure(gadget, baseUrl, command, parameters = {},
+ hiddenList = []):
"""Generate a web gadget structure.
@param gadget: Gadget object.
@param baseUrl: Base url.
@param command: Gadget command.
@param parameters: Parameters dictionary.
+ @param hiddenList: List of parameters to hide.
@return: A dictionary.
"""
structure = {}
@@ -124,13 +133,13 @@
# Serialize enum values
for key in structure['parameters']:
param = structure['parameters'][key]
- if param['type'] == 'enum':
+ if param['type'] in ['enum', 'booleans']:
values = param['enum_values'].split(",")
enums = {}
for i, value in enumerate(values):
dName = "enum_%.2d" % i
if value != '':
- enums[dName] = value
+ enums[dName] = value.strip()
param['enum_values'] = enums
# Insert the command
structure['command'] = command
@@ -141,19 +150,27 @@
param = structure['parameters'][sKey]
if param['name'] == key:
param['default_value'] = parameters[key]
- param['visible'] = 'false'
+ # Hide parameters from the hidden list
+ for sKey in structure['parameters']:
+ param = structure['parameters'][sKey]
+ if param['name'] in hiddenList:
+ param['visible'] = 'false'
return structure
# --------------------------------------------------------------------------
# Generate the code of a google gadget.
# --------------------------------------------------------------------------
- def generateGoogleGadgetCode(gadget, baseUrl, command, parameters = {}):
+ def generateGoogleGadgetCode(gadget, baseUrl, command, parameters = {},
+ hiddenList = []):
"""Generate the code of a google gadget.
@param baseUrl: Base url of the web gadgets.
@param command: Gadget command.
@param parameters: Parameters dictionary.
+ @param hiddenList: List of parameters to hide.
+ @return: The google gadget html code.
"""
- url = WebGadgetTools.getWebGadgetUrl(gadget, baseUrl, command, parameters)
+ url = WebGadgetTools.getWebGadgetUrl(gadget, baseUrl, command,
+ parameters, hiddenList)
if parameters.has_key('language'):
language = parameters['language']
else:
|
|
From: remi <c2m...@c2...> - 2009-04-21 08:52:55
|
Author: remi
Date: 2009-04-21 10:52:46 +0200 (Tue, 21 Apr 2009)
New Revision: 4566
Modified:
softwares_suite_v3/kysoh/tuxware/server/trunk/util/webviewer/WebViewer.py
Log:
* removed a print debug
Modified: softwares_suite_v3/kysoh/tuxware/server/trunk/util/webviewer/WebViewer.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/server/trunk/util/webviewer/WebViewer.py 2009-04-20 14:09:29 UTC (rev 4565)
+++ softwares_suite_v3/kysoh/tuxware/server/trunk/util/webviewer/WebViewer.py 2009-04-21 08:52:46 UTC (rev 4566)
@@ -120,7 +120,6 @@
'%d' % self.__height,
'%d' % self.__width,
]
- print cmd
self.__process = subprocess.Popen(
cmd,
stdin = subprocess.PIPE,
|
|
From: remi <c2m...@c2...> - 2009-04-20 14:09:43
|
Author: remi Date: 2009-04-20 16:09:29 +0200 (Mon, 20 Apr 2009) New Revision: 4565 Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/build.py softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/ softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/GadgetPackager.py softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/__init__.py softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/util/ softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/util/__init__.py softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/util/misc/ softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/util/misc/DirectoriesAndFilesTools.py softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/util/misc/__init__.py softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/util/misc/version.py softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/version.py Removed: softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/executables/GadgetHelper.py Modified: softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/executables/tuxdroid-gadget-skype.py softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/resources/gadget.xml Log: * adapted the gadget to perfectly run in the python framework. * bumped to 0.2 * fixed sound card selection on windows XP Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/build.py =================================================================== --- softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/build.py (rev 0) +++ softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/build.py 2009-04-20 14:09:29 UTC (rev 4565) @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- + +# Copyleft (C) 2009 C2ME Sa +# Remi Jocaille <rem...@c2...> +# Distributed under the terms of the GNU General Public License +# http://www.gnu.org/copyleft/gpl.html + +from builder.GadgetPackager import GadgetPackager + +if __name__ == "__main__": + GadgetPackager().createTgf("tuxdroid-gadget-skype.tgf") Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/build.py ___________________________________________________________________ Name: svn:keywords + Id Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/GadgetPackager.py =================================================================== --- softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/GadgetPackager.py (rev 0) +++ softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/GadgetPackager.py 2009-04-20 14:09:29 UTC (rev 4565) @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- + +import version +__author__ = version.author +__date__ = version.date +__version__ = version.version +__licence__ = version.licence +del version + +# Copyleft (C) 2009 C2ME Sa +# Remi Jocaille <rem...@c2...> +# Distributed under the terms of the GNU General Public License +# http://www.gnu.org/copyleft/gpl.html + +import os +from zipfile import * + +from util.misc.DirectoriesAndFilesTools import * + +# ------------------------------------------------------------------------------ +# Class to create a TGF file from the main directory of a python gadget project. +# ------------------------------------------------------------------------------ +class GadgetPackager(object): + """Class to create a TGF file from the main directory of a python gadget + project. + """ + + # -------------------------------------------------------------------------- + # Create a tgf file. + # -------------------------------------------------------------------------- + def createTgf(self, tgfFileName): + """Create a tgf file. + @param tgfFileName: Tux Gadget Format file name. + @return: The success of the file creation. + """ + self.__sourcePath = os.path.realpath("") + if not os.path.isdir(self.__sourcePath): + return False + if not os.path.isdir(os.path.join(self.__sourcePath, "executables")): + return False + if not os.path.isdir(os.path.join(self.__sourcePath, "resources")): + return False + # Get some paths + SRC_EXECUTABLES_PATH = os.path.join(self.__sourcePath, "executables") + SRC_RESOURCES_PATH = os.path.join(self.__sourcePath, "resources") + TMP_BUILD_PATH = os.path.join(self.__sourcePath, "tmp") + DEST_EXECUTABLES_PATH = os.path.join(TMP_BUILD_PATH, "executables") + DEST_RESOURCES_PATH = os.path.join(TMP_BUILD_PATH, "resources") + DEST_TGF_FILENAME = os.path.join(self.__sourcePath, tgfFileName) + # Create the temporary build path + MKDirsF(TMP_BUILD_PATH) + # Copy "executables" directory + CPDir(SRC_EXECUTABLES_PATH, DEST_EXECUTABLES_PATH) + # Copy "resources" directory + CPDir(SRC_RESOURCES_PATH, DEST_RESOURCES_PATH) + # Filtering the content of temporary path + RMWithFilters(TMP_BUILD_PATH, filters = ['.svn', '.pyc']) + # Create a zip file + directory = TMP_BUILD_PATH + last_cwd = os.getcwd() + os.chdir(TMP_BUILD_PATH) + zf = ZipFile(DEST_TGF_FILENAME, 'w', compression = ZIP_DEFLATED) + def walker(zip, directory, files, root = directory): + for file in files: + file = os.path.join(directory, file) + name = file[len(TMP_BUILD_PATH) + 1:] + if os.path.isfile(file): + zip.write(file, name, ZIP_DEFLATED) + elif os.path.isdir(file): + file = os.path.join(file, "") + name = os.path.join(name, "") + zip.writestr(name, name) + os.path.walk(TMP_BUILD_PATH, walker, zf) + zf.close() + os.chdir(os.path.abspath(last_cwd)) + # Remove the temporary directory + RMDirs(TMP_BUILD_PATH) + return True Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/GadgetPackager.py ___________________________________________________________________ Name: svn:keywords + Id Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/__init__.py =================================================================== Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/__init__.py ___________________________________________________________________ Name: svn:keywords + Id Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/util/__init__.py =================================================================== Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/util/__init__.py ___________________________________________________________________ Name: svn:keywords + Id Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/util/misc/DirectoriesAndFilesTools.py =================================================================== --- softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/util/misc/DirectoriesAndFilesTools.py (rev 0) +++ softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/util/misc/DirectoriesAndFilesTools.py 2009-04-20 14:09:29 UTC (rev 4565) @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- + +import version +__author__ = version.author +__date__ = version.date +__version__ = version.version +__licence__ = version.licence +del version + +# Copyleft (C) 2008 Acness World +# Remi Jocaille <rem...@c2...> +# Distributed under the terms of the GNU General Public License +# http://www.gnu.org/copyleft/gpl.html + +import os +import shutil + +if os.name == 'nt': + import win32con + import win32file + +# ============================================================================== +# Public functions +# ============================================================================== + +# ------------------------------------------------------------------------------ +# Force to create a directories tree if not exists. +# ------------------------------------------------------------------------------ +def MKDirs(path): + """Force to create a directories tree if not exists. + @param path: Directory path. + """ + if not os.path.isdir(path): + try: + os.makedirs(path) + except: + pass + +# ------------------------------------------------------------------------------ +# Force to create a directories tree after having deleted the old one. +# ------------------------------------------------------------------------------ +def MKDirsF(path): + """Force to create a directories tree after having deleted the old one. + @param path: Directory path. + """ + if os.path.isdir(path): + RMDirs(path) + os.makedirs(path) + +# ------------------------------------------------------------------------------ +# Remove directories and files recursively. +# ------------------------------------------------------------------------------ +def RMDirs(path): + """Remove directories and files recursively. + @param path: Path of the base directory. + """ + if not os.path.isdir(path): + return + for root, dirs, files in os.walk(path, topdown = False): + for d in dirs: + try: + os.removedirs(os.path.join(root, d)) + except: + pass + for f in files: + try: + if os.name == 'nt': + win32file.SetFileAttributesW(os.path.join(root, f), + win32con.FILE_ATTRIBUTE_NORMAL) + os.remove(os.path.join(root, f)) + except: + pass + if os.path.isdir(path): + try: + os.removedirs(path) + except: + pass + +# ------------------------------------------------------------------------------ +# Remove directories and files recursively with filters. +# ------------------------------------------------------------------------------ +def RMWithFilters(path, filters = ['.pyc', '.pyo']): + """Remove directories and files recursively with filters. + @param path: Path of the base directory. + @param filters: Filters as list. + """ + def checkFilter(name): + for filter in filters: + if name.lower().find(filter.lower()) == (len(name) - len(filter)): + return True + return False + + if not os.path.isdir(path): + return + + for root, dirs, files in os.walk(path, topdown = False): + for d in dirs: + if checkFilter(os.path.join(root, d)): + try: + RMDirs(os.path.join(root, d)) + except: + pass + for f in files: + if checkFilter(os.path.join(root, f)): + try: + if os.name == 'nt': + win32file.SetFileAttributesW(os.path.join(root, f), + win32con.FILE_ATTRIBUTE_NORMAL) + os.remove(os.path.join(root, f)) + except: + pass + +# ------------------------------------------------------------------------------ +# Remove a file. +# ------------------------------------------------------------------------------ +def RMFile(path): + """Remove a file. + @param path: File path. + """ + if os.path.isfile(path): + try: + if os.name == 'nt': + win32file.SetFileAttributesW(path, + win32con.FILE_ATTRIBUTE_NORMAL) + os.remove(path) + except: + pass + +# ------------------------------------------------------------------------------ +# Copy a directories tree to another directory. +# ------------------------------------------------------------------------------ +def CPDir(src, dest): + """Copy a directories tree to another directory. + @param src: Source path. + @param dest: Destination path. + """ + if not os.path.isdir(src): + return + if os.path.isdir(dest): + RMDirs(dest) + shutil.copytree(src, dest) + +# ------------------------------------------------------------------------------ +# Retrieve the OS temporary directory. +# ------------------------------------------------------------------------------ +def GetOSTMPDir(): + """Retrieve the OS temporary directory. + @return: The OS temporary directory. + """ + result = None + # On Windows + if os.name == 'nt': + result = os.environ.get('tmp') + if result == None: + result = os.environ.get('temp') + if result == None: + result = "c:\\windows\\temp" + # On linux + else: + result = "/tmp" + return result Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/util/misc/DirectoriesAndFilesTools.py ___________________________________________________________________ Name: svn:keywords + Id Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/util/misc/__init__.py =================================================================== Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/util/misc/__init__.py ___________________________________________________________________ Name: svn:keywords + Id Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/util/misc/version.py =================================================================== --- softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/util/misc/version.py (rev 0) +++ softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/util/misc/version.py 2009-04-20 14:09:29 UTC (rev 4565) @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- + +"""Version data for tuxisalive.lib.Util""" + +__author__ = "Remi Jocaille (rem...@c2...)" + +# Copyleft (C) 2008 C2ME Sa +# Remi Jocaille <rem...@c2...> +# Distributed under the terms of the GNU General Public License +# http://www.gnu.org/copyleft/gpl.html + +name = 'util.misc' +version = '0.0.1' +author = "Remi Jocaille (rem...@c2...)" + +description = "Utilities libraries." + +licence = "GPL" +date = "December 2008" Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/util/misc/version.py ___________________________________________________________________ Name: svn:keywords + Id Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/version.py =================================================================== --- softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/version.py (rev 0) +++ softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/version.py 2009-04-20 14:09:29 UTC (rev 4565) @@ -0,0 +1,9 @@ +# Copyleft (C) 2009 C2ME Sa +# Remi Jocaille <rem...@c2...> +# Distributed under the terms of the GNU General Public License +# http://www.gnu.org/copyleft/gpl.html + +version = '0.0.1' +author = "Remi Jocaille (rem...@c2...)" +licence = "GPL" +date = "2009" Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/builder/version.py ___________________________________________________________________ Name: svn:keywords + Id Deleted: softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/executables/GadgetHelper.py =================================================================== --- softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/executables/GadgetHelper.py 2009-04-20 13:00:24 UTC (rev 4564) +++ softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/executables/GadgetHelper.py 2009-04-20 14:09:29 UTC (rev 4565) @@ -1,94 +0,0 @@ -# Copyright (C) 2009 C2ME Sa -# Remi Jocaille <rem...@c2...> -# Distributed under the terms of the GNU General Public License -# http://www.gnu.org/copyleft/gpl.html - -import sys -import traceback -import platform - -# ------------------------------------------------------------------------------ -# This class is the minimal helper for builder python gadgets. -# It's an alternative to the SimpleGadget helper. -# ------------------------------------------------------------------------------ -class GadgetHelper(object): - """This class is the minimal helper for builder python gadgets. - It's an alternative to the SimpleGadget helper. - """ - - # -------------------------------------------------------------------------- - # Get if the platform is Windows or not. - # -------------------------------------------------------------------------- - def isWindows(): - """Get if the platform is Windows or not. - @return: A boolean. - """ - platformName = platform.system().lower() - return (platformName == "microsoft") or (platformName == "windows") - - # -------------------------------------------------------------------------- - # Throw a generic notification to the framework. - # -------------------------------------------------------------------------- - def throwNotification(messageId, *args): - """Throw a generic notification to the framework. - @param messageId: Message Id. - @param args: List of objects. - """ - stringBuffer = messageId - for arg in args: - stringBuffer += " '" - stringBuffer += str(arg).replace("'", "\\'") - stringBuffer += "'" - sys.stdout.write(stringBuffer + "\n") - sys.stdout.flush() - - # -------------------------------------------------------------------------- - # Throw a message to the framework. - # -------------------------------------------------------------------------- - def throwMessage(content, *args): - """Throw a message to the framework. - @param content: Content of the message. - @param args: Arguments for the message. - """ - tmp = [content,] - for arg in args: - tmp.append(arg) - GadgetHelper.throwNotification("message", *tmp) - - # -------------------------------------------------------------------------- - # Throw a trace message to the framework. - # -------------------------------------------------------------------------- - def throwTrace(message): - """Throw a trace message to the framework. - @param message: Throwed message. - """ - GadgetHelper.throwNotification("trace", message) - - # -------------------------------------------------------------------------- - # Throw an error message to the framework. - # -------------------------------------------------------------------------- - def throwError(message, sendTraceback = False): - """Throw an error message to the framework. - @param message: Thowed message if the gadget don't want to be traced. - @param sendTraceback: For to send the traceback. Default False. - """ - def formatException(): - fList = traceback.format_exception(sys.exc_info()[0], - sys.exc_info()[1], - sys.exc_info()[2]) - result = "" - for line in fList: - result += line - return result - messagesList = [message,] - if sendTraceback: - tmpList = formatException().split("\n") - for line in tmpList: - messagesList.append(line) - GadgetHelper.throwNotification("error", *messagesList) - - isWindows = staticmethod(isWindows) - throwNotification = staticmethod(throwNotification) - throwMessage = staticmethod(throwMessage) - throwTrace = staticmethod(throwTrace) - throwError = staticmethod(throwError) Modified: softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/executables/tuxdroid-gadget-skype.py =================================================================== --- softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/executables/tuxdroid-gadget-skype.py 2009-04-20 13:00:24 UTC (rev 4564) +++ softwares_suite_v3/community/gadget/tuxdroid-gadget-skype/trunk/tuxdroid-skype-gadget/executables/tuxdroid-gadget-skype.py 2009-04-20 14:09:29 UTC (rev 4565) @@ -1,268 +1,266 @@ -''' -This file is part of "tuxdroid-gadget-skype". - * Copyright 2008, kysoh - * Author : Conan Jerome - * eMail : jer...@ky... - * Site : http://www.kysoh.com/ - * - * "tuxdroid-gadget-skype " is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * "tuxdroid-gadget-skype" is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with "tuxdroid-gadget-skype"; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA - * 02110-1301 USA, or see the FSF site: http://www.fsf.org. - */ - ''' +# -*- coding: utf-8 -*- -import platform -import Skype4Py -import commands -import threading -import time +# Copyright (C) 2009 Kysoh Sa +# Conan Jerome <jer...@ky...> +# Distributed under the terms of the GNU General Public License +# http://www.gnu.org/copyleft/gpl.html + +__author__ = "Conan Jerome" +__appname__ = "Python gadget skype" +__version__ = "0.2" +__date__ = "2009/04/15" +__license__ = "GPL" + import os +import time +import sys +import threading import subprocess +import Skype4Py from tuxisalive.api.TuxAPI import * -from GadgetHelper import GadgetHelper +sys.path.append(os.environ['TUXDROID_SERVER_PYTHON_UTIL']) -class Connection(object): - ''' - This class manage skype connection. - ''' +from util.SimpleGadget.SimpleGadgetConfiguration import SimpleGadgetConfiguration +from util.SimpleGadget.SimpleGadget import SimpleGadget - #Private global vars. - __currentCall = None - __tux = None - __currentContactIndex = -1 - __contactsDict = {} - __contactsList = [] - __allowedStatus = { - "Online" : Skype4Py.olsOnline, - "Away" : Skype4Py.olsAway, - "Do not disturb" : Skype4Py.olsDoNotDisturb, - "Invisible" : Skype4Py.olsInvisible, - "Busy" : Skype4Py.olsNotAvailable, - "Skype me": Skype4Py.olsSkypeMe - } - - __mutexNext = threading.Lock() - __mutexPrev = threading.Lock() - __mutexCall = threading.Lock() - - #Skype api objects. - __skype = None - __apiAttachState = -1 - __activeMain = True - - #registered events. - __okEventID = None - __headEventID = None - __leftWingEvent = None - __rightWingEvent = None - __leftArrowEvent = None - __rightArrowEvent = None - __greenPhoneEvent = None - __redPhoneEvent = None +class Configuration(SimpleGadgetConfiguration): + """This class make an access to the gadget parameters. + Parameters are automatically filled by the SimpleGadget class at gadget + starting. + """ - #Users gadget parameters. - speaker = "Ryan" - pitch = 120 - ip = "127.0.0.1" - status = None - quitSkype = False - quitGadget = True - - - #Geting right gadget parameters. - if "tgp_ip" in os.environ: - ip = os.environ["tgp_ip"] - if "tgp_locutor" in os.environ: - speaker = os.environ["tgp_locutor"] - if "tgp_pitch" in os.environ: - pitch = int(os.environ["tgp_pitch"]) - if "tgp_quitSkype" in os.environ: - quitSkype = (os.environ["tgp_quitSkype"] == "true") - if "tgp_quitGadget" in os.environ: - quitGadget = (os.environ["tgp_quitGadget"] == "true") - if "tgp_startupStatus" in os.environ: - status = os.environ["tgp_startupStatus"] - + def __init__(self): + """Initialization of the class. + """ + # Call the super class + SimpleGadgetConfiguration.__init__(self) + # Initialize the parameters + self.__quitSkype = False + self.__quitGadget = False + self.__startupStatus = "" + def getQuitSkype(self): + return self.__quitSkype - def __init__(self): - ''' - Constructor - ''' - print("Debug: connecting") - - self.__tux = TuxAPI(self.ip, 270) - self.__tux.server.autoConnect(CLIENT_LEVEL_FREE, "SkypeGadget", "tuxdroid-gadget-skype") - self.__tux.server.waitConnected(3.0) - self.__tux.access.waitAcquire(3.0, ACCESS_PRIORITY_NORMAL) - - try: - #Start Skype client if not started. - self.__startSkype() - if not self.__activeMain: - self.__destroy() - #Connect to skype api. - self.__connectSkypeAPI() - except: - GadgetHelper.throwMessage("I cannot get connected to your Skeyepe. Please, check if you are connected. And verify if I can access skeyepe.") - self.__destroy() - - - - def __destroy(self): - ''' - Destroy current connection object. - ''' - try: - if self.__skype != None: - self.__resetTuxMotors() - self.__skype._API.Close() - self.__skype = None - self.__apiAttachState = -1 - - if self.__tux != None: - self.__tux.led.both.off() - self.__tux.led.both.on() - self.__resetTuxMotors() - self.__tux.access.release() - self.__tux.server.disconnect() - self.__tux.destroy() - - self.__activeMain = False - except: - pass - - - - def __initSkypeGadget(self): - ''' - Initialize the skype gadget when skype api is connected. - ''' - #Set tux as audio card. - self.__setTuxAudio() - - #Set the user status. - if self.__allowedStatus.has_key(self.status): - self.__skype._SetCurrentUserStatus(self.__allowedStatus[self.status]) - - #et the contacts list. - self.__getContacts() + def setQuitSkype(self, quitSkype): + self.__quitSkype = quitSkype + def getQuitGadget(self): + return self.__quitGadget + def setQuitGadget(self, quitGadget): + self.__quitGadget = quitGadget - def __initTuxCallbacks(self): - ''' - Init the Tux Droid callbacks - ''' - #Tux Droid switches. - self.__leftWingEvent = self.__tux.button.left.registerEventOnPressed(self.onLeftButtonPushed) - self.__rightWingEvent = self.__tux.button.right.registerEventOnPressed(self.onRightButonPushed) - self.__headEventID = self.__tux.button.head.registerEventOnReleased(self.onHeadButtonPushed) - #Remote control. - self.__tux.button.remote.registerEventOnPressed(self.onStandbyRemoteButtonPushed, K_STANDBY) - self.__leftArrowEvent = self.__tux.button.remote.registerEventOnPressed(self.onLeftButtonPushed, K_DOWN) - self.__rightArrowEvent = self.__tux.button.remote.registerEventOnPressed(self.onRightButonPushed, K_UP) - self.__okEventID = self.__tux.button.remote.registerEventOnPressed(self.onHeadButtonPushed, K_OK) - self.__greenPhoneEvent = self.__tux.button.remote.registerEventOnPressed(self.onHeadButtonPushed, K_RECEIVECALL) - self.__redPhoneEvent = self.__tux.button.remote.registerEventOnPressed(self.onFinishCall, K_HANGUP) + def getStartupStatus(self): + return self.__startupStatus + def setStartupStatus(self, startupStatus): + self.__startupStatus = startupStatus -######################################################### -######### private functions ######## +class SkypeGadget(SimpleGadget): + """Skype gadget class. + """ - def onLeftButtonPushed(self, value, delay): - ''' - On left switch / remote event. - ''' - thread = threading.Thread(target = self.nextContact, args = []) - thread.start() + def __init__(self): + """Initialization of the class. + """ + # Call the super class + SimpleGadget.__init__(self) + # Initialize some values ... + self.__currentCall = None + self.__tux = None + self.__currentContactIndex = -1 + self.__contactsDict = {} + self.__contactsList = [] + self.__allowedStatus = { + "Online" : Skype4Py.olsOnline, + "Away" : Skype4Py.olsAway, + "Do not disturb" : Skype4Py.olsDoNotDisturb, + "Invisible" : Skype4Py.olsInvisible, + "Busy" : Skype4Py.olsNotAvailable, + "Skype me": Skype4Py.olsSkypeMe, + } + self.__mutexNext = threading.Lock() + self.__mutexPrev = threading.Lock() + self.__mutexCall = threading.Lock() + # Skype api objects. + self.__skype = None + self.__apiAttachState = -1 + self.__activeMain = True + # Registered events. + self.__okEventID = None + self.__headEventID = None + self.__leftWingEvent = None + self.__rightWingEvent = None + self.__leftArrowEvent = None + self.__rightArrowEvent = None + self.__greenPhoneEvent = None + self.__redPhoneEvent = None + # Skype process + self.__skypeProcess = None + def start(self): + """Gadget entry point. + This method should be used to dispatch commands. + """ + if self.getCommand() == "run": + self.run() + else: + self.run() + def run(self): + """Gadget entry point for the "run" command. + """ + self.__tux = TuxAPI("127.0.0.1", 270) + self.__tux.server.autoConnect(CLIENT_LEVEL_FREE, "SkypeGadget", + "tuxdroid-gadget-skype") + self.__tux.server.waitConnected(3.0) + try: + # Start Skype client if not started. + self.__startSkype() + if not self.__activeMain: + self.stop() + return + # Connect to skype api. + self.__connectSkypeAPI() + except: + self.throwMessage("I cannot get connected to your Skeyepe. Please, check if you are connected. And verify if I can access skeyepe.") + self.stop() - def onRightButonPushed(self, value, delay): - ''' - On right switch / remote event. - ''' - thread = threading.Thread(target = self.previousContact, args = []) - thread.start() + def onGadgetStop(self): + """Callback on gadget stop. + """ + def closeSkype(): + if self.__skype != None: + self.__activeMain = False + self.__skype._API.Close() + self.__skype = None + self.__apiAttachState = -1 + if self.__skypeProcess != None: + if self.isWindows(): + import win32api + try: + win32api.TerminateProcess(int( + self.__skypeProcess._handle), -1) + except: + pass + else: + os.system("kill -9 " + str(self.__skypeProcess.pid)) + try: + if self.__skype != None: + self.__setCallFinished() + if self.__skypeProcess != None: + closeSkype() + if self.__tux != None: + self.__tux.led.both.off() + self.__tux.led.both.on() + self.__resetTuxMotors() + self.__tux.server.disconnect() + self.__tux.destroy() + except: + pass + def __initSkypeGadget(self): + """Initialize the skype gadget when skype api is connected. + """ + # Set tux as audio card. + self.__setTuxAudio() + # Set the user status. + status = self.configuration().getStartupStatus() + if self.__allowedStatus.has_key(status): + self.__skype._SetCurrentUserStatus(self.__allowedStatus[status]) + # Get the contacts list. + self.__getContacts() + def __initTuxCallbacks(self): + """Init the Tux Droid callbacks + """ + # Tux Droid switches. + self.__leftWingEvent = self.__tux.button.left.registerEventOnPressed( + self.__onLeftButtonPushed) + self.__rightWingEvent = self.__tux.button.right.registerEventOnPressed( + self.__onRightButonPushed) + self.__headEventID = self.__tux.button.head.registerEventOnReleased( + self.__onHeadButtonPushed) + # Remote control. + self.__tux.button.remote.registerEventOnPressed( + self.__onStandbyRemoteButtonPushed, K_STANDBY) + self.__leftArrowEvent = self.__tux.button.remote.registerEventOnPressed( + self.__onLeftButtonPushed, K_DOWN) + self.__rightArrowEvent = self.__tux.button.remote.registerEventOnPressed( + self.__onRightButonPushed, K_UP) + self.__okEventID = self.__tux.button.remote.registerEventOnPressed( + self.__onHeadButtonPushed, K_OK) + self.__greenPhoneEvent = self.__tux.button.remote.registerEventOnPressed( + self.__onHeadButtonPushed, K_RECEIVECALL) + self.__redPhoneEvent = self.__tux.button.remote.registerEventOnPressed( + self.__onFinishCall, K_HANGUP) - def onHeadButtonPushed(self, value, delay): - ''' - On head / remote event. - ''' - print(delay) - if delay > 0.8: - thread = threading.Thread(target = self.setCall, args = [self.__contactsList[self.__currentContactIndex], ]) - thread.start() - - - def onFinishCall(self, value, delay): - ''' - Finish call event ( remote control ). - ''' - thread = threading.Thread(target= self.setCallFinished, args = []) - thread.start() + def __onLeftButtonPushed(self, value, delay): + """On left switch / remote event. + """ + thread = threading.Thread(target = self.nextContact) + thread.start() - - def onStandbyRemoteButtonPushed(self, value, delay): - ''' - On standby remote button pushed : quit the script. - ''' - thread = threading.Thread(target = self.quitMainloop, args = []) + def __onRightButonPushed(self, value, delay): + """On right switch / remote event. + """ + thread = threading.Thread(target = self.previousContact) thread.start() + def __onHeadButtonPushed(self, value, delay): + """On head / remote event. + """ + if delay > 0.2: + thread = threading.Thread(target = self.setCall, + args = (self.__contactsList[self.__currentContactIndex],)) + thread.start() + def __onFinishCall(self, value, delay): + """Finish call event ( remote control ). + """ + thread = threading.Thread(target= self.setCallFinished) + thread.start() + def __onStandbyRemoteButtonPushed(self, value, delay): + """On standby remote button pushed : quit the script. + """ + thread = threading.Thread(target = self.quitMainloop) + thread.start() - def skypeApplicationAPIStatusReceived(self, value): - ''' - Received api connection status. - ''' + def __skypeApplicationAPIStatusReceived(self, value): + """Received api connection status. + """ self.__apiAttachState = value - - - def __setTuxAudio(self): - ''' - Set tux as audio peripheral. - ''' - #from SkypeConnection import Utils - if self.isWindows(): - self.__sendCommand('SET AUDIO_IN TuxDroid-Micro (TuxDroid-Audio)') - self.__sendCommand('SET AUDIO_OUT Speakers (TuxDroid-Audio)') - self.__sendCommand('SET RINGER Speakers (TuxDroid-Audio)') - else: + def __setTuxAudio(self): + """Set tux as audio peripheral. + """ + if self.isWindows(): + import platform + if int(platform.version().split(".")[0]) >= 6: + self.__sendCommand('SET AUDIO_IN TuxDroid-Micro (TuxDroid-Audio)') + self.__sendCommand('SET AUDIO_OUT Speakers (TuxDroid-Audio)') + self.__sendCommand('SET RINGER Speakers (TuxDroid-Audio)') + else: + self.__sendCommand('SET AUDIO_IN TuxDroid-Audio') + self.__sendCommand('SET AUDIO_OUT TuxDroid-Audio') + self.__sendCommand('SET RINGER TuxDroid-Audio') + else: self.__sendCommand('SET AUDIO_IN TuxDroid (plughw:TuxDroid,0)') self.__sendCommand('SET AUDIO_OUT TuxDroid (plughw:TuxDroid,0)') self.__sendCommand('SET RINGER TuxDroid (plughw:TuxDroid,0)') - - - def __sendCommand(self, command): - ''' - Send a raw command to skype api. Return true if command was sent. - ''' + def __sendCommand(self, command): + """Send a raw command to skype api. Return true if command was sent. + """ if self.__getConnected(): try: - cmd_obj = self.__skype.Command( command, Block=True ) - - self.__skype.SendCommand( cmd_obj ) + cmd_obj = self.__skype.Command(command, Block = True) + self.__skype.SendCommand(cmd_obj) result = str((cmd_obj.Reply).encode('utf-8')) return True except: @@ -270,369 +268,280 @@ else: return False - - - def __getPlatform(self): - ''' - Return the plateform name of this current computer. - ''' - return platform.system() + def __connectSkypeAPI(self): + """Get connected to the Skype client. + """ + self.__skype = Skype4Py.Skype() + self.__skype.Timeout = 20000 + self.__skype.OnAttachmentStatus = self.__skypeApplicationAPIStatusReceived + self.__setSkypeCallBacks() + self.__skype.Attach() + self.__initSkypeGadget() + self.__initTuxCallbacks() + def __getSkypeConnected(self): + """Check for skype connection + """ + if not self.isWindows(): + return len(commands.getoutput("ps -A | grep skype")) > 0 + else: + cmd = ["tasklist", "/FI", "IMAGENAME eq skype.exe"] + process = subprocess.Popen(cmd, stdin = subprocess.PIPE, + stdout = subprocess.PIPE) + value = process.stdout.read() + value = value.split() + return ("skype.exe" in value) or ("Skype.exe" in value) - def isWindows(self): - ''' - Return true if plateform is windows. - ''' - platform = self.__getPlatform() - return (platform == 'Windows' ) or (platform == 'windows') or (platform == "Microsoft") - - - def __connectSkypeAPI(self): - ''' - Get connected to the Skype client. - ''' - self.__skype = Skype4Py.Skype() - self.__skype.Timeout = 20000 - self.__skype.OnAttachmentStatus = self.skypeApplicationAPIStatusReceived - self.__setSkypeCallBacks() - self.__skype.Attach() - self.__initSkypeGadget() - self.__initTuxCallbacks() - print("Debug: connected") - - - - def __getSkypeConnected(self): - """ - Check for skype connection - """ - if not self.isWindows(): - return len(commands.getoutput("ps -A | grep skype")) > 0 - else: - cmd = ["tasklist", "/FI", "IMAGENAME eq skype.exe"] - process = subprocess.Popen(cmd, stdin = subprocess.PIPE, stdout = subprocess.PIPE) - value = process.stdout.read() - value = value.split() - return ("skype.exe" in value) or ("Skype.exe" in value) - - - - def __startSkype(self): - ''' - This function starts skype. - ''' - #Return if skype is already started. + def __startSkype(self): + """This function starts skype. + """ + # Return if skype is already started. if self.__getSkypeConnected(): return - if self.isWindows(): - thread = threading.Thread(target=self.__startSkypeWindows, args=[]) + thread = threading.Thread(target = self.__startSkypeWindows) thread.start() else: - thread = threading.Thread(target=self.__startSkypeLinux, args=[]) + thread = threading.Thread(target = self.__startSkypeLinux) thread.start() - - - - def __startSkypeWindows(self): - ''' - Start skype on windows. - ''' - - if "ProgramFiles" in os.environ: + + def __startSkypeWindows(self): + """Start skype on windows. + """ + if "ProgramFiles" in os.environ: try: - process = subprocess.Popen(os.environ["ProgramFiles"] + "\\Skype\\Phone\\Skype.exe", stdin=subprocess.PIPE, stdout=subprocess.PIPE) - result = process.stdout.read() + self.__skypeProcess = subprocess.Popen( + os.environ["ProgramFiles"] + "\\Skype\\Phone\\Skype.exe", + stdin = subprocess.PIPE, stdout = subprocess.PIPE) + result = self.__skypeProcess.stdout.read() result.split() - if ("not" in result) and ("recognized" in result) and ("command" in result): - GadgetHelper.throwMessage("Sorry, it looks like skeyepe is not installed. Please go to the skeyepe website to download the software.") + if ("not" in result) and ("recognized" in result) \ + and ("command" in result): + self.throwMessage("Sorry, it looks like skeyepe is not installed. Please go to the skeyepe website to download the software.") self.__activeMain = False except WindowsError: - GadgetHelper.throwMessage("Sorry, it looks like skeyepe is not installed. Please go to the skeyepe website to download the software.") + self.throwMessage("Sorry, it looks like skeyepe is not installed. Please go to the skeyepe website to download the software.") self.__activeMain = False - - - - - def __startSkypeLinux(self): - ''' - Start skype on linux ( thread needed to do not block the script ). - ''' - #Searching for skype binary. - cmd = ["skype", "--version"] - process = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE) - result = process.stdout.read() - result = result.split() - if("Skype" in result) and ("Copyright" in result): - #Then skype is in PATH - subprocess.Popen("skype", stdin=subprocess.PIPE, stdout=subprocess.PIPE) - else: - GadgetHelper.throwMessage("Sorry, it looks like skeyepe is not installed. Please go to the skeyepe website to download the software.") - self.__activeMain = False - - - - def __getConnected(self): - ''' - Return true if connected. - ''' - return self.__apiAttachState == 0 + def __startSkypeLinux(self): + """Start skype on linux ( thread needed to do not block the script ). + """ + # Searching for skype binary. + cmd = ["skype", "--version"] + process = subprocess.Popen(cmd, stdin = subprocess.PIPE, + stdout = subprocess.PIPE) + result = process.stdout.read() + result = result.split() + if("Skype" in result) and ("Copyright" in result): + # Then skype is in PATH + self.__skypeProcess.Popen("skype", stdin = subprocess.PIPE, + stdout = subprocess.PIPE) + else: + self.throwMessage("Sorry, it looks like skeyepe is not installed. Please go to the skeyepe website to download the software.") + self.__activeMain = False + def __getConnected(self): + """Return true if connected. + """ + return self.__apiAttachState == 0 + def __getContacts(self): + """Return the contact list as list. + """ + self.__contactsList = [] + self.__contactsDict = {} + self.__currentContactIndex = -1 + for user in self.__skype.Friends: + if user.OnlineStatus not in [Skype4Py.olsUnknown, + Skype4Py.olsOffline, Skype4Py.olsInvisible]: + userFNEnc = user.FullName.encode("UTF-8").replace(" ", "_") + userDNEnc = user.DisplayName.encode("UTF-8").replace(" ", "_") + userHEnc = user.Handle.encode("UTF-8").replace(" ", "_") + if len(userFNEnc) > 0: + self.__contactsDict[userFNEnc] = userHEnc + self.__contactsList.append(userFNEnc) + elif len(userDNEnc) > 0: + self.__contactsDict[userDNEnc] = userHEnc + self.__contactsList.append(userDNEnc) + else: + self.__contactsDict[userHEnc] = userHEnc + self.__contactsList.append(userHEnc) + if len(self.__contactsDict) > 0: + self.nextContact() + else: + self.throwMessage("I cannot found online user or registered cell numbers") + self.stop() + return self.__contactsList + def __resetTuxMotors(self, removeEvents = True): + """Reset tux motors. + """ + self.__tux.flippers.down() + self.__tux.mouth.close() + if removeEvents: + self.__removeTuxEvents() - def __getContacts(self): - ''' - Return the contact list as list. - ''' - self.__contactsList = [] - self.__contactsDict = {} - self.__currentContactIndex = -1 - for user in self.__skype.Friends: - if user.OnlineStatus not in [Skype4Py.olsUnknown, Skype4Py.olsOffline, Skype4Py.olsInvisible]: - if len(user.FullName.encode("UTF-8")) > 0: - self.__contactsDict[user.FullName.encode("UTF-8").replace(" ", "_")] = user.Handle.encode("UTF-8") - self.__contactsList.append(user.FullName.encode("UTF-8").replace(" ", "_")) - elif len(user.DisplayName.encode("UTF-8")) > 0: - self.__contactsDict[user.DisplayName.encode("UTF-8").replace(" ", "_")] = user.Handle.encode("UTF-8") - self.__contactsList.append(user.DisplayName.encode("UTF-8").replace(" ", "_")) - else: - self.__contactsDict[user.Handle.encode("UTF-8").replace(" ", "_")] = user.Handle.encode("UTF-8") - self.__contactsList.append(user.Handle.encode("UTF-8").replace(" ", "_")) - - if len(self.__contactsDict) > 0: - self.nextContact() - else: - GadgetHelper.throwMessage("I cannot found online user or registered cell numbers") - self.__destroy() - return self.__contactsList + def __removeTuxEvents(self): + """Remove tux switches and buttons registered events. + """ + # Unregister ok push event + if self.__okEventID != None: + self.__tux.button.remote.unregisterEventOnPressed(self.__okEventID) + # Unregister head button push + if self.__headEventID != None: + self.__tux.button.head.unregisterEventOnReleased(self.__headEventID) + # Unregister left wing event + if self.__leftWingEvent != None: + self.__tux.button.left.unregisterEventOnPressed( + self.__leftWingEvent) + # Unregister right wing event + if self.__rightWingEvent != None: + self.__tux.button.right.unregisterEventOnPressed( + self.__rightWingEvent) + # Unregister left arrow event + if self.__leftArrowEvent != None: + self.__tux.button.remote.unregisterEventOnPressed( + self.__leftArrowEvent) + # Unregister right arrow event + if self.__rightArrowEvent != None: + self.__tux.button.remote.unregisterEventOnPressed( + self.__rightArrowEvent) + # Unregister call callback. + if self.__greenPhoneEvent != None: + self.__tux.button.remote.unregisterEventOnPressed( + self.__greenPhoneEvent) + # Unregister set call finish callback. + if self.__redPhoneEvent != None: + self.__tux.button.remote.unregisterEventOnPressed( + self.__redPhoneEvent) + def __setTuxMotors(self): + """Set tux to get the call. + """ + self.__tux.flippers.up() + self.__tux.mouth.open() + def __onOutgoingCall(self, Call, Status): + """Set outgoing calls functions. + """ + if Status == Skype4Py.clsRinging: + self.__tux.led.both.blinkAsync(SPV_SLOW, 100, LFX_FADE) + if Status in [Skype4Py.clsFinished, Skype4Py.clsCancelled, + Skype4Py.clsRefused, Skype4Py.clsFailed, Skype4Py.clsBusy]: + self.__tux.led.both.off() + self.__tux.led.both.on() + self.__currentCall = None + self.__resetTuxMotors() + if self.configuration().getQuitGadget(): + def async(): + time.sleep(2.0) + self.stop() + t = threading.Thread(target = async) + t.start() + return + self.__initTuxCallbacks() + elif Status in [Skype4Py.clsRinging, Skype4Py.clsEarlyMedia, + Skype4Py.clsRouting, Skype4Py.clsInProgress, Skype4Py.clsUnplaced]: + if Status in [Skype4Py.clsInProgress, Skype4Py.clsUnplaced]: + self.__tux.led.both.off() + self.__tux.led.both.on() + self.__currentCall = Call + self.__removeTuxEvents() + self.__setTuxMotors() + self.__okEventID = self.__tux.button.remote.registerEventOnPressed( + self.__setCallFinished, K_OK) + self.__headEventID = self.__tux.button.head.registerEventOnReleased( + self.__headCallFinish) + self.__redPhoneEvent = self.__tux.button.remote.registerEventOnPressed( + self.__onFinishCall, K_HANGUP) -######################################################### -######### callbacks ############### + def __onSkypeCall(self, Call, Status): + """Set calls callback. + """ + if (Call.Type == Skype4Py.cltOutgoingP2P) or \ + (Call.Type == Skype4Py.cltOutgoingPSTN): + self.__onOutgoingCall(Call, Status) + elif (Call.Type == Skype4Py.cltIncomingP2P) or \ + (Call.Type == Skype4Py.cltIncomingPSTN): + Call.Finish() + def __setSkypeCallBacks(self): + """Set all needed Skype callback. + """ + # The only used caallback for now is the skype call event. + self.__skype.OnCallStatus = self.__onSkypeCall - def __resetTuxMotors(self, removeEvents=True): - ''' - Reset tux motors. - ''' - self.__tux.flippers.down() - self.__tux.mouth.close() - - if removeEvents: - self.__removeTuxEvents() - - - def __removeTuxEvents(self): - ''' - Remove tux switches and buttons registered events. - ''' - #unregister ok push event - if self.__okEventID != None: - self.__tux.button.remote.unregisterEventOnPressed(self.__okEventID) - - #unregister head button push - if self.__headEventID != None: - self.__tux.button.head.unregisterEventOnReleased(self.__headEventID) - - #unregister left wing event - if self.__leftWingEvent != None: - self.__tux.button.left.unregisterEventOnPressed(self.__leftWingEvent) - - #unregister right wing event - if self.__rightWingEvent != None: - self.__tux.button.right.unregisterEventOnPressed(self.__rightWingEvent) - - #unregister left arrow event - if self.__leftArrowEvent != None: - self.__tux.button.remote.unregisterEventOnPressed(self.__leftArrowEvent) - - #unregister right arrow event - if self.__rightArrowEvent != None: - self.__tux.button.remote.unregisterEventOnPressed(self.__rightArrowEvent) - - #Unregister call callback. - if self.__greenPhoneEvent != None: - self.__tux.button.remote.unregisterEventOnPressed(self.__greenPhoneEvent) - - #Unregister set call finish callback. - if self.__redPhoneEvent != None: - self.__tux.button.remote.unregisterEventOnPressed(self.__redPhoneEvent) - + def setCall(self, contact): + """Call a specified contact. + """ + self.__mutexCall.acquire() + # Get skype name + callName = self.__contactsDict.get(contact) + # Place call + if (callName != None) and (self.__currentCall == None): + self.__currentCall = self.__skype.PlaceCall(callName) + self.__mutexCall.release() + def __headCallFinish(self, *args): + """Finish a call from head button. + """ + value, delay = args + if delay > 0.2: + self.__setCallFinished() - def __setTuxMotors(self): - ''' - Set tux to get the call. - ''' - self.__tux.flippers.up() - self.__tux.mouth.open() + def __setCallFinished(self, *args): + """Finish all placed calls. + """ + self.__mutexCall.acquire() + if self.__currentCall != None: + try: + self.__currentCall.Finish() + self.__currentCall = None + except: + self.__currentCall.Resume() + self.__currentCal = None + self.__mutexCall.release() + def nextContact(self): + """Return the next user skype full name. + """ + self.__mutexNext.acquire() + if self.__currentContactIndex >= len(self.__contactsList) -1: + self.__currentContactIndex = -1 + self.__currentContactIndex += 1 + user = self.__contactsList[self.__currentContactIndex] + # Format string that will be sent to the tts. + user = user.replace("_", " ").replace("@", " ") + self.__mutexNext.release() + self.__tux.tts.speak(user, self.configuration().getLocutor(), + self.configuration().getPitch()) + def previousContact(self): + """Return the previous user skype full name. + """ + self.__mutexPrev.acquire() + if self.__currentContactIndex <= 0: + self.__currentContactIndex = len(self.__contactsList) + self.__currentContactIndex -= 1 + user = self.__contactsList[self.__currentContactIndex] + # Format string that will sent to the tts. + user = user.replace("_", " ").replace("@", " ") + self.__mutexPrev.release() + self.__tux.tts.speak(user, self.configuration().getLocutor(), + self.configuration().getPitch()) - def __onOutgoingCall(self, Call, Status): - ''' - Set outgoing calls functions. - ''' - if Status == Skype4Py.clsRinging: - self.__tux.led.both.blinkAsync(SPV_SLOW, 100, LFX_FADE) - - - if Status in [Skype4Py.clsFinished, Skype4Py.clsCancelled, Skype4Py.clsRefused, Skype4Py.clsFailed, Skype4Py.clsBusy]: - self.__tux.led.both.off() - self.__tux.led.both.on() - self.__currentCall = None - self.__resetTuxMotors() - - #Parameter defined by user.cusLoggedOut - if bool(self.quitSkype) : - self.__skype.Client.Shutdown() - self.__destroy() - - if bool(self.quitGadget): - self.__destroy() - - self.__initTuxCallbacks() - - - - elif Status in [Skype4Py.clsRinging, Skype4Py.clsEarlyMedia, Skype4Py.clsRouting, Skype4Py.clsInProgress, Skype4Py.clsUnplaced]: - if Status in [Skype4Py.clsInProgress, Skype4Py.clsUnplaced]: - self.__tux.led.both.off() - self.__tux.led.both.on() - self.__currentCall = Call - self.__removeTuxEvents() - self.__setTuxMotors() - self.__okEventID = self.__tux.button.remote.registerEventOnPressed(self.setCallFinished, K_OK) - self.__headEventID = self.__tux.button.head.registerEventOnReleased(self.headCallFinish) - self.__redPhoneEvent = self.__tux.button.remote.registerEventOnPressed(self.onFinishCall, K_HANGUP) - - - - - def __onSkypeCall(self, Call, Status): - ''' - Set calls callback. - ''' - if (Call.Type == Skype4Py.cltOutgoingP2P) or (Call.Type == Skype4Py.cltOutgoingPSTN): - self.__onOutgoingCall(Call, Status) - elif(Call.Type == Skype4Py.cltIncomingP2P) or (Call.Type == Skype4Py.cltIncomingPSTN): - Call.Finish() - - - - - def __setSkypeCallBacks(self): - ''' - Set all needed Skype callback. - ''' - #The only used caallback for now is the skype call event. - self.__skype.OnCallStatus = self.__onSkypeCall - - -############################################################################# -##################### Users functions #################################### - - def setCall(self, contact): - ''' - Call a specified contact. - ''' - self.__mutexCall.acquire() - #Get skype name - callName = self.__contactsDict.get(contact) - #Place call - if (callName != None) and (self.__currentCall == None): - self.__currentCall = self.__skype.PlaceCall(... [truncated message content] |
|
From: Gwadavel <c2m...@c2...> - 2009-04-20 13:00:48
|
Author: Gwadavel
Date: 2009-04-20 15:00:24 +0200 (Mon, 20 Apr 2009)
New Revision: 4564
Modified:
softwares_suite_v3/community/script/pidgin/trunk/tux_pidgin.py
Log:
error with alias CIA and commit message
Modified: softwares_suite_v3/community/script/pidgin/trunk/tux_pidgin.py
===================================================================
--- softwares_suite_v3/community/script/pidgin/trunk/tux_pidgin.py 2009-04-18 15:45:22 UTC (rev 4563)
+++ softwares_suite_v3/community/script/pidgin/trunk/tux_pidgin.py 2009-04-20 13:00:24 UTC (rev 4564)
@@ -181,12 +181,12 @@
alias = purple.PurpleBuddyGetAlias(buddy)
else:
alias = name
- if tgp_cia and alias[:3].upper() == "CIA":
- text = LANGUAGE["commit"]
- else:
- MessageP = MessageParser()
- message = MessageP.strip(message)
- text = "%s %s %s" % (alias, LANGUAGE["say"], message)
+ if tgp_cia and alias[:3].upper() == "CIA":
+ text = LANGUAGE["commit"]
+ else:
+ MessageP = MessageParser()
+ message = MessageP.strip(message)
+ text = "%s %s %s" % (alias, LANGUAGE["say"], message)
text = text.encode('utf-8')
tux_speak(text)
|
|
From: remi <c2m...@c2...> - 2009-04-18 15:45:30
|
Author: remi
Date: 2009-04-18 17:45:22 +0200 (Sat, 18 Apr 2009)
New Revision: 4563
Added:
softwares_suite_v3/community/gadget/tuxdroid-gadget-webradio/trunk/resources/fr.po
Log:
* added french translations
Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-webradio/trunk/resources/fr.po
===================================================================
--- softwares_suite_v3/community/gadget/tuxdroid-gadget-webradio/trunk/resources/fr.po (rev 0)
+++ softwares_suite_v3/community/gadget/tuxdroid-gadget-webradio/trunk/resources/fr.po 2009-04-18 15:45:22 UTC (rev 4563)
@@ -0,0 +1,17 @@
+msgid "Web Radio"
+msgstr "Web Radio"
+
+msgid "Playing a webradio"
+msgstr "Ecoutez une webradio"
+
+msgid "Play the webradio"
+msgstr "Ecoutez la webradio"
+
+msgid "Select a webradio"
+msgstr "Sélectionner une webradio"
+
+msgid "Starting the webradio \"{0}\"."
+msgstr "Lancement de la webradio \"{0}\"."
+
+msgid "Sorry, I loosed the radio stream."
+msgstr "Désolé, j'ai perdu le flux audio de la radio."
Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-webradio/trunk/resources/fr.po
___________________________________________________________________
Name: svn:keywords
+ Id
|
|
From: remi <c2m...@c2...> - 2009-04-18 15:44:52
|
Author: remi
Date: 2009-04-18 17:44:44 +0200 (Sat, 18 Apr 2009)
New Revision: 4562
Modified:
softwares_suite_v3/community/gadget/tuxdroid-gadget-webradio/trunk/executables/tux-gadget-webradio.py
softwares_suite_v3/community/gadget/tuxdroid-gadget-webradio/trunk/resources/gadget.pot
softwares_suite_v3/community/gadget/tuxdroid-gadget-webradio/trunk/resources/gadget.xml
softwares_suite_v3/community/gadget/tuxdroid-gadget-webradio/trunk/resources/help.html
Log:
* added a message on radio stream loosed
* updated translations and messages
Modified: softwares_suite_v3/community/gadget/tuxdroid-gadget-webradio/trunk/executables/tux-gadget-webradio.py
===================================================================
--- softwares_suite_v3/community/gadget/tuxdroid-gadget-webradio/trunk/executables/tux-gadget-webradio.py 2009-04-18 15:06:54 UTC (rev 4561)
+++ softwares_suite_v3/community/gadget/tuxdroid-gadget-webradio/trunk/executables/tux-gadget-webradio.py 2009-04-18 15:44:44 UTC (rev 4562)
@@ -91,6 +91,7 @@
SimpleGadget.__init__(self)
# Create a mplayer wrapper object
self.__player = Mplayer()
+ self.__player.onStreamLoosedCallback = self.__onStreamLoosed
def start(self):
if self.getCommand() == "run":
@@ -106,10 +107,15 @@
radioUrl = myRadio
if myRadio in WEBRADIO.keys():
radioUrl = WEBRADIO[myRadio]
- self.throwMessage("Web radio \"{0}\".", myRadio)
+ self.throwMessage("Starting the webradio \"{0}\".", myRadio)
# Start mplayer
self.__player.start(radioUrl, True)
+ def __onStreamLoosed(self):
+ self.throwMessage("Sorry, I loosed the radio stream.")
+ self.stop()
+ sys.exit(0)
+
def onGadgetStop(self):
"""Event on gadget stop.
"""
Modified: softwares_suite_v3/community/gadget/tuxdroid-gadget-webradio/trunk/resources/gadget.pot
===================================================================
--- softwares_suite_v3/community/gadget/tuxdroid-gadget-webradio/trunk/resources/gadget.pot 2009-04-18 15:06:54 UTC (rev 4561)
+++ softwares_suite_v3/community/gadget/tuxdroid-gadget-webradio/trunk/resources/gadget.pot 2009-04-18 15:44:44 UTC (rev 4562)
@@ -1,11 +1,17 @@
msgid "Web Radio"
msgstr ""
-msgid "Use Tux as a webradio"
+msgid "Playing a webradio"
msgstr ""
-msgid "Web radio"
+msgid "Play the webradio"
msgstr ""
-msgid "Select radio"
+msgid "Select a webradio"
+msgstr ""
+
+msgid "Starting the web radio \"{0}\"."
+msgstr ""
+
+msgid "Sorry, I loosed the radio stream."
msgstr ""
Modified: softwares_suite_v3/community/gadget/tuxdroid-gadget-webradio/trunk/resources/gadget.xml
===================================================================
--- softwares_suite_v3/community/gadget/tuxdroid-gadget-webradio/trunk/resources/gadget.xml 2009-04-18 15:06:54 UTC (rev 4561)
+++ softwares_suite_v3/community/gadget/tuxdroid-gadget-webradio/trunk/resources/gadget.xml 2009-04-18 15:44:44 UTC (rev 4562)
@@ -5,24 +5,23 @@
</interpreter>
<description>
<name>Web Radio</name>
- <description>Use Tux as a webradio</description>
+ <description>Playing a webradio</description>
<author>Gwadavel</author>
<version>0.0.6</version>
<iconFile>resources/webradio.png</iconFile>
- <executionMode>command</executionMode>
<uuid>8349ed52-572d-4c3f-a7b8-05c2a8aec2c6</uuid>
</description>
<parameters>
<parameter
name="radio"
- description="Select radio"
+ description="Select a webradio"
type="enum(BBC2,France-Bleu-Ile-de-France,France-Culture,France-Info,France-Inter,France-Musique,Le-Mouv,RFM,RMC-Info,Click'And'rock)"
defaultValue="France-Inter" />
</parameters>
<commands>
<command
name="run"
- description="Web radio"
+ description="Play the webradio"
daemon="true" />
</commands>
</gadget>
Modified: softwares_suite_v3/community/gadget/tuxdroid-gadget-webradio/trunk/resources/help.html
===================================================================
--- softwares_suite_v3/community/gadget/tuxdroid-gadget-webradio/trunk/resources/help.html 2009-04-18 15:06:54 UTC (rev 4561)
+++ softwares_suite_v3/community/gadget/tuxdroid-gadget-webradio/trunk/resources/help.html 2009-04-18 15:44:44 UTC (rev 4562)
@@ -1,6 +1,6 @@
<html>
<body>
-<font size="2" face="Verdana, Arial, Helvetica, sans-serif">This gadget will make Tux Droid play radio. Drag-and-drop the gadget into "My Favorites" to enable Webradio or into "My Alerts" to enable Clock Radio. <br>
+<font size="2" face="Verdana, Arial, Helvetica, sans-serif">This gadget will make Tux Droid play radio. Drag-and-drop the gadget into "My Favorites" to enable Webradio.<br>
</font>
</body>
</html>
|
Author: remi Date: 2009-04-18 17:06:54 +0200 (Sat, 18 Apr 2009) New Revision: 4561 Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/ softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/branches/ softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/tags/ softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/ softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/build.py softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/ softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/GadgetPackager.py softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/__init__.py softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/util/ softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/util/__init__.py softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/util/misc/ softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/util/misc/DirectoriesAndFilesTools.py softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/util/misc/__init__.py softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/util/misc/version.py softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/version.py softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/ softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/ softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/COPYING.txt softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/ChangeLog.txt softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/README.txt softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/__init__.py softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/audioscrobbler.py softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/bookmarks.txt softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/changestation.py softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/config.py softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/data/ softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/data/album.png softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/data/artist.png softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/data/default.css softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/data/default.html softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/data/favicon.ico softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/data/main.js softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/data/nice_favicon.png softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/data/noalbum_medium.gif softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/data/sidebar.css softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/data/sidebar.html softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/data/song.png softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/httpclient.py softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/lastfm.py softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/main.py softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/playlist.py softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/xspf.py softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/tux-gadget-lastfmradio.py softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/resources/ softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/resources/fr.po softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/resources/gadget.pot softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/resources/gadget.xml softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/resources/help.html softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/resources/lastfmradio.png Log: * added a gadget to play the webradios from Last.fm. Tested on linux and Windows (mplayer must be installed on linux) - You can listening web radios build by Last.fm from a keyword. By example, if you write "metallica", A webradio with songs from Metallica and similar artists will start. - See "http://www.lastfm.fr" Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/build.py =================================================================== --- softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/build.py (rev 0) +++ softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/build.py 2009-04-18 15:06:54 UTC (rev 4561) @@ -0,0 +1,11 @@ +# -*- coding: utf-8 -*- + +# Copyleft (C) 2009 C2ME Sa +# Remi Jocaille <rem...@c2...> +# Distributed under the terms of the GNU General Public License +# http://www.gnu.org/copyleft/gpl.html + +from builder.GadgetPackager import GadgetPackager + +if __name__ == "__main__": + GadgetPackager().createTgf("tuxdroid-gadget-lastfmradio.tgf") Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/build.py ___________________________________________________________________ Name: svn:keywords + Id Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/GadgetPackager.py =================================================================== --- softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/GadgetPackager.py (rev 0) +++ softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/GadgetPackager.py 2009-04-18 15:06:54 UTC (rev 4561) @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- + +import version +__author__ = version.author +__date__ = version.date +__version__ = version.version +__licence__ = version.licence +del version + +# Copyleft (C) 2009 C2ME Sa +# Remi Jocaille <rem...@c2...> +# Distributed under the terms of the GNU General Public License +# http://www.gnu.org/copyleft/gpl.html + +import os +from zipfile import * + +from util.misc.DirectoriesAndFilesTools import * + +# ------------------------------------------------------------------------------ +# Class to create a TGF file from the main directory of a python gadget project. +# ------------------------------------------------------------------------------ +class GadgetPackager(object): + """Class to create a TGF file from the main directory of a python gadget + project. + """ + + # -------------------------------------------------------------------------- + # Create a tgf file. + # -------------------------------------------------------------------------- + def createTgf(self, tgfFileName): + """Create a tgf file. + @param tgfFileName: Tux Gadget Format file name. + @return: The success of the file creation. + """ + self.__sourcePath = os.path.realpath("") + if not os.path.isdir(self.__sourcePath): + return False + if not os.path.isdir(os.path.join(self.__sourcePath, "executables")): + return False + if not os.path.isdir(os.path.join(self.__sourcePath, "resources")): + return False + # Get some paths + SRC_EXECUTABLES_PATH = os.path.join(self.__sourcePath, "executables") + SRC_RESOURCES_PATH = os.path.join(self.__sourcePath, "resources") + TMP_BUILD_PATH = os.path.join(self.__sourcePath, "tmp") + DEST_EXECUTABLES_PATH = os.path.join(TMP_BUILD_PATH, "executables") + DEST_RESOURCES_PATH = os.path.join(TMP_BUILD_PATH, "resources") + DEST_TGF_FILENAME = os.path.join(self.__sourcePath, tgfFileName) + # Create the temporary build path + MKDirsF(TMP_BUILD_PATH) + # Copy "executables" directory + CPDir(SRC_EXECUTABLES_PATH, DEST_EXECUTABLES_PATH) + # Copy "resources" directory + CPDir(SRC_RESOURCES_PATH, DEST_RESOURCES_PATH) + # Filtering the content of temporary path + RMWithFilters(TMP_BUILD_PATH, filters = ['.svn', '.pyc']) + # Create a zip file + directory = TMP_BUILD_PATH + last_cwd = os.getcwd() + os.chdir(TMP_BUILD_PATH) + zf = ZipFile(DEST_TGF_FILENAME, 'w', compression = ZIP_DEFLATED) + def walker(zip, directory, files, root = directory): + for file in files: + file = os.path.join(directory, file) + name = file[len(TMP_BUILD_PATH) + 1:] + if os.path.isfile(file): + zip.write(file, name, ZIP_DEFLATED) + elif os.path.isdir(file): + file = os.path.join(file, "") + name = os.path.join(name, "") + zip.writestr(name, name) + os.path.walk(TMP_BUILD_PATH, walker, zf) + zf.close() + os.chdir(os.path.abspath(last_cwd)) + # Remove the temporary directory + RMDirs(TMP_BUILD_PATH) + return True Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/GadgetPackager.py ___________________________________________________________________ Name: svn:keywords + Id Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/__init__.py =================================================================== Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/__init__.py ___________________________________________________________________ Name: svn:keywords + Id Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/util/__init__.py =================================================================== Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/util/__init__.py ___________________________________________________________________ Name: svn:keywords + Id Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/util/misc/DirectoriesAndFilesTools.py =================================================================== --- softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/util/misc/DirectoriesAndFilesTools.py (rev 0) +++ softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/util/misc/DirectoriesAndFilesTools.py 2009-04-18 15:06:54 UTC (rev 4561) @@ -0,0 +1,161 @@ +# -*- coding: utf-8 -*- + +import version +__author__ = version.author +__date__ = version.date +__version__ = version.version +__licence__ = version.licence +del version + +# Copyleft (C) 2008 Acness World +# Remi Jocaille <rem...@c2...> +# Distributed under the terms of the GNU General Public License +# http://www.gnu.org/copyleft/gpl.html + +import os +import shutil + +if os.name == 'nt': + import win32con + import win32file + +# ============================================================================== +# Public functions +# ============================================================================== + +# ------------------------------------------------------------------------------ +# Force to create a directories tree if not exists. +# ------------------------------------------------------------------------------ +def MKDirs(path): + """Force to create a directories tree if not exists. + @param path: Directory path. + """ + if not os.path.isdir(path): + try: + os.makedirs(path) + except: + pass + +# ------------------------------------------------------------------------------ +# Force to create a directories tree after having deleted the old one. +# ------------------------------------------------------------------------------ +def MKDirsF(path): + """Force to create a directories tree after having deleted the old one. + @param path: Directory path. + """ + if os.path.isdir(path): + RMDirs(path) + os.makedirs(path) + +# ------------------------------------------------------------------------------ +# Remove directories and files recursively. +# ------------------------------------------------------------------------------ +def RMDirs(path): + """Remove directories and files recursively. + @param path: Path of the base directory. + """ + if not os.path.isdir(path): + return + for root, dirs, files in os.walk(path, topdown = False): + for d in dirs: + try: + os.removedirs(os.path.join(root, d)) + except: + pass + for f in files: + try: + if os.name == 'nt': + win32file.SetFileAttributesW(os.path.join(root, f), + win32con.FILE_ATTRIBUTE_NORMAL) + os.remove(os.path.join(root, f)) + except: + pass + if os.path.isdir(path): + try: + os.removedirs(path) + except: + pass + +# ------------------------------------------------------------------------------ +# Remove directories and files recursively with filters. +# ------------------------------------------------------------------------------ +def RMWithFilters(path, filters = ['.pyc', '.pyo']): + """Remove directories and files recursively with filters. + @param path: Path of the base directory. + @param filters: Filters as list. + """ + def checkFilter(name): + for filter in filters: + if name.lower().find(filter.lower()) == (len(name) - len(filter)): + return True + return False + + if not os.path.isdir(path): + return + + for root, dirs, files in os.walk(path, topdown = False): + for d in dirs: + if checkFilter(os.path.join(root, d)): + try: + RMDirs(os.path.join(root, d)) + except: + pass + for f in files: + if checkFilter(os.path.join(root, f)): + try: + if os.name == 'nt': + win32file.SetFileAttributesW(os.path.join(root, f), + win32con.FILE_ATTRIBUTE_NORMAL) + os.remove(os.path.join(root, f)) + except: + pass + +# ------------------------------------------------------------------------------ +# Remove a file. +# ------------------------------------------------------------------------------ +def RMFile(path): + """Remove a file. + @param path: File path. + """ + if os.path.isfile(path): + try: + if os.name == 'nt': + win32file.SetFileAttributesW(path, + win32con.FILE_ATTRIBUTE_NORMAL) + os.remove(path) + except: + pass + +# ------------------------------------------------------------------------------ +# Copy a directories tree to another directory. +# ------------------------------------------------------------------------------ +def CPDir(src, dest): + """Copy a directories tree to another directory. + @param src: Source path. + @param dest: Destination path. + """ + if not os.path.isdir(src): + return + if os.path.isdir(dest): + RMDirs(dest) + shutil.copytree(src, dest) + +# ------------------------------------------------------------------------------ +# Retrieve the OS temporary directory. +# ------------------------------------------------------------------------------ +def GetOSTMPDir(): + """Retrieve the OS temporary directory. + @return: The OS temporary directory. + """ + result = None + # On Windows + if os.name == 'nt': + result = os.environ.get('tmp') + if result == None: + result = os.environ.get('temp') + if result == None: + result = "c:\\windows\\temp" + # On linux + else: + result = "/tmp" + return result Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/util/misc/DirectoriesAndFilesTools.py ___________________________________________________________________ Name: svn:keywords + Id Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/util/misc/__init__.py =================================================================== Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/util/misc/__init__.py ___________________________________________________________________ Name: svn:keywords + Id Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/util/misc/version.py =================================================================== --- softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/util/misc/version.py (rev 0) +++ softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/util/misc/version.py 2009-04-18 15:06:54 UTC (rev 4561) @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- + +"""Version data for tuxisalive.lib.Util""" + +__author__ = "Remi Jocaille (rem...@c2...)" + +# Copyleft (C) 2008 C2ME Sa +# Remi Jocaille <rem...@c2...> +# Distributed under the terms of the GNU General Public License +# http://www.gnu.org/copyleft/gpl.html + +name = 'util.misc' +version = '0.0.1' +author = "Remi Jocaille (rem...@c2...)" + +description = "Utilities libraries." + +licence = "GPL" +date = "December 2008" Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/util/misc/version.py ___________________________________________________________________ Name: svn:keywords + Id Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/version.py =================================================================== --- softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/version.py (rev 0) +++ softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/version.py 2009-04-18 15:06:54 UTC (rev 4561) @@ -0,0 +1,9 @@ +# Copyleft (C) 2009 C2ME Sa +# Remi Jocaille <rem...@c2...> +# Distributed under the terms of the GNU General Public License +# http://www.gnu.org/copyleft/gpl.html + +version = '0.0.1' +author = "Remi Jocaille (rem...@c2...)" +licence = "GPL" +date = "2009" Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/builder/version.py ___________________________________________________________________ Name: svn:keywords + Id Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/COPYING.txt =================================================================== --- softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/COPYING.txt (rev 0) +++ softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/COPYING.txt 2009-04-18 15:06:54 UTC (rev 4561) @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) 19yy <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/COPYING.txt ___________________________________________________________________ Name: svn:keywords + Id Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/ChangeLog.txt =================================================================== --- softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/ChangeLog.txt (rev 0) +++ softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/ChangeLog.txt 2009-04-18 15:06:54 UTC (rev 4561) @@ -0,0 +1,142 @@ +2007-12-20: +- Released v1.3b +- More code page fixes. +- It's now possible to turn off recording to profile. + +2007-12-19: +- Released v1.3 +- Try different stations on playlist errors. + +2007-12-17: +- Configurable bind address, thanks to Romain Beauxis. + +2007-12-13: +- Added new audioscrobbler module; recording to profile works again + +2007-12-10: +- Added .pls playlist serving (http://localhost:port/lastfm.pls) +- More charset fixes + +2007-12-07: +- Removed old metadata cruft; all is now taken from the playlist +- A lot of robustness improvements, thanks to Morty for many of them! +- Removed "discovery mode" for now, as it seems to have no effect + +2007-11-23: +- Better UTF-8 handing in xspf.py - Thanks again, Artur. :) +- More error resilience +- Some debug options +- Removed superfluous "hashlib" requirement. + +2007-11-22: +- Released v1.2 +- Switched to XSPF playlists - thanks to Artur for the xspf.py module. + +2006-07-17: +- Released v1.1 final +- Fixed correct metadata host and track progress + +2005-12-12: +- Released v1.1alpha5 +- Cache related fixes; Send "no-cache" HTTP headers, and use "Temporary Redirect" + instead of "Moved Permanently". (Thanks to Jajcus for the tip on that one.) + +2005-12-10: +- Use local copy of "nocover" image + related fix +- Don't strip "SYNC" markers any more + +2005-10-11: +- Released v1.1alpha4 +- Fixed handling of port-less "stream_url" (thanks to jgarrett) + +2005-09-18: +- Released v1.1alpha3 +- Fixed pasting of station-URLs (thanks to vitalyb and mad_goldfish) + +2005-09-09: +- Set "reuseaddr" flag on the socket to avoid "address in use" errors (thanks + to Peter Russel!) + +2005-08-30: +- Made transparent PNGs look nice in MSIE, finally + +2005-08-29: +- Released v1.1alpha2 +- Keyboard shortcuts + several small improvements (thanks to Ben Winslow!) +- Better error handling when talking to the server (thanks to Craig Nicol!) + +2005-08-26: +- Released v1.1alpha1 +- Better backwards compatibility (thanks to Craig Nicol / mad_goldfish!) +- Proper thread handling + +2005-08-24: +- Use "bookmarks.txt" for bookmarks (instead of "stations.txt") +- New javascript-based GUI +- Links for "similar" and "fans" stations + +2005-08-23: +- Released v1.0.2 +- Very basic run-time theme selection ("http://.../settheme/sidebar") +- Include favicon and noalbum images instead of linking to the server +- Added "Record to profile" and "Discovery mode" checkboxes + +2005-08-21: +- Released v1.0.1 +- Open data files in binary mode + +2005-08-20: +- Released v1.0 +- Added a vertically oriented "sidebar" theme +- Moved the default GUI and stylesheet (default.html and .css) into own files + +2005-08-19: +- Released v1.0beta3 +- Show last played tracks + +2005-08-18: +- Refresh when starting radio (and also while not streaming) + +2005-08-17: +- Be paranoid about received metadata (hopefully avoid some crashes) +- Use target="_self" for own links + +2005-08-17: +- Released v1.0beta2 +- Fixed crash when starting without a bookmarks file (stations.txt) +- Fixed jumpy track time display after clicking a button +- Hopefully work around dodgy stream titles + +2005-08-17: +- Released v1.0beta1 + +2005-08-16: +- Store 10 last used stations in a "bookmark" pulldown +- New changestation.py script (for handling lastfm://station links) +- Replaced random listen port with configurable port +- Work-around for a bug when there's no album link +- Display artist and track name in window title / taskbar +- Basic proxy authentication support + +2005-08-16: +- Released v0.1alpha3 +- Proxy support +- Handle metadata with no "albumcover_medium" + +2005-08-15: +- Released v0.1alpha2 +- Fix channel selection on stream startup +- Proper display of track time / duration +- Some frames testing + +2005-08-15: +- Released v0.1alpha +- Web-server cleanups, imitate last.fm's design + +2005-08-13: +- Added integrated webserver for controlling the stream + +2005-08-12: +- Project started +- First working implementation + Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/ChangeLog.txt ___________________________________________________________________ Name: svn:keywords + Id Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/README.txt =================================================================== --- softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/README.txt (rev 0) +++ softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/README.txt 2009-04-18 15:06:54 UTC (rev 4561) @@ -0,0 +1,128 @@ +LastFMProxy v1.3 +(c) 2005-2007 Vidar Madsen + + +1. Introduction + +LastFMProxy is a proxy server for the last.fm radio streams. It allows you +to use your regular old audio player to listen to the last.fm streams. It +does this by acting as a player itself, connecting to the server on your +behalf, but instead of playing the stream, it simply relays it to +whichever other application connecting to it. + + +2. Basic usage + +First, make sure you have a Python environment installed. You might have +one already, but if not, go to http://www.python.org/ftp/python/ and +download one suitable for your operating system. (If you're using a +Windows operating system, you will need to get Windows Installer to +install Python.) + +Now, uncompress and unpack the archive file. In Unix-like operating systems, +you can do this by running the command: + tar xvzf lastfmproxy.tar.gz + +Under Windows, WinZip or a similar compression tool should do fine. + +Now go into the directory "lastfmproxy", and modify the file "config.py" +and set our last.fm login and password. If you need (or want) to use an +external proxy for web access, you must set also set useproxy to "True", +and set the proxy host name and port. + +The config file has a "bind_address" options, which tells the proxy which +network interface to listen on. The default is to bind only to the localhost +interface (127.0.0.1). If you want to be reach the proxy from other hosts +on the network, change this to either the machine's IP address or just use +"0.0.0.0", which binds it to all interfaces available. Note that this is +potentially less secure than binding only to the localhost IP, though. + +Now you can start the proxy. This is done by simply running "main.py". +It will then show the URL at which you must aim your player. Mark and +copy this URL to your clipboard or similar. + +Finally, fire up your web browser of choice. Select "Open location" or +something similar, and paste the URL there. You should see the proxy +status page, vaguely resembling the last.fm player. Click "Start radio", +and you're done! (You can also bookmark the URL in your browser for next +time, to save you a little bit of work.) + +By default, the server starts playing your last station (or your "musical +neighbours" station, if it couldn't be determined for some reason). + +Normally you will want to use the "changestation" script to change channels +(see paragraph below). If not, you can use the web interface directly. The +web interface is not perfect, but it's not too hard to do manually. To play +another station, you can simply modify the browser URL; Just append the +"lastfm:" station address directly to your proxy URL. + +Some example URLs; + http://localhost:1881/lastfm://globaltags/rock + http://localhost:1881/lastfm://artist/Madonna/similarartists + http://localhost:1881/lastfm://user/vidarino/neighbours + +You should get the picture. :) One thing, though; when you're editing URLs, +make sure you replace spaces with "%20" (e.g. "hiphop" becomes "hip%20hop".) +The easiest shortcut is to browse the last.fm site, and "Copy link location" +when you see a station you like, and simply paste it at the end of the +browser location in the proxy window. + +Also, whenever you change stations, they will be added to the station history +pulldown menu in the lower right, where they quickly and easily can be fetched +again. + +Note; You can also select a station directly when starting the player. Just +open an URL on the form "http://localhost:1881/globaltags/jazz.m3u" to start +streaming *and* select a station at the same time. + +This is particularly useful if you don't have a browser at all, and just want +to listen to music. Under Linux, using mplayer, you can listen to any channel +by starting the proxy, then launch: + mplayer -playlist "http://localhost:1881/globaltags/metal.m3u" + + +3. Configuring the changestation.py script (Mozilla Firefox only) + +Here's how to make the lastfm://station links work: + +- In Firefox, open the location "about:config" +- Right-click, select "New String" +- As name, enter "network.protocol-handler.app.lastfm", "OK" +- As value, enter the full path to the included "changestation.py" script + (e.g. "C:\Program Files\lastfmproxy\changestation.py"), then "OK" + +That should do the trick. Now, when you click on station link on the last.fm +site, the proxy should catch on and start playing your selection in a few +seconds. + + +4. Caveats + +Nothing is perfect. Here are some things you should know: + +- The author has only tested it under Linux. But user feedback seems to +indicate success under various Windows versions and Mac OS X. + +- It is probably full of bugs. Hopefully the most annoying of these can get +stomped out eventually. + +- The Record to Profile and Discovery Mode checkboxes lag. RTP will take a +few seconds to toggle, while Discovery will not update until the next song +change. This is a known issue, but I'm not sure about the right way to fix +it (if at all). The checkboxes reflect what the server reports about its +current status, and not what it will do in the future. + + +5. Troubleshooting + +I can't promise much support, but feedback is always welcome. + +You can drop me a message on last.fm (nick "vidarino"), or send me +a mail at "vidarino at gmail dot com". + +Also, there's now a LastFMProxy group on the last.fm site. Feel free to +join us: + http://www.last.fm/group/LastFMProxy + + + Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/README.txt ___________________________________________________________________ Name: svn:keywords + Id Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/__init__.py =================================================================== Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/__init__.py ___________________________________________________________________ Name: svn:keywords + Id Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/audioscrobbler.py =================================================================== --- softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/audioscrobbler.py (rev 0) +++ softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/audioscrobbler.py 2009-04-18 15:06:54 UTC (rev 4561) @@ -0,0 +1,134 @@ + +import httpclient +import time +import string +import md5 + +class audioscrobbler: + + def __init__(self): + self.clientid = "lfp" + self.clientversion = "0.1" + + self.handshakeurl = "post.audioscrobbler.com" + + # Saved here in case we need to re-handshake later + self.username = None + self.password = None + self.version = None + + self.session = None + self.nowplayingurl = None + self.submiturl = None + + self.queue = [] + + self.debug = 0 + + def hexify(self, s): + result = "" + for c in s: + result = result + ("%02x" % ord(c)) + return result + + def urlencode(self, s): + result = "" + for c in s: + o = ord(c) + if (o >= ord('a') and o <= ord('z')) or (o >= ord('A') and o <= ord('Z')) or (o >= ord('0') and o <= ord('1')): + result = result + c + else: + result = result + ("%%%02x" % o) + return result + + def handshake(self, username, password, version): + + self.username = username + self.password = password + + timestamp = str(int(time.time())) + auth = self.hexify(md5.md5(password).digest()) + auth = self.hexify(md5.md5(auth + timestamp).digest()) + req = "/?hs=true&p=1.2&c=" + self.clientid + "&v=" + self.clientversion + "&u=" + username + "&t=" + timestamp + "&a=" + auth + + s = httpclient.httpclient(self.handshakeurl) + s.req(req) + reslines = string.split(s.response, "\n") + + if self.debug: + print "audioscrobbler: handshake " + reslines[0] + + if reslines[0] != "OK": + print "audioscrobbler: Handshake error:" + print repr(s.response) + return True + + self.session = reslines[1] + self.nowplayingurl = reslines[2] + self.submiturl = reslines[3] + return False + + def nowplaying(self, artist, track, album, length): + if not self.session: + return True + + if self.debug: + print "audioscrobbler: now playing " + artist + " - " + track + + artist = self.urlencode(artist) + track = self.urlencode(track) + album = self.urlencode(album) + + req = "s=" + self.session + "&a=" + artist + "&t=" + track + "&b=" + album + "&l=" + str(length) + "&m=" + + s = httpclient.httpclient(self.nowplayingurl) + s.post(req) + reslines = string.split(s.response, "\n") + + if reslines[0] != "OK": + print "audioscrobbler: Now playing error:" + print repr(s.response) + + if reslines[0] == "BADSESSION": + self.session = None + + return True + + return False + + def submit(self, artist, track, album, starttime, rating, length, key): + if not self.session: + return True + + if self.debug: + print "audioscrobbler: submitting " + artist + " - " + track + + artist = self.urlencode(artist) + track = self.urlencode(track) + album = self.urlencode(album) + + req = "s=" + self.session + "&a[0]=" + artist + "&t[0]=" + track + "&b[0]=" + album + "&r[0]=" + rating + "&i[0]=" + str(starttime) + "&l[0]=" + str(length) + "&o[0]=L" + key + "&n[0]=&m[0]=" + + s = httpclient.httpclient(self.submiturl) + s.post(req) + reslines = string.split(s.response, "\n") + + if reslines[0] != "OK": + print "audioscrobbler: Submission error:" + print repr(s.response) + + if reslines[0] == "BADSESSION": + self.session = None + + self.queue.append( (artist,track,album,starttime,rating,length,key) ) + + f = open("scrobblerqueue.txt", "w") + f.write(repr(self.queue)) + f.close() + + return True + + return False + + + Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/audioscrobbler.py ___________________________________________________________________ Name: svn:keywords + Id Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/bookmarks.txt =================================================================== --- softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/bookmarks.txt (rev 0) +++ softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/bookmarks.txt 2009-04-18 15:06:54 UTC (rev 4561) @@ -0,0 +1,5 @@ +lastfm://artist/Oasis +lastfm://artist/Korn/similarartists +lastfm://artist/Madonna/similarartists +lastfm://globaltags/cranberries +lastfm://globaltags/metal Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/bookmarks.txt ___________________________________________________________________ Name: svn:keywords + Id Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/changestation.py =================================================================== --- softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/changestation.py (rev 0) +++ softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/changestation.py 2009-04-18 15:06:54 UTC (rev 4561) @@ -0,0 +1,9 @@ +#!/usr/bin/python + +import sys +import config +import httpclient + +s = httpclient.httpclient("localhost", config.listenport) +s.req("/" + sys.argv[1]) + Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/changestation.py ___________________________________________________________________ Name: svn:keywords + Id Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/config.py =================================================================== --- softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/config.py (rev 0) +++ softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/config.py 2009-04-18 15:06:54 UTC (rev 4561) @@ -0,0 +1,22 @@ + +# Port and address to listen to +listenport = 1881 +bind_address = "127.0.0.1" + +# Stick your last.fm username and password between the quotes below. +username = "" +password = "" + +# Which theme (skin) to use +theme = "sidebar" + +# Change "useproxy" to True and set the host and port if +# you need an external proxy. +useproxy = False +proxyhost = "my.proxy.host" +proxyport = 8000 +# Set these if your proxy requires authentication. +# Note: Only "Basic" authentication is supported. +proxyuser = "" +proxypass = "" + Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/config.py ___________________________________________________________________ Name: svn:keywords + Id Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/data/album.png =================================================================== (Binary files differ) Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/data/album.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Name: svn:keywords + Id Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/data/artist.png =================================================================== (Binary files differ) Property changes on: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/data/artist.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Name: svn:keywords + Id Added: softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/data/default.css =================================================================== --- softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/data/default.css (rev 0) +++ softwares_suite_v3/community/gadget/tuxdroid-gadget-lastfmradio/trunk/executables/lastfmproxy/data/default.css 2009-04-18 15:06:54 UTC (rev 4561) @@ -0,0 +1,89 @@ +body { + font-family: sans-serif; + margin: 0; +} +div { + white-space: nowrap; +} +#lfmp { + padding: 0; + background: #E3E6D8; +} +#lfmp-cover { + float: left; + padding: 10px; +} +#lfmp-header { + background: #91998e; + color: white; + font-weight: bold; + padding: 5px; +} +#lfmp-header a { + color: white; +} +#lfmp-version { + float: right; + padding: 0; + font-weight: normal; + font-size: small; +} +#lfmp-main { + color: black; +} +#lfmp-main a { + color: black; +} +#lfmp-main img { + padding-right: 5px; + vertical-align: bottom; +} +#lfmp-trackinfo { + padding: 10px; +} +#lfmp-trackinfo div { + padding: 5px; +} +#lfmp-artiststations { + font-size: small; + color: #91998e; +} +#lfmp-artiststations a { + color: #91998e; +} +#lfmp-footer { + background: #d20039; + color: white; + clear: both; + padding: 5px; +} +#lfmp-footer a { + color: white; +} +#lfmp-bookmarks { + float: right; + padding: 0; + font-size: small; +} +#lfmp-lasttracks { + float: right; + padding: 5px; + color: #91998e; + font-weight: bold; +} +#lfmp-lasttracks a { + color: #91998e; +} +#lfmp-lasttracks ul { + margin-top: 0px; + margin-left: 16px; + padding: 0px; + font-weight: normal; + font-size: small; +... [truncated message content] |
|
From: remi <c2m...@c2...> - 2009-04-18 14:59:14
|
Author: remi
Date: 2009-04-18 16:58:59 +0200 (Sat, 18 Apr 2009)
New Revision: 4560
Modified:
softwares_suite_v3/kysoh/tuxware/server/trunk/util/player/mplayer/Mplayer.py
Log:
* added a callback on stream loosed event
Modified: softwares_suite_v3/kysoh/tuxware/server/trunk/util/player/mplayer/Mplayer.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/server/trunk/util/player/mplayer/Mplayer.py 2009-04-18 14:09:16 UTC (rev 4559)
+++ softwares_suite_v3/kysoh/tuxware/server/trunk/util/player/mplayer/Mplayer.py 2009-04-18 14:58:59 UTC (rev 4560)
@@ -35,6 +35,7 @@
self.__device = Device.getTuxDroidSoundDevice()
self.__media = None
self.__isAsync = False
+ self.onStreamLoosedCallback = None
# --------------------------------------------------------------------------
# Start mplayer.
@@ -166,6 +167,8 @@
if len(buffer) == 0:
# 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")
|
|
From: remi <c2m...@c2...> - 2009-04-18 14:09:38
|
Author: remi
Date: 2009-04-18 16:09:16 +0200 (Sat, 18 Apr 2009)
New Revision: 4559
Modified:
softwares_suite_v3/kysoh/tuxware/server/trunk/util/scheduler/Scheduler.py
Log:
* added a missing method ...
Modified: softwares_suite_v3/kysoh/tuxware/server/trunk/util/scheduler/Scheduler.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/server/trunk/util/scheduler/Scheduler.py 2009-04-18 12:24:11 UTC (rev 4558)
+++ softwares_suite_v3/kysoh/tuxware/server/trunk/util/scheduler/Scheduler.py 2009-04-18 14:09:16 UTC (rev 4559)
@@ -292,6 +292,23 @@
return result
# --------------------------------------------------------------------------
+ # Get a task by its name.
+ # --------------------------------------------------------------------------
+ def getTaskByName(self, taskName):
+ """Get a task by its name.
+ @param taskName: Task name.
+ @return: The task object.
+ """
+ task = None
+ self.__tasksToExecuteStackMutex.acquire()
+ for taskInfo in self.__tasksToExecuteStack:
+ if taskInfo[TASK_NAME] == taskName:
+ task = taskInfo[TASK_OBJECT]
+ break
+ self.__tasksToExecuteStackMutex.release()
+ return task
+
+ # --------------------------------------------------------------------------
# Remove a task from the scheduler by its identifier.
# --------------------------------------------------------------------------
def removeTaskById(self, taskId):
|
|
From: remi <c2m...@c2...> - 2009-04-18 12:24:16
|
Author: remi
Date: 2009-04-18 14:24:11 +0200 (Sat, 18 Apr 2009)
New Revision: 4558
Modified:
softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/TuxAPI.py
softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/tuxdroid/AttituneManager.py
softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/tuxdroid/Framework.py
softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/tuxdroid/Scheduler.py
Log:
* added methods to wait that the containers has been loaded
Modified: softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/TuxAPI.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/TuxAPI.py 2009-04-18 12:23:40 UTC (rev 4557)
+++ softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/TuxAPI.py 2009-04-18 12:24:11 UTC (rev 4558)
@@ -120,6 +120,16 @@
# Scheduler bindings
self.showTasks = self.scheduler.getTasksContainer().showTasks
self.getTask = self.scheduler.getTasksContainer().getTask
+ # User method bind
+ def userWaitLoaded():
+ ret = self.framework.waitLoaded(5.0, 0.0)
+ if not ret:
+ return False
+ ret = self.attitunes.waitLoaded(5.0, 0.0)
+ if not ret:
+ return False
+ return self.scheduler.waitLoaded(5.0, 1.0)
+ self.user.waitLoaded = userWaitLoaded
# --------------------------------------------------------------------------
# Get the version of this API.
Modified: softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/tuxdroid/AttituneManager.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/tuxdroid/AttituneManager.py 2009-04-18 12:23:40 UTC (rev 4557)
+++ softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/tuxdroid/AttituneManager.py 2009-04-18 12:24:11 UTC (rev 4558)
@@ -63,3 +63,16 @@
ret, result = self._sendCommandFullResultEx(cmd)
if ret:
self.__attitunesContainer._update(result)
+
+ # --------------------------------------------------------------------------
+ # Wait that the attitunes was loaded.
+ # --------------------------------------------------------------------------
+ def waitLoaded(self, timeout = 10.0, absDelay = 1.0):
+ """Wait that the attitunes was loaded.
+ @param timeout: Maximal time to wait.
+ @return: True or False.
+ """
+ ret = self._waitFor(ST_NAME_AM_CONTAINER_DEPLOYED, "True", timeout)
+ if ret:
+ time.sleep(absDelay)
+ return ret
Modified: softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/tuxdroid/Framework.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/tuxdroid/Framework.py 2009-04-18 12:23:40 UTC (rev 4557)
+++ softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/tuxdroid/Framework.py 2009-04-18 12:24:11 UTC (rev 4558)
@@ -75,3 +75,16 @@
result[key]['description']['help_file'])
gadgetsStruct[key] = result[key]
self.__gadgetsContainer._update(gadgetsStruct)
+
+ # --------------------------------------------------------------------------
+ # Wait that the gadgets was loaded.
+ # --------------------------------------------------------------------------
+ def waitLoaded(self, timeout = 10.0, absDelay = 1.0):
+ """Wait that the gadgets was loaded.
+ @param timeout: Maximal time to wait.
+ @return: True or False.
+ """
+ ret = self._waitFor(ST_NAME_FW_CONFIGURATIONS_LOADED, "True", timeout)
+ if ret:
+ time.sleep(absDelay)
+ return ret
Modified: softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/tuxdroid/Scheduler.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/tuxdroid/Scheduler.py 2009-04-18 12:23:40 UTC (rev 4557)
+++ softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/tuxdroid/Scheduler.py 2009-04-18 12:24:11 UTC (rev 4558)
@@ -3,11 +3,12 @@
# Distributed under the terms of the GNU General Public License
# http://www.gnu.org/copyleft/gpl.html
+import time
+
from const.ConstScheduler import *
from tuxisalive.api.scheduler.TasksContainer import TasksContainer
from tuxisalive.api.base.ApiBaseChildResource import ApiBaseChildResource
-
# ------------------------------------------------------------------------------
# Class to control the scheduler.
# ------------------------------------------------------------------------------
@@ -62,3 +63,16 @@
ret, result = self._sendCommandFullResultEx(cmd)
if ret:
self.__tasksContainer._update(result)
+
+ # --------------------------------------------------------------------------
+ # Wait that the tasks was loaded.
+ # --------------------------------------------------------------------------
+ def waitLoaded(self, timeout = 10.0, absDelay = 1.0):
+ """Wait that the tasks was loaded.
+ @param timeout: Maximal time to wait.
+ @return: True or False.
+ """
+ ret = self._waitFor(ST_NAME_SCM_TASKS_LOADED, "True", timeout)
+ if ret:
+ time.sleep(absDelay)
+ return ret
|
|
From: remi <c2m...@c2...> - 2009-04-18 12:23:49
|
Author: remi
Date: 2009-04-18 14:23:40 +0200 (Sat, 18 Apr 2009)
New Revision: 4557
Modified:
softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/attitunes/AttitunesContainer.py
softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/gadgets/GadgetsContainer.py
softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/scheduler/TasksContainer.py
Log:
* fixed attitunes, gadgets and task order by name.
Modified: softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/attitunes/AttitunesContainer.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/attitunes/AttitunesContainer.py 2009-04-18 12:21:36 UTC (rev 4556)
+++ softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/attitunes/AttitunesContainer.py 2009-04-18 12:23:40 UTC (rev 4557)
@@ -27,7 +27,6 @@
ApiBaseChildResource.__init__(self, apiBase, apiBaseServer)
self.__mutex = threading.Lock()
self.__attitunes = []
- self._update(structure)
# --------------------------------------------------------------------------
# Update the container structure.
@@ -38,10 +37,16 @@
"""
self.__mutex.acquire()
self.__attitunes = []
- for key in structure.keys():
- if key.lower().find('data') == 0:
- self.__attitunes.append(Attitune(self.getParent(),
- self.getServer(), self, structure[key]))
+ keys = structure.keys()
+ keys.remove("result")
+ for i, key in enumerate(keys):
+ keys[i] = "%.3d" % int(key.replace("data", ""))
+ keys.sort()
+ for i, key in enumerate(keys):
+ keys[i] = "data%d" % int(key)
+ for key in keys:
+ self.__attitunes.append(Attitune(self.getParent(),
+ self.getServer(), self, structure[key]))
self.__mutex.release()
# --------------------------------------------------------------------------
Modified: softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/gadgets/GadgetsContainer.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/gadgets/GadgetsContainer.py 2009-04-18 12:21:36 UTC (rev 4556)
+++ softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/gadgets/GadgetsContainer.py 2009-04-18 12:23:40 UTC (rev 4557)
@@ -28,7 +28,7 @@
self.__locutor = "Ryan"
self.__pitch = 130
self.__mutex = threading.Lock()
- self._update(structure)
+ self.__gadgets = []
# --------------------------------------------------------------------------
# Get the current container language.
@@ -87,7 +87,13 @@
"""
self.__mutex.acquire()
self.__gadgets = []
- for key in structure.keys():
+ keys = structure.keys()
+ for i, key in enumerate(keys):
+ keys[i] = "%.3d" % int(key.replace("data", ""))
+ keys.sort()
+ for i, key in enumerate(keys):
+ keys[i] = "data%d" % int(key)
+ for key in keys:
self.__gadgets.append(Gadget(self.getParent(), self.getServer(), self,
structure[key]))
if len(self.__gadgets) > 0:
Modified: softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/scheduler/TasksContainer.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/scheduler/TasksContainer.py 2009-04-18 12:21:36 UTC (rev 4556)
+++ softwares_suite_v3/kysoh/tuxware/api/python/trunk/tuxisalive/api/scheduler/TasksContainer.py 2009-04-18 12:23:40 UTC (rev 4557)
@@ -25,7 +25,6 @@
ApiBaseChildResource.__init__(self, apiBase, apiBaseServer)
self.__tasks = []
self.__mutex = threading.Lock()
- self._update(structure)
# --------------------------------------------------------------------------
# Update the container structure.
@@ -36,10 +35,16 @@
"""
self.__mutex.acquire()
self.__tasks = []
- for key in structure.keys():
- if key.lower().find('data') == 0:
- self.__tasks.append(Task(self.getParent(),
- self.getServer(), self, structure[key]))
+ keys = structure.keys()
+ keys.remove("result")
+ for i, key in enumerate(keys):
+ keys[i] = "%.3d" % int(key.replace("data", ""))
+ keys.sort()
+ for i, key in enumerate(keys):
+ keys[i] = "data%d" % int(key)
+ for key in keys:
+ self.__tasks.append(Task(self.getParent(),
+ self.getServer(), self, structure[key]))
self.__mutex.release()
# --------------------------------------------------------------------------
|
|
From: remi <c2m...@c2...> - 2009-04-18 12:22:02
|
Author: remi
Date: 2009-04-18 14:21:36 +0200 (Sat, 18 Apr 2009)
New Revision: 4556
Modified:
softwares_suite_v3/kysoh/tuxware/server/trunk/resources/01_robot_system/resourceAttituneManager.py
softwares_suite_v3/kysoh/tuxware/server/trunk/resources/01_robot_system/resourceGadgetFramework.py
softwares_suite_v3/kysoh/tuxware/server/trunk/resources/01_robot_system/resourceScheduler.py
Log:
* fixed attitunes, gadgets and task order by name.
Modified: softwares_suite_v3/kysoh/tuxware/server/trunk/resources/01_robot_system/resourceAttituneManager.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/server/trunk/resources/01_robot_system/resourceAttituneManager.py 2009-04-18 09:44:05 UTC (rev 4555)
+++ softwares_suite_v3/kysoh/tuxware/server/trunk/resources/01_robot_system/resourceAttituneManager.py 2009-04-18 12:21:36 UTC (rev 4556)
@@ -336,8 +336,13 @@
contentStruct = self.getDefaultContentStruct()
contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
attitunes = resourceAttituneManager.getAttitunesContainer().getAttitunes()
- for i, attitune in enumerate(attitunes):
- d_name = "data|%d" % i
+ attitunesNameList = []
+ for attitune in attitunes:
+ attitunesNameList.append(attitune.getDescription().getName())
+ attitunesNameList.sort()
+ for i, attituneName in enumerate(attitunesNameList):
+ attitune = resourceAttituneManager.getAttitunesContainer().getAttitune(attituneName)
+ d_name = "data|%.3d" % i
structure = attitune.getDescription().getDictionary()
contentStruct['root'][d_name] = structure
return headersStruct, contentStruct
Modified: softwares_suite_v3/kysoh/tuxware/server/trunk/resources/01_robot_system/resourceGadgetFramework.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/server/trunk/resources/01_robot_system/resourceGadgetFramework.py 2009-04-18 09:44:05 UTC (rev 4555)
+++ softwares_suite_v3/kysoh/tuxware/server/trunk/resources/01_robot_system/resourceGadgetFramework.py 2009-04-18 12:21:36 UTC (rev 4556)
@@ -502,12 +502,16 @@
contentStruct = self.getDefaultContentStruct()
contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
gadgets = resourceGadgetFramework.getGadgetsContainer().getGadgets()
- for i, gadget in enumerate(gadgets):
- d_name = "data|%d" % i
+ gadgetsNameList = []
+ for gadget in gadgets:
+ gadgetsNameList.append(gadget.getDescription().getName())
+ gadgetsNameList.sort()
+ for i, gadgetName in enumerate(gadgetsNameList):
+ gadget = resourceGadgetFramework.getGadgetsContainer().getGadgetByName(gadgetName)
+ d_name = "data|%.3d" % i
structure = WebGadgetTools.generateWebGadgetStructure(gadget,
'/gadget_framework/web_gadget?',
gadget.getDefaultRunCommandName(), {})
- #del structure['command']
structure['commands'] = {}
for j, command in enumerate(gadget.getCommands()):
c_name = "command_%.3d" % j
Modified: softwares_suite_v3/kysoh/tuxware/server/trunk/resources/01_robot_system/resourceScheduler.py
===================================================================
--- softwares_suite_v3/kysoh/tuxware/server/trunk/resources/01_robot_system/resourceScheduler.py 2009-04-18 09:44:05 UTC (rev 4555)
+++ softwares_suite_v3/kysoh/tuxware/server/trunk/resources/01_robot_system/resourceScheduler.py 2009-04-18 12:21:36 UTC (rev 4556)
@@ -324,8 +324,13 @@
contentStruct = self.getDefaultContentStruct()
contentStruct['root']['result'] = getStrError(E_TDREST_SUCCESS)
tasks = resourceScheduler.getScheduler().getTasks()
- for i, task in enumerate(tasks):
- d_name = "data|%d" % i
+ tasksNameList = []
+ for task in tasks:
+ tasksNameList.append(task.getDescription().getName())
+ tasksNameList.sort()
+ for i, taskName in enumerate(tasksNameList):
+ task = resourceScheduler.getScheduler().getTaskByName(taskName)
+ d_name = "data|%.3d" % i
struct = task.getDictionary()
contentStruct['root'][d_name] = struct
return headersStruct, contentStruct
|