/**
   * Launches the python process.
   *
   * <p>Modelled after Ant & Java runners see WorkbenchLaunchConfigurationDelegate::launch
   */
  @Override
  public void launch(
      ILaunchConfiguration conf, String mode, ILaunch launch, IProgressMonitor monitor)
      throws CoreException {
    if (monitor == null) {
      monitor = new NullProgressMonitor();
    }

    monitor.beginTask("Preparing configuration", 1);
    monitor.worked(1);

    ProcessServer p = new ProcessServer();
    String label = "Debug Server";
    HashMap<String, String> processAttributes = new HashMap<String, String>();
    processAttributes.put(IProcess.ATTR_PROCESS_TYPE, Constants.PROCESS_TYPE);
    processAttributes.put(IProcess.ATTR_PROCESS_LABEL, label);
    processAttributes.put(DebugPlugin.ATTR_CAPTURE_OUTPUT, "true");

    IProcess pro = DebugPlugin.newProcess(launch, p, label, processAttributes);

    RemoteDebuggerServer.getInstance().setLaunch(launch, p, pro);
  }
Exemplo n.º 2
0
 /** @return true if the debug server is running and false otherwise. */
 public static boolean isRunning() {
   RemoteDebuggerServer instance = RemoteDebuggerServer.getInstance();
   return !instance.isTerminated();
 }
Exemplo n.º 3
0
 /** This method will stop the debug server. */
 public static void stopServer() {
   RemoteDebuggerServer.getInstance().stopListening();
 }
Exemplo n.º 4
0
  /** This method will start the debug server. */
  public static void startServer() {
    RemoteDebuggerServer.getInstance(); // doing that, it will automatically start it

    PydevdServerLaunchShortcut s = new PydevdServerLaunchShortcut();
    s.launch((IResource[]) null, "run");
  }