rpms/serpentine/F-8 serpentine-0.9-plugususpend.patch, NONE, 1.1 serpentine.spec, 1.9, 1.10

Sindre Pedersen Bjørdal (sindrepb) fedora-extras-commits at redhat.com
Thu Nov 22 23:07:32 UTC 2007


Author: sindrepb

Update of /cvs/pkgs/rpms/serpentine/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv5663

Modified Files:
	serpentine.spec 
Added Files:
	serpentine-0.9-plugususpend.patch 
Log Message:
Fix suspend plugin

serpentine-0.9-plugususpend.patch:

--- NEW FILE serpentine-0.9-plugususpend.patch ---
# Bazaar revision bundle v0.9
#
# message:
#   Added support for both versions of suspend.
# committer: Tiago Cogumbreiro <cogumbreiro at users.sf.net>
# date: Mon 2007-10-15 11:28:07.520999908 +0100

=== modified file serpentine/plugins/plugsuspend.py
--- serpentine/plugins/plugsuspend.py
+++ serpentine/plugins/plugsuspend.py
@@ -22,21 +22,41 @@
 from gettext import gettext as _
 
 
+GNOME = dict(object_name='org.gnome.PowerManager',
+             object_path='/org/gnome/PowerManager',
+             interface='org.gnome.PowerManager')
+
+FDO = dict(object_name='org.freedesktop.PowerManagement',
+           object_path='/org/freedesktop/PowerManagement/Inhibit',
+           interface='org.freedesktop.PowerManagement.Inhibit')
+
+SPECS = (GNOME, FDO)
+
 class InhibitSuspend(object):
     """
     Plugin to enable power inhibiting while writing an audio disc.
     """
     def __init__(self):
-        self.bus = dbus.Bus(dbus.Bus.TYPE_SESSION)
-        self.devobj = self.bus.get_object('org.gnome.PowerManager',
-                                          '/org/gnome/PowerManager')
-        self.dev = dbus.Interface(self.devobj, "org.gnome.PowerManager")
+        bus = dbus.Bus(dbus.Bus.TYPE_SESSION)
+        for spec in SPECS:
+            try:
+                obj = bus.get_object(spec['object_name'],
+                                     spec['object_path'])
+                iface = dbus.Interface(obj, spec['interface'])
+                self.inhibit = iface.Inhibit
+                self.uninhibit = iface.UnInhibit
+                break
+            except dbus.DBusException:
+                pass
+        else:
+            self.inhibit = lambda *args: None
+            self.uninhibit = self.inhibit
 
     def on_writing_started(self, app):
-        self.cookie = self.dev.Inhibit('Serpentine', _('Writing audio disc'))
+        self.cookie = self.inhibit('Serpentine', _('Writing audio disc'))
     
     def on_writing_finished(self, app):
-        self.dev.UnInhibit(self.cookie)
+        self.uninhibit(self.cookie)
 
 
 def create_plugin(app):

=== modified directory  // last-changed:cogumbreiro at users.sf.net-20071015102807
... -w47ghpg1oib23jd6
# revision id: cogumbreiro at users.sf.net-20071015102807-w47ghpg1oib23jd6
# sha1: 5c39d65282cb23d3ddc4b4945fd259d57acb83b3
# inventory sha1: 007fb3a99364744cf055634a14df39bbd656d3bf
# parent ids:
#   cogumbreiro at users.sf.net-20070901174703-ttnzwt3i7rpq24ag
# base id: cogumbreiro at users.sf.net-20070901174703-ttnzwt3i7rpq24ag
# properties:
#   branch-nick: serpentine.dev




Index: serpentine.spec
===================================================================
RCS file: /cvs/pkgs/rpms/serpentine/F-8/serpentine.spec,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- serpentine.spec	22 Nov 2007 16:19:03 -0000	1.9
+++ serpentine.spec	22 Nov 2007 23:06:56 -0000	1.10
@@ -2,13 +2,15 @@
 
 Name:           serpentine
 Version:        0.9
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Audio CD Burner
 
 Group:          Applications/Multimedia
 License:        GPLv2+
 URL:            http://www.irrepupavel.com/projects/serpentine/
 Source0:        http://download.berlios.de/serpentine/serpentine-%{version}.tar.bz2
+Patch0:         %{name}-%{version}-plugususpend.patch
+
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:	noarch
 
@@ -31,6 +33,7 @@
 
 %prep
 %setup -q
+%patch0 -p0
 sed -i 's!Terminal=False!Terminal=false!' data/serpentine.desktop.in
 
 %build




More information about the fedora-extras-commits mailing list