Search in sources :

Example 1 with IronPythonSdkFlavor

use of com.jetbrains.python.sdk.flavors.IronPythonSdkFlavor in project intellij-community by JetBrains.

the class GenerateBinaryStubsFix method isApplicable.

/**
   * Checks if this fix can help you to generate binary stubs
   *
   * @param importStatementBase statement to fix
   * @return true if this fix could work
   */
public static boolean isApplicable(@NotNull final PyImportStatementBase importStatementBase) {
    if (importStatementBase.getFullyQualifiedObjectNames().isEmpty() && !(importStatementBase instanceof PyFromImportStatement && ((PyFromImportStatement) importStatementBase).isStarImport())) {
        return false;
    }
    final Sdk sdk = getPythonSdk(importStatementBase);
    if (sdk == null) {
        return false;
    }
    final PythonSdkFlavor flavor = PythonSdkFlavor.getFlavor(sdk);
    if (flavor instanceof IronPythonSdkFlavor) {
        return true;
    }
    return isGtk(importStatementBase);
}
Also used : IronPythonSdkFlavor(com.jetbrains.python.sdk.flavors.IronPythonSdkFlavor) PythonSdkFlavor(com.jetbrains.python.sdk.flavors.PythonSdkFlavor) IronPythonSdkFlavor(com.jetbrains.python.sdk.flavors.IronPythonSdkFlavor) Sdk(com.intellij.openapi.projectRoots.Sdk)

Aggregations

Sdk (com.intellij.openapi.projectRoots.Sdk)1 IronPythonSdkFlavor (com.jetbrains.python.sdk.flavors.IronPythonSdkFlavor)1 PythonSdkFlavor (com.jetbrains.python.sdk.flavors.PythonSdkFlavor)1