Sends all the command to the given pipe to give it the
current data
433736
protected function sendData()
    {
        foreach ($this->values as $index => $data) {
            foreach ($data as $xy) {
                list($x, $y) = $xy;
                $this->sendCommand($x.' '.$y);
            }
            $this->sendCommand('e');
        }
    }
878815
async def _send_command(self, command):
        
        send_message = ""

        for i in command:
            send_message += chr(i)
        result = None
        for data in send_message:
            try:
                result = await self.write(data)
            except():
                if self.log_output:
                    logging.exception('cannot send command')
                else:
                    print('cannot send command')
        return result
313469
def _self_pipe(self):
        
        import fcntl

        self._poll_fd, self._poll_send = os.pipe()
        for fd in [self._poll_fd, self._poll_send]:
            fl = fcntl.fcntl(fd, fcntl.F_GETFL)
            fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK)
21027
def write_command(self, command: Command):
        '''
        '''
        _logger.debug('Write command.')
        data = command.to_bytes()
        yield from self._connection.write(data)
        self._data_event_dispatcher.notify_write(data)
604883
def _send_command(self, command):
        
        try:
            if isinstance(command, list):
                for cmd in command:
                    output = self.device.send_command(cmd)
                    if "% Invalid" not in output:
                        break
            else:
                output = self.device.send_command(command)
            return self._send_command_postprocess(output)
        except (socket.error, EOFError) as e:
            raise ConnectionClosedException(str(e))
316971
def send(command, data):
    
    global _lock
    try:
        _lock.acquire()
        data = data.encode('utf8')
        assert len(data) < 1000000, 'Command too long'
        msg = b'%b%06d%b' % (command.value, len(data), data)
        logging.getLogger(__name__).debug('Sending command, data: [%s]' % msg)
        _out_file.write(msg)
        _out_file.flush()
    finally:
        _lock.release()
1244363
private void pumpInputData() throws IOException {
    for (Input input : inputs) {
      if (input.pump == null) {
        continue;
      }
      OutputStream os;
      if (input.pipeName.equals(STDIN_FILE_NAME)) {
        os = process.getOutputStream();
      } else {
        throw new IOException("Only stdin piping is supported so far.");
      }
      input.pump.pump(os);
    }
  }
830130
def send(self, data):
        
        self.stdin.write(data)
        self.stdin.flush()
805586
def cmd(send, _, args):
    
    with args['handler'].data_lock:
        channels = ", ".join(sorted(args['handler'].channels))
    send(channels)
70823
def send_command(self, obj, command, *arguments):
        
        index_command = obj._build_index_command(command, *arguments)
        self.chassis_list[obj.chassis].sendQueryVerify(index_command)
508048
def send(self, data):
        
        assert isinstance(data, text_type)

        # When data is send back to the client, we should replace the line
        # endings. (We didn't allocate a real pseudo terminal, and the telnet
        # connection is raw, so we are responsible for inserting \r.)
        self.stdout.write(data.replace('\n', '\r\n'))
        self.stdout.flush()
567068
def sendall(self, data, **kws):
        """"""
        return SendAll(self, data, timeout=self._timeout, **kws)
703878
def command(cmd, explicit)
      return false unless check_pipe_exist(explicit)

      Timeout.timeout 5 do
        File.open @pipe, 'w' do |p|
          p.puts cmd
        end
      end
      true
    rescue Timeout::Error
      communication_error! 'no response'
    end
26062
def send(self, data):
        
        try:
            if not data:
                raise RconError('no command supplied')
            with self.lock:
                self.socket.send(self._rconsendstring.format(self.password, data))
        except socket.error, e:
            raise RconError(e.message, e)
        else:
            timeout = self._timeout
            command = data.split(' ')[0]
            if command in self._long_commands_timeout:
                timeout = self._long_commands_timeout[command]
            return self.recvall(timeout=timeout)
521640
def pipe_commands_to_file(cmds, path, extra_env=None, show_stderr=False):
    
    env = extend_env(extra_env) if extra_env else None
    env_str = (get_env_str(extra_env) + ' ') if extra_env else ''
    cmd_strs = [env_str + ' '.join(cmd) for cmd in cmds]

    logger.info('Saving output of `{0}`'.format(' | '.join(cmd_strs)))

    with open('/dev/null', 'w') as NULL:
        # Start processes
        processes = []
        for cmd_str, cmd in zip(cmd_strs, cmds):
            p_stdin = processes[-1][1].stdout if processes else None
            p_stderr = None if show_stderr else NULL

            p = Popen(cmd, env=env, stdout=PIPE, stdin=p_stdin, stderr=p_stderr)
            processes.append((cmd_str, p))

        p_last = processes[-1][1]

        with open(path, 'wb') as f:
            shutil.copyfileobj(p_last.stdout, f)

            # Close processes
            error = False
            for cmd_str, p in processes:
                p.stdout.close()
                if p.wait() != 0:
                    error = True
            if error:
                raise CalledProcessError(cmd=cmd_str, returncode=p.returncode)
458650
def SendCommand(self, command, arg=None):
        
        if arg is not None:
            if not isinstance(arg, bytes):
                arg = arg.encode('utf8')
            command = b'%s:%s' % (command, arg)

        self._Write(io.BytesIO(command), len(command))
297485
def sendline(command):
    '''
    
    '''
    if ping() is False:
        init()
    out, _ = DETAILS[_worker_name()].sendline(command)
    return out