[rhythmbox/gobject-introspection: 37/39] pygi-ify zeitgeist plugin



commit 1f72f5b238322570385bafc4a699ffcf5dad88fc
Author: Jonathan Matthew <jonathan d14n org>
Date:   Sun Nov 7 11:59:25 2010 +1000

    pygi-ify zeitgeist plugin

 plugins/rbzeitgeist/rbzeitgeist/__init__.py |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/plugins/rbzeitgeist/rbzeitgeist/__init__.py b/plugins/rbzeitgeist/rbzeitgeist/__init__.py
index 5698641..afc70ef 100644
--- a/plugins/rbzeitgeist/rbzeitgeist/__init__.py
+++ b/plugins/rbzeitgeist/rbzeitgeist/__init__.py
@@ -25,11 +25,11 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
 
-import rb
-import rhythmdb
 import gobject
 import time
 
+from gi.repository import RB
+
 from zeitgeist.client import ZeitgeistClient
 from zeitgeist.datamodel import Event, Subject, Interpretation, Manifestation
 
@@ -39,10 +39,10 @@ except RuntimeError, e:
     print "Unable to connect to Zeitgeist, won't send events. Reason: '%s'" %e
     IFACE = None
 
-class ZeitgeistPlugin(rb.Plugin):
+class ZeitgeistPlugin(RB.Plugin):
 
     def __init__(self):
-        rb.Plugin.__init__(self)
+        RB.Plugin.__init__(self)
 
     def activate(self, shell):
         print "LOADING Zeitgeist plugin ......"
@@ -65,11 +65,11 @@ class ZeitgeistPlugin(rb.Plugin):
     @staticmethod
     def get_song_info(db, entry):
         song = {
-            "album": db.entry_get(entry, rhythmdb.PROP_ALBUM),
-            "artist": db.entry_get(entry, rhythmdb.PROP_ARTIST),
-            "title":  db.entry_get(entry, rhythmdb.PROP_TITLE),
-            "location": db.entry_get(entry, rhythmdb.PROP_LOCATION),
-            "mimetype": db.entry_get(entry, rhythmdb.PROP_MIMETYPE),
+            "album": entry.get_string(RB.RhythmDBPropType.PROP_ALBUM),
+            "artist": entry.get_string(RB.RhythmDBPropType.PROP_ARTIST),
+            "title":  entry.get_string(RB.RhythmDBPropType.PROP_TITLE),
+            "location": entry.get_string(RB.RhythmDBPropType.PROP_LOCATION),
+            "mimetype": entry.get_string(RB.RhythmDBPropType.PROP_MIMETYPE),
         }
         return song
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]