[tuxdroid-svn] r878 - in software/gadgets: . weather weather/trunk weather/trunk/Weather weather/tr
Status: Beta
Brought to you by:
ks156
From: Paul_R <c2m...@c2...> - 2008-01-24 14:37:29
|
Author: Paul_R Date: 2008-01-24 15:37:28 +0100 (Thu, 24 Jan 2008) New Revision: 878 Added: software/gadgets/weather/ software/gadgets/weather/branches/ software/gadgets/weather/tags/ software/gadgets/weather/trunk/ software/gadgets/weather/trunk/Weather.tgf software/gadgets/weather/trunk/Weather/ software/gadgets/weather/trunk/Weather/Pictures/ software/gadgets/weather/trunk/Weather/Pictures/Icons/ software/gadgets/weather/trunk/Weather/Pictures/Icons/gadget.png software/gadgets/weather/trunk/Weather/Scripts/ software/gadgets/weather/trunk/Weather/Scripts/Python/ software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/ software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/conf/ software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/conf/other.glade software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/conf/other.pyp software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/widget/ software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/widget/other.glade software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/widget/other.pyp software/gadgets/weather/trunk/Weather/Scripts/Python/init.pyp software/gadgets/weather/trunk/Weather/Scripts/Python/main.pyp software/gadgets/weather/trunk/Weather/Scripts/Python/notify.pyp software/gadgets/weather/trunk/Weather/Strings/ software/gadgets/weather/trunk/Weather/Strings/fr_ALL.xml software/gadgets/weather/trunk/Weather/about.xml software/gadgets/weather/trunk/Weather/parts.xml software/gadgets/weather/trunk/Weather/settings.xml software/gadgets/weather/trunk/Weather/strings.xml Log: * Added the weather's gadget on SVN * Changes made by Bradbase : Fixed a bug with the temperature : The forecast temperature are in fahrenheit with the english google website, but the french website send them in celsius. Added: software/gadgets/weather/trunk/Weather/Pictures/Icons/gadget.png =================================================================== (Binary files differ) Property changes on: software/gadgets/weather/trunk/Weather/Pictures/Icons/gadget.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/conf/other.glade =================================================================== --- software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/conf/other.glade (rev 0) +++ software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/conf/other.glade 2008-01-24 14:37:28 UTC (rev 878) @@ -0,0 +1,650 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> + +<glade-interface> + +<widget class="GtkWindow" id="window1"> + <property name="height_request">314</property> + <property name="visible">True</property> + <property name="title" translatable="yes">Weather report parameters</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">False</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> + + <child> + <widget class="GtkVBox" id="vbox1"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkFrame" id="frame4"> + <property name="border_width">5</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment7"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkFixed" id="fixed5"> + <property name="visible">True</property> + + <child> + <widget class="GtkButton" id="button_remote"> + <property name="width_request">62</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Set</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_button_remote_clicked" last_modification_time="Sat, 22 Sep 2007 00:55:36 GMT"/> + </widget> + <packing> + <property name="x">256</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label_remote"> + <property name="width_request">328</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Current : None</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">0</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label11"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Remote</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="frame5"> + <property name="border_width">5</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment8"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkFixed" id="fixed6"> + <property name="visible">True</property> + + <child> + <widget class="GtkSpinButton" id="delay_spinbutton"> + <property name="width_request">120</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">False</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">False</property> + <property name="adjustment">1 1 3600 1 10 10</property> + </widget> + <packing> + <property name="x">88</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label13"> + <property name="width_request">336</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Delay (sec) :</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">0</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label12"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Updates</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="frame1"> + <property name="border_width">5</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkFixed" id="fixed1"> + <property name="visible">True</property> + + <child> + <widget class="GtkEntry" id="entry1"> + <property name="width_request">248</property> + <property name="height_request">25</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">•</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">16</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="button1"> + <property name="width_request">62</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Set</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_set_clicked" last_modification_time="Wed, 11 Jul 2007 19:51:03 GMT"/> + </widget> + <packing> + <property name="x">255</property> + <property name="y">14</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label3"> + <property name="width_request">152</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Current location:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">0</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Localization</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="frame2"> + <property name="border_width">5</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkFixed" id="fixed2"> + <property name="visible">True</property> + + <child> + <widget class="GtkRadioButton" id="radiobutton1"> + <property name="width_request">95</property> + <property name="height_request">22</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Celsius</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">24</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="radiobutton2"> + <property name="width_request">128</property> + <property name="height_request">22</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Fahrenheit</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">radiobutton1</property> + </widget> + <packing> + <property name="x">104</property> + <property name="y">24</property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="checkbutton1"> + <property name="width_request">208</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Tomorrow's forecast</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">0</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Report</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed3"> + <property name="visible">True</property> + + <child> + <widget class="GtkButton" id="button2"> + <property name="width_request">96</property> + <property name="height_request">32</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_accept_clicked" last_modification_time="Wed, 11 Jul 2007 19:53:32 GMT"/> + + <child> + <widget class="GtkAlignment" id="alignment4"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="image2"> + <property name="visible">True</property> + <property name="stock">gtk-ok</property> + <property name="icon_size">4</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="label" translatable="yes">Accept</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="x">256</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="button3"> + <property name="width_request">96</property> + <property name="height_request">32</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_cancel_clicked" last_modification_time="Thu, 09 Aug 2007 13:50:03 GMT"/> + + <child> + <widget class="GtkAlignment" id="alignment5"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox3"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="image3"> + <property name="visible">True</property> + <property name="stock">gtk-cancel</property> + <property name="icon_size">4</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="label" translatable="yes">Cancel</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="x">152</property> + <property name="y">0</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> +</widget> + +</glade-interface> Added: software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/conf/other.pyp =================================================================== --- software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/conf/other.pyp (rev 0) +++ software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/conf/other.pyp 2008-01-24 14:37:28 UTC (rev 878) @@ -0,0 +1,117 @@ +bindtextdomain("params", "") + +class Window(SimpleGladeApp): + + def __init__(self, + path=_me.paths['root'] + '/Scripts/Python/GUI/conf/other.glade', + root="window1", + domain="params", **kwargs): + """ + Constructor + """ + SimpleGladeApp.__init__(self, path, root, domain, **kwargs) + + def new(self): + """ + On new window + """ + self.updates_commons() + self.updates_specifics() + + self.get_widget("checkbutton1").set_active(_me.get_param('read_tommorow')) + if _me.get_param('degrees_celcius'): + self.get_widget("radiobutton1").set_active(True) + else: + self.get_widget("radiobutton2").set_active(True) + + def updates_commons(self): + """ + Update common widgets + """ + # Window title + txt = "%s : %s" % (_me.string('name_to_read'), + _me.string('gui_conf_window_title')) + self.get_widget("window1").set_title(txt) + + # Remote Frame + txt = _me.string('gui_conf_remote_title') + self.get_widget("label11").set_text(txt) + + txt = "%s : None" % _me.string('gui_conf_current_bind_lb') + self.get_widget("label_remote").set_text(txt) + + txt = _me.string('gui_conf_remote_set_bt') + self.get_widget("button_remote").set_label(txt) + + # Update Frame + txt = _me.string('gui_conf_update_title') + self.get_widget("label12").set_text(txt) + + txt = "%s : " % _me.string('gui_conf_delay_lb') + self.get_widget("label13").set_text(txt) + + value = _me.get_var('notify_delay') + self.get_widget("delay_spinbutton").set_value(value) + + # Bottom buttons + txt = _me.string('gui_conf_cancel_bt') + self.get_widget("label6").set_text(txt) + + txt = _me.string('gui_conf_accept_bt') + self.get_widget("label5").set_text(txt) + + def updates_specifics(self): + + # Localization frame + txt = _me.string('gui_conf_localization_title') + self.get_widget("label1").set_text(txt) + + txt = "%s : " % _me.string('gui_conf_current_location_lb') + self.get_widget("label3").set_text(txt) + + self.get_widget("entry1").set_text(_me.get_param('city')) + + txt = _me.string('gui_conf_localization_set_bt') + self.get_widget("button1").set_label(txt) + + # Report frame + txt = _me.string('gui_conf_report_title') + self.get_widget("label2").set_text(txt) + + txt = _me.string('gui_conf_tommorow_cb') + self.get_widget("checkbutton1").set_label(txt) + + def on_button_remote_clicked(self, widget, *args): + """ + On button 'set' remote clicked + """ + def remote_set_caption(): + tux.sys.wait(0.1) + gadgets['Manager'].gui('remote').window.set_captions(gadgets[_me.get_name()]) + if gadgets.has_key('Manager'): + if not gadgets['Manager'].gui('remote').showed(): + gadgets['Manager'].gui('remote').show() + gadget_thread.start_new_thread(remote_set_caption, ()) + + def on_set_clicked(self, widget, *args): + """ + On button 'set' clicked + """ + _me.set_param('city', self.get_widget("entry1").get_text()) + + def on_accept_clicked(self, widget, *args): + """ + On button 'accept' clicked + """ + _me.set_var('notify_delay', int(self.get_widget("delay_spinbutton").get_value())) + _me.set_param('read_tommorow', self.get_widget("checkbutton1").get_active()) + _me.set_param('degrees_celcius', self.get_widget("radiobutton1").get_active()) + if _me.gui('widget').showed(): + _me.gui('widget').window.update() + self.get_widget("window1").destroy() + + def on_cancel_clicked(self, widget, *args): + """ + On button 'cancel' clicked + """ + self.get_widget("window1").destroy() Added: software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/widget/other.glade =================================================================== --- software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/widget/other.glade (rev 0) +++ software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/widget/other.glade 2008-01-24 14:37:28 UTC (rev 878) @@ -0,0 +1,205 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> + +<glade-interface> + +<widget class="GtkWindow" id="window1"> + <property name="visible">True</property> + <property name="title" translatable="yes">Weather forcast</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">False</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> + + <child> + <widget class="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkFixed" id="fixed1"> + <property name="visible">True</property> + + <child> + <widget class="GtkLabel" id="label2"> + <property name="width_request">192</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">...</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">8</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label6"> + <property name="width_request">192</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">...</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">104</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label5"> + <property name="width_request">192</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">...</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">80</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label4"> + <property name="width_request">192</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">...</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">56</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label3"> + <property name="width_request">256</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">...</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">32</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b></b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + </child> +</widget> + +</glade-interface> Added: software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/widget/other.pyp (rev 0) +++ software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/widget/other.pyp 2008-01-24 14:37:28 UTC (rev 878) @@ -0,0 +1,34 @@ +bindtextdomain("params", "") + +class Window(SimpleGladeApp): + + def __init__(self, + path=_me.paths['root'] + '/Scripts/Python/GUI/widget/other.glade', + root="window1", + domain="params", **kwargs): + SimpleGladeApp.__init__(self, path, root, domain, **kwargs) + + def new(self): + self.get_widget("window1").set_title(_me.string('name_to_read')) + gadget_thread.start_new_thread(self.update, ()) + + def update(self): + _me.update_informations() + if _me.get_param('last_state') != None: + if _me.get_param('last_state') != []: + w = _me.get_param('last_state') + city = _me.string('city_label') + _me.get_param('city') + condition = _me.string('condition_label') + w[0]['condition'] + if _me.get_param('degrees_celcius') == True: + temp = _me.string('temp_label') + w[0]['temp_c'] + '°c' + else: + temp = _me.string('temp_label') + w[0]['temp_f'] + '°f' + humidity = w[0]['humidity'] + wind = w[0]['wind_condition'] + else: + return + self.get_widget("label2").set_text(city) + self.get_widget("label3").set_text(condition) + self.get_widget("label4").set_text(temp) + self.get_widget("label5").set_text(humidity) + self.get_widget("label6").set_text(wind) Added: software/gadgets/weather/trunk/Weather/Scripts/Python/init.pyp =================================================================== Added: software/gadgets/weather/trunk/Weather/Scripts/Python/main.pyp =================================================================== --- software/gadgets/weather/trunk/Weather/Scripts/Python/main.pyp (rev 0) +++ software/gadgets/weather/trunk/Weather/Scripts/Python/main.pyp 2008-01-24 14:37:28 UTC (rev 878) @@ -0,0 +1,115 @@ +def update_informations(): + import xml.dom.minidom + from xml.dom.minidom import Node + import tdrss + + lang = _me.string('lang') + city = _me.get_param('city') + _me.set_param('last_state', []) + url = "http://www.google.com/ig/api?hl=%s&weather=%s" % (lang, city) + + ret, rss_str = tdrss.rss_read_url(url, 2) + if not ret: + return + u=unicode(rss_str,"iso-8859-1") + text_to_send=u.encode('utf-8','replace') + + doc = xml.dom.minidom.parseString(text_to_send) + weather_node = doc.getElementsByTagName("weather")[0] + + for node in weather_node.getElementsByTagName("current_conditions"): + c_c = {} + condition = node.getElementsByTagName("condition")[0].getAttribute('data') + temp_f = node.getElementsByTagName("temp_f")[0].getAttribute('data') + temp_c = node.getElementsByTagName("temp_c")[0].getAttribute('data') + humidity = node.getElementsByTagName("humidity")[0].getAttribute('data') + wind_condition = node.getElementsByTagName("wind_condition")[0].getAttribute('data') + c_c['condition'] = condition + c_c['condition'] = c_c['condition'].encode('latin1','replace') + c_c['temp_f'] = temp_f + c_c['temp_f'] = c_c['temp_f'].encode('latin1','replace') + c_c['temp_c'] = temp_c + c_c['temp_c'] = c_c['temp_c'].encode('latin1','replace') + c_c['humidity'] = humidity + c_c['humidity'] = c_c['humidity'].encode('utf-8','replace') + c_c['wind_condition'] = wind_condition + c_c['wind_condition'] = c_c['wind_condition'].encode('utf-8','replace') + _me.get_param('last_state').append(c_c) + + for node in weather_node.getElementsByTagName("forecast_conditions"): + f_c = {} + low_temp = node.getElementsByTagName("low")[0].getAttribute('data') + high_temp = node.getElementsByTagName("high")[0].getAttribute('data') + day_of_week = node.getElementsByTagName("day_of_week")[0].getAttribute('data') + condition = node.getElementsByTagName("condition")[0].getAttribute('data') + f_c['condition'] = condition + f_c['condition'] = f_c['condition'].encode('latin1','replace') + f_c['day_of_week'] = day_of_week + f_c['day_of_week'] = f_c['day_of_week'].encode('latin1','replace') + f_c['low_temp'] = low_temp + f_c['low_temp'] = f_c['low_temp'].encode('latin1','replace') + f_c['high_temp'] = high_temp + f_c['high_temp'] = f_c['high_temp'].encode('latin1','replace') + _me.get_param('last_state').append(f_c) + +def speak_weather(): + _me.update_informations() + weather_list = _me.get_param('last_state') + if len(weather_list) == 0: + tux.tts.select_voice(_me.get_var('speaker'), _me.get_var('pitch')) + tux.tts.speak(_me.string('bad_conf')) + return + if _me.get_param('degrees_celcius') == True: + text = _me.string('current_weather')\ + + _me.get_param('city') + ". "\ + + weather_list[0]['condition']\ + + _me.string('temperature')\ + + weather_list[0]['temp_c']\ + + _me.string('degrees_c')\ + + weather_list[0]['humidity']\ + + _me.string('%') + else: + text = _me.string('current_weather')\ + + _me.get_param('city')\ + + ". "\ + + weather_list[0]['condition']\ + + _me.string('temperature')\ + + weather_list[0]['temp_f']\ + + _me.string('degrees_f')\ + + weather_list[0]['humidity']\ + + _me.string('%') + tux.tts.select_voice(_me.get_var('speaker'), _me.get_var('pitch')) + tux.tts.speak(text) + + if _me.get_param('read_tommorow'): + if _me.get_param('degrees_celcius') == True: + lang = _me.string('lang') + if lang == 'en': + celcius_low = int(((float(weather_list[1]['low_temp']) - 32) / 9) * 5) + celcius_high = int(((float(weather_list[1]['high_temp']) - 32) / 9) * 5) + else: + celcius_low = float(weather_list[1]['low_temp']) + celcius_high = float(weather_list[1]['high_temp']) + text = _me.string('tommorow_weather') + ". "\ + + weather_list[1]['condition']\ + + _me.string('temperatures')\ + + "%s" % celcius_low\ + + _me.string('and')\ + + "%s" % celcius_high\ + + _me.string('degrees_c') + else: + text = _me.string('tommorow_weather') + ". "\ + + weather_list[1]['condition']\ + + _me.string('temperatures')\ + + weather_list[1]['low_temp']\ + + _me.string('and')\ + + weather_list[1]['high_temp']\ + + _me.string('degrees_f') + tux.tts.select_voice(_me.get_var('speaker'), _me.get_var('pitch')) + tux.tts.speak(text) + +def on_k_stop(): + tux.tts.stop() + +tux.event.on_remote_bt[K_STOP] = on_k_stop +speak_weather() Added: software/gadgets/weather/trunk/Weather/Scripts/Python/notify.pyp =================================================================== --- software/gadgets/weather/trunk/Weather/Scripts/Python/notify.pyp (rev 0) +++ software/gadgets/weather/trunk/Weather/Scripts/Python/notify.pyp 2008-01-24 14:37:28 UTC (rev 878) @@ -0,0 +1,6 @@ +def notify_checker(): + if _me.gui('widget').showed(): + _me.gui('widget').window.update() + +def notify_actuator(): + pass Added: software/gadgets/weather/trunk/Weather/Strings/fr_ALL.xml =================================================================== --- software/gadgets/weather/trunk/Weather/Strings/fr_ALL.xml (rev 0) +++ software/gadgets/weather/trunk/Weather/Strings/fr_ALL.xml 2008-01-24 14:37:28 UTC (rev 878) @@ -0,0 +1,39 @@ +<?xml version='1.0' encoding='UTF-8'?> +<strings> + <and type='str'>, et, </and> + <bad_conf type='str'> Mauvaise configuration.</bad_conf> + <city_label type='str'>Ville : </city_label> + <condition_label type='str'>Condition : </condition_label> + <current_weather type='str'>Voici la météo actuelle à </current_weather> + <degrees_c type='str'> degrés Celsius .</degrees_c> + <degrees_f type='str'> degrés Fahrenheit .</degrees_f> + <gui_conf_about_title type='str'>A propos</gui_conf_about_title> + <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> + <gui_conf_author_lb type='str'>Auteur</gui_conf_author_lb> + <gui_conf_cancel_bt type='str'>Annuler</gui_conf_cancel_bt> + <gui_conf_current_bind_lb type='str'>Assignation</gui_conf_current_bind_lb> + <gui_conf_current_location_lb type='str'>Endroit courant</gui_conf_current_location_lb> + <gui_conf_delay_lb type='str'>Délai (sec)</gui_conf_delay_lb> + <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> + <gui_conf_localization_set_bt type='str'>Set</gui_conf_localization_set_bt> + <gui_conf_localization_title type='str'>Localisation</gui_conf_localization_title> + <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <gui_conf_remote_title type='str'>Télécommande</gui_conf_remote_title> + <gui_conf_report_title type='str'>Rapport</gui_conf_report_title> + <gui_conf_tommorow_cb type='str'>Météo pour demain</gui_conf_tommorow_cb> + <gui_conf_update_title type='str'>Mise à jour</gui_conf_update_title> + <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> + <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> + <help_text type='str'>Gadget de prévisions météo pour Tux droid. + +Spécifiez votre région dans la partie paramètres. +Cochez/Décochez l'option de prévisions pour le lendemain. +Vous pouvez choisir entre la mesure Fahrenheit ou Celsius.</help_text> + <lang type='str'>fr</lang> + <name_to_read type='str'>Météo</name_to_read> + <speaker_name type='str'>Bruno8k</speaker_name> + <temp_label type='str'>Température : </temp_label> + <temperature type='str'>, température, </temperature> + <temperatures type='str'>, la température sera comprise entre, </temperatures> + <tommorow_weather type='str'>Voici les prévisions pour demain</tommorow_weather> +</strings> Added: software/gadgets/weather/trunk/Weather/about.xml =================================================================== --- software/gadgets/weather/trunk/Weather/about.xml (rev 0) +++ software/gadgets/weather/trunk/Weather/about.xml 2008-01-24 14:37:28 UTC (rev 878) @@ -0,0 +1,12 @@ +<?xml version='1.0' encoding='UTF-8'?> +<about> + <gadget_author type='str'>rem...@c2... and tux...@br...</gadget_author> + <gadget_description type='str'>Weather forecast gadget for Tux Droid. + +bradbase has edited it 2007-01-20; +Fixed error in celsius for tomorrow weather. +Added humidity reading for today weather. +tu...@br...</gadget_description> + <gadget_name type='str'>Weather</gadget_name> + <gadget_version type='str'>0.0.5</gadget_version> +</about> Added: software/gadgets/weather/trunk/Weather/parts.xml =================================================================== --- software/gadgets/weather/trunk/Weather/parts.xml (rev 0) +++ software/gadgets/weather/trunk/Weather/parts.xml 2008-01-24 14:37:28 UTC (rev 878) @@ -0,0 +1,6 @@ +<?xml version='1.0' encoding='UTF-8'?> +<parts> + <notifications type='bool'>True</notifications> + <parameters_GUI type='bool'>True</parameters_GUI> + <widget_GUI type='bool'>True</widget_GUI> +</parts> Added: software/gadgets/weather/trunk/Weather/settings.xml =================================================================== --- software/gadgets/weather/trunk/Weather/settings.xml (rev 0) +++ software/gadgets/weather/trunk/Weather/settings.xml 2008-01-24 14:37:28 UTC (rev 878) @@ -0,0 +1,30 @@ +<?xml version='1.0' encoding='UTF-8'?> +<settings> + <general> + <framework_version type='str'>0.0.0</framework_version> + <gui_state> + <conf> + <visible type='bool'>False</visible> + </conf> + <widget> + <visible type='bool'>True</visible> + </widget> + </gui_state> + <have_main_part type='bool'>True</have_main_part> + <have_settings_part type='bool'>True</have_settings_part> + <have_widget_part type='bool'>False</have_widget_part> + <language type='str'>en_US</language> + <main_priority type='int'>4</main_priority> + <menu_active type='bool'>True</menu_active> + <notified type='bool'>True</notified> + <notify_delay type='int'>60</notify_delay> + <notify_priority type='int'>4</notify_priority> + <pitch type='int'>132</pitch> + <speaker type='int'>3</speaker> + </general> + <parameters> + <city type='str'>Brussels</city> + <degrees_celcius type='bool'>True</degrees_celcius> + <read_tommorow type='bool'>False</read_tommorow> + </parameters> +</settings> Added: software/gadgets/weather/trunk/Weather/strings.xml =================================================================== --- software/gadgets/weather/trunk/Weather/strings.xml (rev 0) +++ software/gadgets/weather/trunk/Weather/strings.xml 2008-01-24 14:37:28 UTC (rev 878) @@ -0,0 +1,39 @@ +<?xml version='1.0' encoding='UTF-8'?> +<strings> + <and type='str'>, and, </and> + <bad_conf type='str'> Bad configuration.</bad_conf> + <city_label type='str'>City : </city_label> + <condition_label type='str'>Condition : </condition_label> + <current_weather type='str'>Current weather at </current_weather> + <degrees_c type='str'> degrees Celsius .</degrees_c> + <degrees_f type='str'> degrees Fahrenheit .</degrees_f> + <gui_conf_about_title type='str'>About</gui_conf_about_title> + <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> + <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> + <gui_conf_cancel_bt type='str'>Cancel</gui_conf_cancel_bt> + <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> + <gui_conf_current_location_lb type='str'>Current location</gui_conf_current_location_lb> + <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> + <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> + <gui_conf_localization_set_bt type='str'>Set</gui_conf_localization_set_bt> + <gui_conf_localization_title type='str'>Localization</gui_conf_localization_title> + <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <gui_conf_remote_title type='str'>Remote</gui_conf_remote_title> + <gui_conf_report_title type='str'>Report</gui_conf_report_title> + <gui_conf_tommorow_cb type='str'>Tomorrow's forecast</gui_conf_tommorow_cb> + <gui_conf_update_title type='str'>Update</gui_conf_update_title> + <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> + <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> + <help_text type='str'>Weather forecast gadget for Tux Droid. + +Specify your location in the settings window. +Disable/enable the option for tomorrow's forecast +and the degrees can be set to Fahrenheit or Celsius.</help_text> + <lang type='str'>en</lang> + <name_to_read type='str'>Weather</name_to_read> + <speaker_name type='str'>Ryan8k</speaker_name> + <temp_label type='str'>Temperature : </temp_label> + <temperature type='str'>, temperature, </temperature> + <temperatures type='str'>, the temperature will be between, </temperatures> + <tommorow_weather type='str'>Tomorrows weather </tommorow_weather> +</strings> Added: software/gadgets/weather/trunk/Weather.tgf =================================================================== (Binary files differ) Property changes on: software/gadgets/weather/trunk/Weather.tgf ___________________________________________________________________ Name: svn:mime-type + application/octet-stream |