[Rhythmbox-devel] Plugin Writing: Accessing the entry-changed signal's changes in Python
- From: "Mendhak (RBM)" <rbmailinglist mendhak com>
- To: rhythmbox-devel gnome org
- Subject: [Rhythmbox-devel] Plugin Writing: Accessing the entry-changed signal's changes in Python
- Date: Sat, 25 May 2013 13:50:52 +0100
Hi all,
I am writing a plugin which subscribes to the "entry-changed" signal.
This signal has a "changes" argument, but I cannot figure out what the
changes are from it. The callback that receives the signal is:
def entry_changed(self, db, entry, changes):
I tried iterating over changes and doing a list(changes), but I get an error:
TypeError: 'Array' object is not iterable
Attempting to access via indexer changes[0] gives
TypeError: 'Array' object does not support indexing
When I do a dir(changes), I see a "len" and a "data" property which look useful,
['__class__', '__delattr__', '__dict__', '__doc__', '__eq__',
'__format__', '__ge__', '__getattribute__', '__gt__', '__gtype__',
'__hash__', '__info__', '__init__', '__le__', '__lt__', '__module__',
'__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__',
'__setattr__', '__sizeof__', '__str__', '__subclasshook__',
'__weakref__', '_free_on_dealloc', 'copy', 'data', 'len']
however "data" seems to contain unintelligible data that I cannot
read. "len" does give the length of an array.
Please can you tell me what the correct way of accessing the
RhythmDBEntryChange from changes in the "entry-changed" signal is so
that I can get the "prop", "old" and "new" properties?
I am running Python 2.7.4 and Rhythmbox 2.98.
Any help or pointers in the right direction are appreciated.
-Mendhak
--
--
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]