← Back to team overview

zeitgeist team mailing list archive

Structure and items of an event object

 

Hi,
I've asked this question on #zeitgeist today, but somehow the answer
was not satisfying and I'm feeling we need to discuss this further.
Since a couple of days events are not represented as tuples with >10
elements, but are dicts now. This is how we define such dicts in
zeitgeist/dbusutils.py:

	_ITEM_TYPE_MAP = {
		"timestamp": (int, True),
		"uri": (unicode, True),
		"text": (unicode, False),
		"source": (unicode, True),
		"content": (unicode, True),
		"mimetype": (unicode, False), #<- wrong
		"tags": (unicode, False),
		"comment": (unicode, False),
		"bookmark": (bool, False),
		"use": (unicode, False),
		"icon": (unicode, False),
		"app": (unicode, False),
		"origin": (unicode, False),
	}
Where the keys of this dict are the valid keys for an event dict, the
first elements of the values are the type and the second boolean value
defines whether an entry is required or not.

I just found a few issues and a few things I would like to discuss:
1a.) although it is stated here otherwise, mimetype is not an optional
entry, the engine itself will discard events without a mimetype
1b.) is mimetype really required for an event? Seif: as you are
working on this application watcher, what is the mimetype of a
CloseTab/CloseWindow event?
2a.) for the same reason, what is in such case the 'uri' of a
closetab/closewindow event?
2b.) is 'uri' really required? What is the uri of a tag added as an
user activity (adding via GUI or such)?
3.) aren't "timestamp", "source", "content" the only required items?
(sorry, this items are all kind of related, feel free to answer them in one)

Markus



Follow ups