Put the given line into the callback machinery, and set the result on a None line.
4518
def _feed_line(self, line):
        """"""
        if line is None:
            self.set_result(self._callback(self.__spooled_lines))
        else:
            self.__spooled_lines.append(line)
1099399
def set_result(self, key, result):
        """"""
        self.results[key] = result
        if self.yield_point is not None and self.yield_point.is_ready():
            try:
                self.future.set_result(self.yield_point.get_result())
            except:
                self.future.set_exc_info(sys.exc_info())
            self.yield_point = None
            self.run()
376047
def send_line(self, line, parse_result=True):
        
        self.vw_process.sendline(line)  # Send line, along with newline
        result = self._get_response(parse_result=parse_result)
        return result
789750
def accept_line(event):
    "  "
    b = event.current_buffer
    b.accept_action.validate_and_handle(event.cli, b)
179626
def wait_return(self, callback):
        """"""
        if self.check_recv():
            return callback(self)
        _t = threading.Thread(target=self._wait_non_ressources, args=(callback,))  # noqa: E501
        _t.setDaemon(True)
        _t.start()
673211
def set_error_callback(self, callback):
        
        self.logger.debug('Setting error callback: %r', callback)
        self._on_error = callback
1259080
private void startRecording(String line, DispatchCallback callback) {
    OutputFile outputFile = sqlLine.getRecordOutputFile();
    if (outputFile != null) {
      callback.setToFailure();
      sqlLine.error(sqlLine.loc("record-already-running", outputFile));
      return;
    }

    String filename;
    if (line.length() == "record".length()
        || (filename =
            sqlLine.dequote(line.substring("record".length() + 1))) == null) {
      sqlLine.error("Usage: record <file name>");
      callback.setToFailure();
      return;
    }

    try {
      outputFile = new OutputFile(expand(filename));
      sqlLine.setRecordOutputFile(outputFile);
      sqlLine.output(sqlLine.loc("record-started", outputFile));
      callback.setToSuccess();
    } catch (Exception e) {
      callback.setToFailure();
      sqlLine.error(e);
    }
  }
1136505
public void run(String line, DispatchCallback callback) {
    String filename;
    if (line.length() == "run".length()
        || (filename =
            sqlLine.dequote(line.substring("run".length() + 1))) == null) {
      sqlLine.error("Usage: run <file name>");
      callback.setToFailure();
      return;
    }
    List<String> cmds = new LinkedList<>();

    try {
      final Parser parser = sqlLine.getLineReader().getParser();
      try (BufferedReader reader = new BufferedReader(
          new InputStreamReader(
              new FileInputStream(expand(filename)), StandardCharsets.UTF_8))) {
        // ### NOTE: fix for sf.net bug 879427
        final StringBuilder cmd = new StringBuilder();
        boolean needsContinuation;
        for (;;) {
          final String scriptLine = reader.readLine();
          if (scriptLine == null) {
            break;
          }
          // we're continuing an existing command
          cmd.append(" \n");
          cmd.append(scriptLine);

          try {
            needsContinuation = false;
            parser.parse(cmd.toString(), cmd.length(),
                Parser.ParseContext.ACCEPT_LINE);
          } catch (EOFError e) {
            needsContinuation = true;
          }
          if (!needsContinuation && !cmd.toString().trim().isEmpty()) {
            cmds.add(maybeTrim(cmd.toString()));
            cmd.setLength(0);
          }
        }

        if (SqlLineParser.isSql(sqlLine, cmd.toString(),
            Parser.ParseContext.ACCEPT_LINE)) {
          // ### REVIEW: oops, somebody left the last command
          // unterminated; should we fix it for them or complain?
          // For now be nice and fix it.
          cmd.append(";");
          cmds.add(cmd.toString());
        }
      }

      // success only if all the commands were successful
      if (sqlLine.runCommands(cmds, callback) == cmds.size()) {
        callback.setToSuccess();
      } else {
        callback.setToFailure();
      }
    } catch (Exception e) {
      callback.setToFailure();
      sqlLine.error(e);
    }
  }
950065
def insert_line(self, line):
        """"""
        if self.current_block is not None:
            self.current_block.append(line)
        else:
            self.header.append(line)
247650
def _call_setnx(self, command, value):
        
        result = self._traverse_command(command, value)
        if self.indexable and value is not None and result:
            self.index(value)
        return result
1120565
def callback_handler_install(self, prompt, callback):
        
        '''
        self.callback = callback
        self.readline_setup(prompt)
765701
def goto_line(self, line_number):
        """"""
        if line_number:
            line_number = int(line_number)
            try:
                self.plugin.go_to_line(line_number)
            except AttributeError:
                pass
528021
def _setResult(self, result):
        
        if self._result is not _NO_RESULT:
            raise AlreadyCalledError()

        self._result = result
578398
def putResult(self, result):
        """"""
        self._lock_prev_output.acquire()
        for tube in self._tubes_result_output:
            tube.put((result, 0))
        self._lock_next_output.release()
768174
def add_result(self, code, message=None):
        
        self._results.append(Result(code, message))
356454
def push_line(self, line):
        
        self.lineno -= 1
        self._buffer.append(line + b'\n')
67380
def set_call_back(self, func):

        """"""

        self.timer.add_callback(func)
        self.timer.start()