sugar-toolkit-gtk3/shell/shellservice.py

22 lines
664 B
Python
Raw Normal View History

2007-01-27 12:54:56 +01:00
import dbus
2007-02-25 18:03:17 +01:00
from sugar.activity import bundleregistry
2007-01-27 12:54:56 +01:00
_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):
2007-02-25 18:03:17 +01:00
registry = bundleregistry.get_registry()
2007-01-27 12:54:56 +01:00
return registry.add_bundle(bundle_path)