protected void addTracebackFilter(
     Project project, ConsoleView consoleView, ProcessHandler processHandler) {
   if (PySdkUtil.isRemote(myConfig.getSdk())) {
     assert processHandler instanceof RemoteProcessControl;
     consoleView.addMessageFilter(
         new PyRemoteTracebackFilter(
             project, myConfig.getWorkingDirectory(), (RemoteProcessControl) processHandler));
   } else {
     consoleView.addMessageFilter(
         new PythonTracebackFilter(project, myConfig.getWorkingDirectorySafe()));
   }
   consoleView.addMessageFilter(
       createUrlFilter(processHandler)); // Url filter is always nice to have
 }
  @NotNull
  protected ConsoleView createAndAttachConsole(
      Project project, ProcessHandler processHandler, Executor executor) throws ExecutionException {
    final ConsoleView consoleView = createConsoleBuilder(project).getConsole();
    consoleView.addMessageFilter(createUrlFilter(processHandler));

    addTracebackFilter(project, consoleView, processHandler);

    consoleView.attachToProcess(processHandler);
    return consoleView;
  }
Ejemplo n.º 3
0
 public void addMessageFilter(final Filter filter) {
   myConsole.addMessageFilter(filter);
 }