Merge branch 'master' of git+ssh://dev.laptop.org/git/sugar
This commit is contained in:
commit
5ae294325c
@ -23,6 +23,8 @@ _DBUS_SHELL_IFACE = "org.laptop.Shell"
|
|||||||
_DBUS_OWNER_IFACE = "org.laptop.Shell.Owner"
|
_DBUS_OWNER_IFACE = "org.laptop.Shell.Owner"
|
||||||
_DBUS_PATH = "/org/laptop/Shell"
|
_DBUS_PATH = "/org/laptop/Shell"
|
||||||
|
|
||||||
|
_DBUS_RAINBOW_IFACE = "org.laptop.security.Rainbow"
|
||||||
|
|
||||||
class ShellService(dbus.service.Object):
|
class ShellService(dbus.service.Object):
|
||||||
"""Provides d-bus service to script the shell's operations
|
"""Provides d-bus service to script the shell's operations
|
||||||
|
|
||||||
@ -105,17 +107,19 @@ class ShellService(dbus.service.Object):
|
|||||||
def _get_rainbow_service(self):
|
def _get_rainbow_service(self):
|
||||||
"""Lazily initializes an interface to the Rainbow security daemon."""
|
"""Lazily initializes an interface to the Rainbow security daemon."""
|
||||||
if self._rainbow is None:
|
if self._rainbow is None:
|
||||||
service = iface = 'org.laptop.security.Rainbow'
|
|
||||||
system_bus = dbus.SystemBus()
|
system_bus = dbus.SystemBus()
|
||||||
object = system_bus.get_object(service, '/')
|
object = system_bus.get_object(_DBUS_RAINBOW_IFACE, '/',
|
||||||
self._rainbow = dbus.Interface(object, dbus_interface=iface,
|
follow_name_owner_changes=True)
|
||||||
follow_name_owner_change=True)
|
self._rainbow = dbus.Interface(object,
|
||||||
|
dbus_interface=_DBUS_RAINBOW_IFACE)
|
||||||
return self._rainbow
|
return self._rainbow
|
||||||
|
|
||||||
@dbus.service.signal(_DBUS_OWNER_IFACE, signature="s")
|
@dbus.service.signal(_DBUS_OWNER_IFACE, signature="s")
|
||||||
def CurrentActivityChanged(self, activity_id):
|
def CurrentActivityChanged(self, activity_id):
|
||||||
if os.path.exists('/etc/olpc-security'):
|
if os.path.exists('/etc/olpc-security'):
|
||||||
self._get_rainbow_service().ChangeActivity(activity_id, dbus_interface=iface)
|
self._get_rainbow_service().ChangeActivity(
|
||||||
|
activity_id,
|
||||||
|
dbus_interface=_DBUS_RAINBOW_IFACE)
|
||||||
|
|
||||||
def _cur_activity_changed_cb(self, owner, new_activity):
|
def _cur_activity_changed_cb(self, owner, new_activity):
|
||||||
new_id = ""
|
new_id = ""
|
||||||
|
Loading…
Reference in New Issue
Block a user