summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2010-03-10 18:59:38 +0000
committerJonny Lamb <jonny.lamb@collabora.co.uk>2010-03-10 18:59:38 +0000
commit2c05b123a294a67d77f8f638fbb41c0cc6068a87 (patch)
tree55926a00ef4e8642fd677921ab67d7bfe37e8265
parent4d4b2a2a1f9ccff96ee9cea4cd25fb814a23a62d (diff)
channel: TargetHandle=0 if the channel handle is None
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r--src/server/channel.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/server/channel.py b/src/server/channel.py
index ed83ee3..7b1ac41 100644
--- a/src/server/channel.py
+++ b/src/server/channel.py
@@ -72,7 +72,7 @@ class Channel(_Channel, DBusProperties):
self._implement_property_get(CHANNEL_INTERFACE,
{'ChannelType': lambda: dbus.String(self.GetChannelType()),
'Interfaces': lambda: dbus.Array(self.GetInterfaces(), signature='s'),
- 'TargetHandle': lambda: dbus.UInt32(self._handle.get_id()),
+ 'TargetHandle': lambda: dbus.UInt32(self._get_target_handle()),
'TargetHandleType': lambda: dbus.UInt32(self._get_handle_type()),
'TargetID': lambda: dbus.String(self._get_target_id()),
'Requested': lambda: self._requested})
@@ -89,6 +89,12 @@ class Channel(_Channel, DBusProperties):
def _add_immutables(self, props):
self._immutable_properties.update(props)
+ def _get_target_handle(self):
+ if self._handle:
+ return self._handle.get_id()
+ else:
+ return 0
+
def _get_handle_type(self):
if self._handle:
return self._handle.get_type()