Search in sources :

Example 1 with HelperPackage

use of com.jetbrains.python.HelperPackage in project intellij-community by JetBrains.

the class BuildoutFacet method patchCommandLineForBuildout.

public void patchCommandLineForBuildout(GeneralCommandLine commandLine) {
    Map<String, String> env = commandLine.getEnvironment();
    ParametersList params = commandLine.getParametersList();
    // alter execution script
    ParamsGroup scriptParams = params.getParamsGroup(PythonCommandLineState.GROUP_SCRIPT);
    assert scriptParams != null;
    if (scriptParams.getParameters().size() > 0) {
        // expect DjangoUtil.MANAGE_FILE
        String normalScript = scriptParams.getParameters().get(0);
        HelperPackage engulfer = PythonHelper.BUILDOUT_ENGULFER;
        env.put("PYCHARM_ENGULF_SCRIPT", getConfiguration().getScriptName());
        scriptParams.getParametersList().replaceOrPrepend(normalScript, engulfer.asParamString());
    }
    // add pycharm helpers to pythonpath so that fixGetpass is importable
    PythonEnvUtil.addToPythonPath(env, PythonHelpersLocator.getHelpersRoot().getAbsolutePath());
/*
    // set prependable paths
    List<String> paths = facet.getAdditionalPythonPath();
    if (paths != null) {
      path_value = PyUtil.joinWith(File.pathSeparator, paths);
      env.put("PYCHARM_PREPEND_SYSPATH", path_value);
    }
    */
}
Also used : ParamsGroup(com.intellij.execution.configurations.ParamsGroup) ParametersList(com.intellij.execution.configurations.ParametersList) HelperPackage(com.jetbrains.python.HelperPackage)

Aggregations

ParametersList (com.intellij.execution.configurations.ParametersList)1 ParamsGroup (com.intellij.execution.configurations.ParamsGroup)1 HelperPackage (com.jetbrains.python.HelperPackage)1