← Back to team overview

zeitgeist team mailing list archive

zeitgeist vim plugin

 

Hello,
I'm trying to write a vim plugin to log its activity in the zeitgeist db.
I'm using  ÎFACE.InsertEvents([item,]). But I'm not sure about the content
of the "item" dictionary.
For now, I use
item = {
    "timestamp": int(time.time()),
    "uri":uri,
    "app": u"/usr/share/applications/gvim.desktop",
    "source":u"http://freedesktop.org/standards/xesam/1.0/core#File";,
    "content":u"http://freedesktop.org/standards/xesam/1.0/core#TextDocument
",
    "use":u"http://gnome.org/zeitgeist/schema/1.0/core#VisitEvent";,
    "mimetype":unicode(mimetypes.guess_type(uri)[0]),
}
where uri is something like file://path/to/the/file

Here are my questions :
Is a vim plugin using the python dbus interface the right way of doing it ?
is this item content correct ?
Should I add an "origin" entry ? with what content ?
Are the "timestamp" and "mimetype" entries needed ? or would they have the
same values if I omit them ?

thanks for your help.
Jonathan

Follow ups