【发布时间】:2010-09-21 15:53:41
【问题描述】:
我正在编写一个 Rhythmbox 插件来遍历 Rhythmbox 当前已知的所有播客文件(无论是否下载)并对其进行处理。
在 Rhythmbox 的 Python Shell 中进行一些研究和测试后,我成功获得了所有对象的列表。但是,当我将其编码到插件中时,出现错误:
(rhythmbox:7500): GLib-GObject-WARNING **: invalid cast from `RhythmDBTree' to `RhythmDBEntryType'
而entries 列表为空:
def run(self, action, shell):
db = shell.get_property('db')
entry_type = db.entry_type_get_by_name('podcast-post')
print entry_type
entries = []
db.entry_foreach_by_type(entry_type, entries.append)
print entries
但是,print entry_type 返回:<rhythmdb.EntryType object at 0xa7ea34c (RhythmDBEntryType at 0xa106988)>,因此 db 对象显然是有效的。
我做错了什么?
【问题讨论】:
-
你能给出完整的代码,看看它运行在什么上面吗?
标签: python plugins podcast rhythmbox