zeitgeist team mailing list archive
-
zeitgeist team
-
Mailing list archive
-
Message #00247
[Bug 462890] Re: Add engine version identifier and expose this ID over the DBus API
I implemented a Properties interface in lp:~thekorn/zeitgeist/dbus.properties
The 'version' property is a read-only property which returns a version tuple.
Example usage:
>>> from zeitgeist.dbusutils import DBusInterface
>>> iface = DBusInterface()
>>> iface.version()
dbus.Struct((dbus.Int32(0), dbus.Int32(3), dbus.Int32(0)), signature=None, variant_level=1)
>>> map(int, iface.version())
[0, 3, 0]
>>> iface.version() > (0, 1, 0)
True
>>> iface.version() > (1, 5, 0)
False
Or in a terminal
markus@thekorn ~ % dbus-send --print-reply --dest=org.gnome.zeitgeist /org/gnome/zeitgeist org.freedesktop.DBus.Properties.Get string:"org.gnome.zeitgeist" string:"version"
method return sender=:1.170 -> dest=:1.171 reply_serial=2
variant struct {
int32 0
int32 3
int32 0
}
markus@thekorn ~ % dbus-send --print-reply --dest=org.gnome.zeitgeist /org/gnome/zeitgeist org.freedesktop.DBus.Properties.GetAll string:"org.gnome.zeitgeist"
method return sender=:1.179 -> dest=:1.180 reply_serial=2
array [
dict entry(
string "version"
variant struct {
int32 0
int32 3
int32 0
}
)
]
markus@thekorn ~ % dbus-send --print-reply --dest=org.gnome.zeitgeist /org/gnome/zeitgeist org.freedesktop.DBus.Properties.Set string:"org.gnome.zeitgeist" string:"version" string:"booo"
Error org.freedesktop.DBus.Python.AttributeError: Traceback (most recent call last):
File "/usr/lib/pymodules/python2.6/dbus/service.py", line 702, in _message_cb
retval = candidate_method(self, *args, **keywords)
File "/media/devel/gnome-zeitgeist/zeitgeist/dbus.properties/zeitgeist/../_zeitgeist/engine/remote.py", line 265, in Set
raise AttributeError(property_name)
AttributeError: version
1 markus@thekorn ~ %
--
Add engine version identifier and expose this ID over the DBus API
https://bugs.launchpad.net/bugs/462890
You received this bug notification because you are a member of
Zeitgeist-Engine, which is the registrant for Zeitgeist Engine.
Status in Zeitgeist Engine: New
Bug description:
The latest changes to the API demonstrate that we need an API version ID and we also should make this ID accessible over DBus, something like:
>>> iface = DBusInterface()
>>> iface.getVersion()
'0.3'
Sample usecases:
* some (external) dataprovider might only work with some API versions
* same for client
References