2006-07-19 21:27:37 +02:00
|
|
|
import gobject
|
|
|
|
import dbus, dbus_bindings
|
2006-06-14 20:42:44 +02:00
|
|
|
|
2006-06-09 23:23:42 +02:00
|
|
|
|
2006-07-19 21:27:37 +02:00
|
|
|
class Service(gobject.GObject):
|
2006-06-15 23:05:44 +02:00
|
|
|
|
2006-07-19 21:27:37 +02:00
|
|
|
_PRESENCE_SERVICE = "org.laptop.Presence"
|
|
|
|
_SERVICE_DBUS_INTERFACE = "org.laptop.Presence.Service"
|
2006-06-14 20:42:44 +02:00
|
|
|
|
2006-07-19 21:27:37 +02:00
|
|
|
def __init__(self, bus, new_obj_cb, del_obj_cb, object_path):
|
|
|
|
gobject.GObject.__init__(self)
|
|
|
|
self._object_path = object_path
|
|
|
|
self._ps_new_object = new_obj_cb
|
|
|
|
self._ps_del_object = del_obj_cb
|
|
|
|
sobj = bus.get_object(self._PRESENCE_SERVICE, object_path)
|
|
|
|
self._service = dbus.Interface(sobj, self._SERVICE_DBUS_INTERFACE)
|
2006-06-13 00:31:26 +02:00
|
|
|
|
2006-07-19 21:27:37 +02:00
|
|
|
def object_path(self):
|
|
|
|
return self._object_path
|
2006-06-18 07:31:18 +02:00
|
|
|
|
2006-07-19 21:27:37 +02:00
|
|
|
def getProperties(self):
|
|
|
|
return self._service.getProperties()
|
2006-06-23 00:07:54 +02:00
|
|
|
|
2006-07-19 21:27:37 +02:00
|
|
|
def getPublishedValue(self, key):
|
|
|
|
value = self._service.getPublishedValue(key)
|