2006-07-19 15:27:37 -04:00
|
|
|
import gobject
|
|
|
|
|
import dbus, dbus_bindings
|
2006-06-14 14:42:44 -04:00
|
|
|
|
2006-06-09 17:23:42 -04:00
|
|
|
|
2006-07-19 15:27:37 -04:00
|
|
|
class Service(gobject.GObject):
|
2006-06-15 17:05:44 -04:00
|
|
|
|
2006-07-19 15:27:37 -04:00
|
|
|
_PRESENCE_SERVICE = "org.laptop.Presence"
|
|
|
|
|
_SERVICE_DBUS_INTERFACE = "org.laptop.Presence.Service"
|
2006-06-14 14:42:44 -04:00
|
|
|
|
2006-07-19 15:27:37 -04: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-12 18:31:26 -04:00
|
|
|
|
2006-07-19 15:27:37 -04:00
|
|
|
def object_path(self):
|
|
|
|
|
return self._object_path
|
2006-06-18 01:31:18 -04:00
|
|
|
|
2006-07-19 15:27:37 -04:00
|
|
|
def getProperties(self):
|
|
|
|
|
return self._service.getProperties()
|
2006-06-22 18:07:54 -04:00
|
|
|
|
2006-07-19 15:27:37 -04:00
|
|
|
def getPublishedValue(self, key):
|
|
|
|
|
value = self._service.getPublishedValue(key)
|