Listen y el bug con Dbus

3:06 pm GNU/Linux, Gentoo

Para los que no lo conoce, listen es un reproductor de audio muy parecido a Amarok (nativo de KDE), su página web oficial es: http://www.listen-project.org/.

Resulta que con su versión más reciente, la 0.5, causa problemas con el script que usa en conjunto con Dbus (escrito en python), el script en especifico se encuentra en: /usr/lib/listen/dbus_manager.py. Los errores son del tipo:

  File "/usr/lib/listen/listen.py", line 209, in ?

ListenApp()

File "/usr/lib/listen/listen.py", line 137, in __init__

self.listen_instance = Listen()

File "/usr/lib/listen/widget/listen.py", line 120, in __init__

self.dbus_service = ListenDBus(self,player)

File "/usr/lib/listen/dbus_manager.py", line 55, in __init__

dbus.service.Object.__init__(self, bus_name, object_path)

File "//usr/lib/python2.4/site-packages/dbus/service.py", line 418, in __init__

self._connection._register_object_path(object_path, self._message_cb, self._unregister_cb)

RuntimeError: To make asynchronous calls, receive signals or export
objects, D-Bus connections must be attached to a main loop by passing
mainloop=... to the constructor or calling
dbus.set_default_main_loop(...)

Existe un parche para arreglar el problema y poder arancar correctamente, el parche es el siguiente:

Index: dbus_manager.py
===================================================================
--- dbus_manager.py     (revision 670)
+++ dbus_manager.py     (working copy)
@@ -30,9 +30,18 @@
import dbus
import dbus.service
#Try connection du message bus
-    dbus.SessionBus()
-    if getattr(dbus, 'version', (0,0,0)) >= (0,41,0):
+    dbus_version = getattr(dbus, 'version',(0,0,0))
+    if dbus_version >= (0,41,0) and dbus_version < (0,80,0):
+        dbus.SessionBus()
import dbus.glib
+    elif dbus_version >= (0,80,0):
+        from dbus.mainloop.glib import DBusGMainLoop
+        DBusGMainLoop(set_as_default=True)
+        dbus.SessionBus()
+    else:
+        pass
+
+
except: dbus_imported = False
else: dbus_imported=True

@@ -41,14 +50,14 @@

if not dbus_imported:
class ListenDBus:
-        def __init__(self,win,player,object_path="/org/gnome/listen/"):
+        def __init__(self,win,player,object_path="/org/gnome/listen"):
self.player = player
self.win = win
print "No dbus support"
else:

class ListenDBus(dbus.service.Object):
-        def __init__(self,win,player,object_path="/org/gnome/listen/"):
+        def __init__(self,win,player,object_path="/org/gnome/listen"):
self.player = player
self.win = win
self.bus = dbus.SessionBus()
@@ -105,4 +114,4 @@
song = self.player.song
return str( song.get_str("title")+ " - ("+song.get_str("album")+" - "+song.get_str("artist")+")")
else:
-                return ""
No newline at end of file
+                return ""

Para aplicarlo, hacer lo siguiente como root:

cd /usr/lib/listen/
wget http://bugs.gentoo.org/attachment.cgi?id=112290&action=view
mv attachment.cgi?id=112290 listen-fix-dbus.diff
patch -p0 < listen-fix-dbus.diff

Versión de paquetes:
listen-0.5
dbus-python-0.81.0
dbus-1.0.2-r2

Ahora se, a disfrutar de listen :)…

_listen02%5B1%5D.png

Califica el tema:
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Temas Relacionados:
  • Teclado Multimedia en GNU/Linux
  • Librería rota: libexpat en Gentoo
  • Usando TOR en GNU/Linux
  • Mi primer programa usando un socket xD (C#)
  • Mejorando la apariencia/funcionalidad de AMSN
  • Leave a Comment

    Your comment

    You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

    Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.