Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMichael Stone <michael@laptop.org>2007-09-10 22:48:33 (GMT)
committer Michael Stone <michael@laptop.org>2007-09-11 16:39:42 (GMT)
commita7b0e02aeaa7882bdf8b613e3c28c3542ad21988 (patch)
treeca3063540332b78f13cc64c0d5ea7f486fbf8e69 /shell
parent88d196d089611e5ea623b658df1aaacb016bfd9d (diff)
Fixes to broken Rainbow calls in Shell service.
Diffstat (limited to 'shell')
-rw-r--r--shell/shellservice.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/shell/shellservice.py b/shell/shellservice.py
index fdb2663..458f941 100644
--- a/shell/shellservice.py
+++ b/shell/shellservice.py
@@ -23,6 +23,8 @@ _DBUS_SHELL_IFACE = "org.laptop.Shell"
_DBUS_OWNER_IFACE = "org.laptop.Shell.Owner"
_DBUS_PATH = "/org/laptop/Shell"
+_DBUS_RAINBOW_IFACE = "org.laptop.security.Rainbow"
+
class ShellService(dbus.service.Object):
"""Provides d-bus service to script the shell's operations
@@ -105,17 +107,19 @@ class ShellService(dbus.service.Object):
def _get_rainbow_service(self):
"""Lazily initializes an interface to the Rainbow security daemon."""
if self._rainbow is None:
- service = iface = 'org.laptop.security.Rainbow'
system_bus = dbus.SystemBus()
- object = system_bus.get_object(service, '/')
- self._rainbow = dbus.Interface(object, dbus_interface=iface,
- follow_name_owner_change=True)
+ object = system_bus.get_object(_DBUS_RAINBOW_IFACE, '/',
+ follow_name_owner_changes=True)
+ self._rainbow = dbus.Interface(object,
+ dbus_interface=_DBUS_RAINBOW_IFACE)
return self._rainbow
@dbus.service.signal(_DBUS_OWNER_IFACE, signature="s")
def CurrentActivityChanged(self, activity_id):
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):
new_id = ""