Re: [Rhythmbox-devel] db.entry_get changes for plugins

This is the way i've found, I'm facing the same problem:

    def some_method()
        return self.get_value(entry, RB.RhythmDBPropType.ENTRY_ID)

    def get_value(self, entry, property_type):

        t = self.db.get_property_type(property_type)
        value = GObject.Value()
        self.db.entry_get(entry, property_type, value)
        if == 'gulong':
            return value.get_ulong()
        elif == 'gchararray':
            return value.get_string()
        elif == 'gboolean':
            return value.get_boolean()
        elif == 'gboxed':
            return value.get_boxed()
        elif == 'gchar':
            return value.get_char()
        elif == 'gdouble':
            return value.get_double()
        elif == 'genum':
            return value.get_enum()
        elif == 'gflags':
            return value.get_flags()
        elif == 'gfloat':
            return value.get_float()
        elif == 'gint':
            return value.get_int()
        elif == 'gint64':
            return value.get_int64()
        elif == 'glong':
            return value.get_long()
        elif == 'gobject':
            return value.get_object()
        elif == 'gparam':
            return value.get_param()
        elif == 'gpointer':
            return value.get_pointer()
        elif == 'gstring':
            return value.get_string()
        elif == 'guchar':
            return value.get_uchar()
        elif == 'guint':
            return value.get_uint()
        elif == 'guint64':
            return value.get_uint64()
        elif == 'gvariant':
            return value.get_variant()
            self.warning('Unknown type %s' %
            return None

There sure is a better way to do it, but this one is working right now

On Thu, Nov 24, 2011 at 9:03 AM, Lachlan <lachlan 00 gmail com> wrote:
So now that Debian testing is running git versions of Rhythmbox I've
been updating my plugin.

So far i have it activating and the menu items are populating which is
awesome, now i just have to work out functionality

from what i've found on the net it should be changing from one line to
the next one:
self.db.entry_get(db_entry, rhythmdb.PROP_ALBUM)
self.db.entry_get(db_entry, RB.RhythmDBPropType.ALBUM)

When i run this though i get told that entry_get() takes 4 arguments (3 given)

I think this has to do with self.db but i'm unsure about where to check.

rhythmbox-devel mailing list
rhythmbox-devel gnome org

Pablo Carranza

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