if not isinstance(value, (int, long)):
raise InvalidArgument('incorrect type to %s parameter, got %s, expected an int' % (parm, type(value)))
elif sig == 'b':
- if not isinstance(value, bool):
+ if not isinstance(value, (bool, dbus.types.Boolean)):
raise InvalidArgument('incorrect type to %s parameter, got %s, expected an boolean' % (parm, type(value)))
else:
raise TypeError('unknown type signature %s in protocol parameters' % type)
self._client_handles[sender] = set([(handle.get_type(), handle)])
def get_handle_by_id(self, handle_type, handle_id):
+ # Strip off dbus stuff so we can be consistent
+ handle_type, handle_id = int(handle_type), int(handle_id)
+
self.check_handle(handle_type, handle_id)
return self._handles[handle_type, handle_id]
altered_properties = props.copy()
if target_handle_type != HANDLE_TYPE_NONE:
- if target_handle == None:
- target_handle = self.get_handle_by_name(target_handle_type, target_id).get_id()
+ if target_handle is None:
+ handle = self.get_handle_by_name(target_handle_type, target_id)
+ self.add_client_handle(handle, None)
+ target_handle = handle.get_id()
altered_properties[CHANNEL_INTERFACE + '.TargetHandle'] = \
target_handle
else:
self._validate_handle(request)
props = self._alter_properties(request)
- channel = self._channel_manager.channel_for_props(props, signal=False)
+ channel = self._channel_manager.create_channel_for_props(props, signal=False)
# Remove mutable properties
todel = []