sugar-toolkit-gtk3/shell/shellservice.py

20 lines
630 B
Python
Raw Normal View History

2007-01-27 12:54:56 +01:00
import dbus
_DBUS_SERVICE = "org.laptop.Shell"
_DBUS_INTERFACE = "org.laptop.Shell"
_DBUS_PATH = "/org/laptop/Shell"
class ShellService(dbus.service.Object):
def __init__(self, shellModel):
self._shellModel = shellModel
bus = dbus.SessionBus()
bus_name = dbus.service.BusName(_DBUS_SERVICE, bus=bus)
dbus.service.Object.__init__(self, bus_name, _DBUS_PATH)
@dbus.service.method(_DBUS_INTERFACE, in_signature="s", out_signature="b")
def add_bundle(self, bundle_path):
registry = self._shellModel.get_bundle_registry()
return registry.add_bundle(bundle_path)