Hello community,

here is the log from the commit of package weather-wallpaper for 
openSUSE:Factory checked in at 2012-02-21 12:26:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/weather-wallpaper (Old)
 and      /work/SRC/openSUSE:Factory/.weather-wallpaper.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "weather-wallpaper", Maintainer is ""

Changes:
--------
New Changes file:

--- /dev/null   2010-08-26 16:28:41.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.weather-wallpaper.new/weather-wallpaper.changes 
2012-02-21 12:26:48.000000000 +0100
@@ -0,0 +1,9 @@
+-------------------------------------------------------------------
+Thu Feb  9 16:46:10 UTC 2012 - [email protected]
+
+- Initial build. 
+- Add weather-wallpaper-update-for-gnome3.patch: Update python
+  code to use gsettings as well as gconf (lp#921375).
+- Add weather-wallpaper-fix-desktop-file.patch: Add trailing ; to
+  desktop categories (lp#929642).
+

New:
----
  weather-wallpaper-fix-desktop-file.patch
  weather-wallpaper-update-for-gnome3.patch
  weather-wallpaper.changes
  weather-wallpaper.spec
  weather-wallpaper_0.2.0-1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ weather-wallpaper.spec ++++++
#
# spec file for package weather-wallpaper
#
# Copyright (c) 2012 Malcolm J Lewis <[email protected]>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Name:           weather-wallpaper
Version:        0.2.0
Release:        0
License:        GPL-2.0
Summary:        Utility to create a wallpaper based on the current weather
Url:            http://mundogeek.net/weather-wallpaper/
Group:          Amusements/Toys/Background
Source0:        
http://launchpadlibrarian.net/17362202/weather-wallpaper_0.2.0-1.tar.gz
# PATCH-FIX-UPSTREAM weather-wallpaper-update-for-gnome3.patch lp#921375 
[email protected] -- Update python code to use gsettings as well as 
gconf.
Patch0:         weather-wallpaper-update-for-gnome3.patch
# PATCH-FIX-UPSTREAM weather-wallpaper-fix-desktop-file.patch lp#929642 
[email protected] -- Add trailing ; to desktop categories.
Patch1:         weather-wallpaper-fix-desktop-file.patch
BuildRequires:  fdupes
BuildRequires:  python-devel
BuildRequires:  update-desktop-files
Requires:       ImageMagick
Requires:       inkscape
Requires:       python-gtk
Requires:       python-pymetar
Recommends:     %{name}-lang
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
%py_requires

%description
Weather wallpaper is a program which connects to NOAA each hour to get the
current weather at the specified location and creates and sets a wallpaper
with the data retrieved.

%lang_package
%prep
%setup -q
%patch0 -p1
%patch1 -p1

%build

%install
%makeinstall
# Remove installed files as we'll package them as rpm docs
rm %{buildroot}%{_datadir}/%{name}/AUTHORS \
   %{buildroot}%{_datadir}/%{name}/COPYING \
   %{buildroot}%{_datadir}/%{name}/TRANSLATORS
%find_lang %{name} %{?no_lang_C}
%suse_update_desktop_file -n %{name}
%fdupes %{buildroot}

%post
%desktop_database_post

%postun
%desktop_database_postun

%files
%defattr(-,root,root,-)
%doc AUTHORS changelog COPYING TRANSLATORS
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/pixmaps/%{name}.svg
%{_datadir}/%{name}/
%{_mandir}/man1/%{name}.1%{?ext_man}

%files lang -f %{name}.lang

%changelog
++++++ weather-wallpaper-fix-desktop-file.patch ++++++
diff -Naur a/weather-wallpaper.desktop b/weather-wallpaper.desktop
--- a/weather-wallpaper.desktop 2007-10-24 05:15:28.000000000 -0500
+++ b/weather-wallpaper.desktop 2012-02-09 10:24:50.019035306 -0600
@@ -5,7 +5,7 @@
 Comment=Creates a wallpaper with the current weather
 Terminal=false
 Type=Application
-Categories=Utility;DesktopSettings;Amusement;GTK
+Categories=Utility;DesktopSettings;Amusement;GTK;
 Exec=weather-wallpaper
 Icon=weather-wallpaper
 Name[es_ES]=weather-wallpaper
++++++ weather-wallpaper-update-for-gnome3.patch ++++++
diff -Naur a/weather-wallpaper b/weather-wallpaper
--- a/weather-wallpaper 2007-10-24 05:15:28.000000000 -0500
+++ b/weather-wallpaper 2012-01-25 11:03:01.509494039 -0600
@@ -16,22 +16,26 @@
 #
 # 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-1307  USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 
USA.
 #
 ###
 
-
-import ConfigParser
-import gettext
-import gtk
-import os
-import pygtk
-import pymetar
-import sys
-import threading
-import time
-import urllib2
-
+try:
+    import gi
+    from gi.repository import Gio
+except ImportError:
+    pass
+finally:
+    import ConfigParser
+    import gettext
+    import gtk
+    import os
+    import pygtk
+    import pymetar
+    import sys
+    import threading
+    import time
+    import urllib2
 
 __version__ = "0.2.0"
 
@@ -246,6 +250,19 @@
         self.stop_event = threading.Event()
         self.stop = False
         threading.Thread.__init__(self)
+        # Desktop wallpaper schema name.
+        self.SCHEMA = 'org.gnome.desktop.background'
+        # URI to use for the background image. Note that the backend only 
supports local (file://) URIs.
+        self.KEY_URI = 'picture-uri'
+        # Determines how the image set by wallpaper_filename is rendered. 
Possible values are "none",
+        # "wallpaper", "centered", "scaled", "stretched", "zoom", "spanned".
+        self.KEY_OPTS = 'picture-options'
+        # How to shade the background color. Possible values are "horizontal", 
"vertical", and "solid".
+        self.KEY_SHADING = 'color-shading-type'
+        # Left or Top color when drawing gradients, or the solid color.
+        self.KEY_PRIMARY = 'primary-color'
+        # Right or Bottom color when drawing gradients, not used for solid 
color.
+        self.KEY_SECOND = 'secondary-color'
 
     def run(self):
         """Execution loop for the thread. Creates and sets a new wallpaper 
with the info downloaded from NOAA"""
@@ -431,17 +448,28 @@
             os.popen(cmd)
 
             # If the user is running Gnome
-            if os.popen( "ps --user " + os.environ.get( "USER" ) + "| grep 
gnome-panel").readline():
-                import gconf
-                client = gconf.client_get_default()
-                
client.set_string("/desktop/gnome/background/picture_filename", output_img)
-                client.set_string("/desktop/gnome/background/picture_options", 
"centered")
-
-                
client.set_string("/desktop/gnome/background/color_shading_type", 
"vertical-gradient")
-                client.set_string("/desktop/gnome/background/primary_color", 
foreground)
-                client.set_string("/desktop/gnome/background/secondary_color", 
background)
+            if os.environ.has_key('GNOME_DESKTOP_SESSION_ID'):
+                try:
+                    # If running Gnome 3.x
+                    gsettings = Gio.Settings.new(self.SCHEMA)
+                    gsettings.set_string(self.KEY_URI, "file://" + output_img)
+                    gsettings.set_string(self.KEY_OPTS, "spanned")
+                    gsettings.set_string(self.KEY_SHADING, "vertical")
+                    gsettings.set_string(self.KEY_PRIMARY, foreground)
+                    gsettings.set_string(self.KEY_SECOND, background)
+                except NameError:
+                    pass
+                finally:
+                    # If running Gnome 2.x
+                    import gconf
+                    client = gconf.client_get_default()
+                    
client.set_string("/desktop/gnome/background/picture_filename", output_img)
+                    
client.set_string("/desktop/gnome/background/picture_options", "centered")
+                    
client.set_string("/desktop/gnome/background/color_shading_type", 
"vertical-gradient")
+                    
client.set_string("/desktop/gnome/background/primary_color", foreground)
+                    
client.set_string("/desktop/gnome/background/secondary_color", background)
             # If the user is running KDE
-            elif os.popen( "ps --user " + os.environ.get( "USER" ) + "| grep 
kdesktop" ).readline():
+            elif os.environ.has_key('KDE_FULL_SESSION'):
                 cmd = "dcop kdesktop KBackgroundIface setWallpaper \"%s\" 1 " 
% (output_img)
                 os.popen(cmd)
                 cmd = "dcop kdesktop KBackgroundIface setColor \"%s\" false" % 
(background)
-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to