def send_command(self, command, force=False):
        if self.attachment_status != apiAttachSuccess and not force:
            self.attach(command.Timeout)
        self.push_command(command)
        self.notifier.sending_command(command)
        cmd = u'#%d %s' % (command.Id, command.Command)
        self.logger.debug('sending %s', repr(cmd))
        if command.Blocking:
            command._event = bevent = threading.Event()
        else:
            command._timer = timer = threading.Timer(command.timeout2float(), self.pop_command, (command.Id,))
        event = XEvent()
        event.xclient.type = ClientMessage
        event.xclient.display = self.disp
        event.xclient.window = self.win_self
        event.xclient.message_type = self.atom_msg_begin
        event.xclient.format = 8
        cmd = cmd.encode('utf-8') + '\x00'
        for i in xrange(0, len(cmd), 20):
            event.xclient.data = cmd[i:i + 20]
            x11.XSendEvent(self.disp, self.win_skype, False, 0, byref(event))
            event.xclient.message_type = self.atom_msg
        self.loop_event.set()
        if command.Blocking:
            bevent.wait(command.timeout2float())
            if not bevent.isSet():
                raise SkypeAPIError('Skype command timeout')
        else:
            timer.start()
dataset/ETHPy150Open Skype4Py/Skype4Py/Skype4Py/api/posix_x11.py/SkypeAPI.send_command/original