zeitgeist team mailing list archive
-
zeitgeist team
-
Mailing list archive
-
Message #00233
Re: zeitgeist vim plugin
Hi Jonathan,
> I'm trying to write a vim plugin to log its activity in the zeitgeist db.
Cool, thanks for doing this!
> Is a vim plugin using the python dbus interface the right way of doing it ?
Yeah, we'd like to have as much as possible of the logging done by
plugins (or even natively by the applications themselves).
> 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]),
> }
> is this item content correct ?
Yes, but, if you are writing the plugin in Python, please consider
using the constants we provide ("from zeitgeist import datamodel"):
datamodel.Source.FILE and datamodel.Content.VISIT_EVENT (#TextDocument
is currently not available, we only have #Document
-datamodel.Content.DOCUMENT-).
> Should I add an "origin" entry ? with what content ?
This field is optional. It isn't really used for anything in the 0.2
series so leaving it empty shouldn't be a problem.
> Are the "timestamp" and "mimetype" entries needed ? or would they have the
> same values if I omit them ?
They are both required.
If you have any other question, here we are. You can also come over to
#zeitgeist on irc.freenode.net.
Regards,
--
Siegfried-Angel Gevatter Pujals (RainCT)
Free Software Developer 363DEAE3
References