From 1de53dca6445b7f25cab1de986b9868f5cff8c30 Mon Sep 17 00:00:00 2001 From: Dmitry Trofimov Date: Mon, 15 Apr 2013 15:53:07 +0200 Subject: [PATCH 01/13] Fix resolving of python members (PY-9512). --- python/helpers/pydev/pydevd_resolver.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/helpers/pydev/pydevd_resolver.py b/python/helpers/pydev/pydevd_resolver.py index 2ced2c95a4c0..114b8494b654 100644 --- a/python/helpers/pydev/pydevd_resolver.py +++ b/python/helpers/pydev/pydevd_resolver.py @@ -164,6 +164,8 @@ class DefaultResolver: filterBuiltIn = True names = dir(var) + if not names and hasattr(var, '__members__'): + names = var.__members__ d = {} #Be aware that the order in which the filters are applied attempts to From d576b7ff8df096f6675f8f8d26d5a47832b8fe19 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 15 Apr 2013 18:21:22 +0200 Subject: [PATCH 02/13] include resources directories in the build of l10n and rest plugins --- python/build/python_plugin_build.gant | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/python/build/python_plugin_build.gant b/python/build/python_plugin_build.gant index a364483f6720..2b9eb23cefee 100644 --- a/python/build/python_plugin_build.gant +++ b/python/build/python_plugin_build.gant @@ -33,6 +33,8 @@ setProperty("restSrcDir", "${pluginHome}/rest/src") setProperty("localizationSrcDir", "${pluginHome}/localization/src") setProperty("resourcesDir", "${pluginHome}/resources") +setProperty("restResourcesDir", "${pluginHome}/rest/resources") +setProperty("localizationResourcesDir", "${pluginHome}/localization/resources") setProperty("pluginResourcesDir", "${pluginHome}/pluginResources") setProperty("classesRootDir", "${outDir}/classes") @@ -131,6 +133,12 @@ target(name: "compileRest", description: "Compile module rest") { type(type: "file") } } + ant.copy(todir: "${restClassesDir}") { + fileset(dir: "${restResourcesDir}") { + patternset(refid: "resources.pt") + type(type: "file") + } + } //copy plugin.xml ant.mkdir(dir: "${restClassesDir}/META-INF") @@ -193,6 +201,12 @@ target(name: "compileLocalization", description: "Compile module localization") type(type: "file") } } + ant.copy(todir: "${localizationClassesDir}") { + fileset(dir: "${localizationResourcesDir}") { + patternset(refid: "resources.pt") + type(type: "file") + } + } //copy plugin.xml ant.mkdir(dir: "${localizationClassesDir}/META-INF") From 297fb2c18f06bbdb10d1f593ba8c067410a739d2 Mon Sep 17 00:00:00 2001 From: Dmitry Trofimov Date: Tue, 16 Apr 2013 17:34:48 +0200 Subject: [PATCH 03/13] Added warning about threadframe module (PY-9172). --- python/helpers/pydev/pydevd_additional_thread_info.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/helpers/pydev/pydevd_additional_thread_info.py b/python/helpers/pydev/pydevd_additional_thread_info.py index e44eeac81bab..d2d3fffbce82 100644 --- a/python/helpers/pydev/pydevd_additional_thread_info.py +++ b/python/helpers/pydev/pydevd_additional_thread_info.py @@ -143,4 +143,6 @@ else: except: #If all fails, let's use the support without frames PyDBAdditionalThreadInfo = PyDBAdditionalThreadInfoWithoutCurrentFramesSupport - + + sys.stderr.write("pydev debugger: warning: sys._current_frames is not supported in Python 2.4, it is recommended to install threadframe module\n") + sys.stderr.write("pydev debugger: warning: See http://majid.info/blog/threadframe-multithreaded-stack-frame-extraction-for-python/\n") From ffc180d5600d0ddfaf2d13242b1220214d643033 Mon Sep 17 00:00:00 2001 From: Dmitry Trofimov Date: Wed, 17 Apr 2013 13:20:43 +0200 Subject: [PATCH 04/13] manage.py tasks work for remote interpreters (PY-9513). --- .../python/run/PyRemoteProcessStarter.java | 56 +++++++++++++++++++ .../python/run/PythonCommandLineState.java | 36 ++---------- .../com/jetbrains/python/run/PythonTask.java | 14 ++++- 3 files changed, 72 insertions(+), 34 deletions(-) create mode 100644 python/src/com/jetbrains/python/run/PyRemoteProcessStarter.java diff --git a/python/src/com/jetbrains/python/run/PyRemoteProcessStarter.java b/python/src/com/jetbrains/python/run/PyRemoteProcessStarter.java new file mode 100644 index 000000000000..77ac1231c905 --- /dev/null +++ b/python/src/com/jetbrains/python/run/PyRemoteProcessStarter.java @@ -0,0 +1,56 @@ +package com.jetbrains.python.run; + +import com.intellij.execution.ExecutionException; +import com.intellij.execution.configurations.GeneralCommandLine; +import com.intellij.execution.process.ProcessHandler; +import com.intellij.execution.process.ProcessTerminatedListener; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.projectRoots.Sdk; +import com.intellij.openapi.ui.Messages; +import com.intellij.util.PathMappingSettings; +import com.jetbrains.python.remote.PyRemoteSdkAdditionalData; +import com.jetbrains.python.remote.PythonRemoteInterpreterManager; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * @author traff + */ +public class PyRemoteProcessStarter { + public ProcessHandler startRemoteProcess(@NotNull Sdk sdk, @NotNull GeneralCommandLine commandLine, @Nullable Project project, @Nullable PathMappingSettings mappingSettings) + throws ExecutionException { + PythonRemoteInterpreterManager manager = PythonRemoteInterpreterManager.getInstance(); + if (manager != null) { + ProcessHandler processHandler; + + while (true) { + try { + processHandler = doStartRemoteProcess(sdk, commandLine, manager, project, mappingSettings); + break; + } + catch (ExecutionException e) { + if (Messages.showYesNoDialog(e.getMessage() + "\nTry again?", "Can't Run Remote Interpreter", Messages.getErrorIcon()) == + Messages.NO) { + throw new ExecutionException("Can't run remote python interpreter: " + e.getMessage()); + } + } + } + ProcessTerminatedListener.attach(processHandler); + return processHandler; + } + else { + throw new PythonRemoteInterpreterManager.PyRemoteInterpreterExecutionException(); + } + } + + protected ProcessHandler doStartRemoteProcess(@NotNull Sdk sdk, + @NotNull GeneralCommandLine commandLine, + @NotNull PythonRemoteInterpreterManager manager, + @Nullable Project project, + @Nullable PathMappingSettings settings) + throws ExecutionException { + + return manager.startRemoteProcess(project, (PyRemoteSdkAdditionalData)sdk.getSdkAdditionalData(), commandLine, + settings); + } +} diff --git a/python/src/com/jetbrains/python/run/PythonCommandLineState.java b/python/src/com/jetbrains/python/run/PythonCommandLineState.java index 0c131ecc049d..0a0d72f133e1 100644 --- a/python/src/com/jetbrains/python/run/PythonCommandLineState.java +++ b/python/src/com/jetbrains/python/run/PythonCommandLineState.java @@ -164,7 +164,9 @@ public abstract class PythonCommandLineState extends CommandLineState { final ProcessHandler processHandler; if (PySdkUtil.isRemote(sdk)) { - processHandler = startRemoteProcess(sdk, commandLine); + assert sdk != null; + processHandler = + createRemoteProcessStarter().startRemoteProcess(sdk, commandLine, myConfig.getProject(), myConfig.getMappingSettings()); } else { processHandler = doCreateProcess(commandLine); @@ -177,38 +179,10 @@ public abstract class PythonCommandLineState extends CommandLineState { return processHandler; } - private ProcessHandler startRemoteProcess(Sdk sdk, GeneralCommandLine commandLine) throws ExecutionException { - PythonRemoteInterpreterManager manager = PythonRemoteInterpreterManager.getInstance(); - if (manager != null) { - ProcessHandler processHandler = - null; - - while (true) { - try { - processHandler = doStartRemoteProcess(sdk, commandLine, manager); - break; - } - catch (ExecutionException e) { - if (Messages.showYesNoDialog(e.getMessage() + "\nTry again?", "Can't Run Remote Interpreter", Messages.getErrorIcon()) == - Messages.NO) { - throw new ExecutionException("Can't run remote python interpreter: " + e.getMessage()); - } - } - } - ProcessTerminatedListener.attach(processHandler); - return processHandler; - } - else { - throw new PythonRemoteInterpreterManager.PyRemoteInterpreterExecutionException(); - } + protected PyRemoteProcessStarter createRemoteProcessStarter() { + return new PyRemoteProcessStarter(); } - protected ProcessHandler doStartRemoteProcess(Sdk sdk, GeneralCommandLine commandLine, PythonRemoteInterpreterManager manager) - throws ExecutionException { - - return manager.startRemoteProcess(myConfig.getProject(), (PyRemoteSdkAdditionalData)sdk.getSdkAdditionalData(), commandLine, - myConfig.getMappingSettings()); - } public GeneralCommandLine generateCommandLine(CommandLinePatcher[] patchers) throws ExecutionException { GeneralCommandLine commandLine = generateCommandLine(); diff --git a/python/src/com/jetbrains/python/run/PythonTask.java b/python/src/com/jetbrains/python/run/PythonTask.java index d0bf589eac4c..1a1496454428 100644 --- a/python/src/com/jetbrains/python/run/PythonTask.java +++ b/python/src/com/jetbrains/python/run/PythonTask.java @@ -18,6 +18,7 @@ import com.intellij.openapi.util.text.StringUtil; import com.intellij.util.NotNullFunction; import com.jetbrains.django.util.OSUtil; import com.jetbrains.python.buildout.BuildoutFacet; +import com.jetbrains.python.sdk.PySdkUtil; import com.jetbrains.python.sdk.PythonEnvUtil; import com.jetbrains.python.sdk.PythonSdkType; import org.jetbrains.annotations.Nullable; @@ -82,9 +83,16 @@ public class PythonTask { public ProcessHandler createProcess() throws ExecutionException { GeneralCommandLine commandLine = createCommandLine(); - ProcessHandler handler = PythonProcessRunner.createProcessHandlingCtrlC(commandLine); + ProcessHandler handler; + if (PySdkUtil.isRemote(mySdk)) { + assert mySdk != null; + handler = new PyRemoteProcessStarter().startRemoteProcess(mySdk, commandLine, myModule.getProject(), null); + } + else { + handler = PythonProcessRunner.createProcessHandlingCtrlC(commandLine); - ProcessTerminatedListener.attach(handler); + ProcessTerminatedListener.attach(handler); + } return handler; } @@ -106,7 +114,7 @@ public class PythonTask { assert scriptParams != null; cmd.setPassParentEnvs(true); Map envs = new HashMap(); - if (!SystemInfo.isWindows) { + if (!SystemInfo.isWindows && !PySdkUtil.isRemote(mySdk)) { cmd.setExePath("bash"); ParamsGroup bashParams = cmd.getParametersList().addParamsGroupAt(0, "Bash"); bashParams.addParameter("-cl"); From 49720799b6aa9a61522d3ca01108faca6681b535 Mon Sep 17 00:00:00 2001 From: Dmitry Trofimov Date: Wed, 17 Apr 2013 15:59:31 +0200 Subject: [PATCH 05/13] Fixed createsuperuser manage.py task (PY-6683). --- python/src/com/jetbrains/python/run/PythonTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/src/com/jetbrains/python/run/PythonTask.java b/python/src/com/jetbrains/python/run/PythonTask.java index 1a1496454428..17971ed49367 100644 --- a/python/src/com/jetbrains/python/run/PythonTask.java +++ b/python/src/com/jetbrains/python/run/PythonTask.java @@ -114,7 +114,7 @@ public class PythonTask { assert scriptParams != null; cmd.setPassParentEnvs(true); Map envs = new HashMap(); - if (!SystemInfo.isWindows && !PySdkUtil.isRemote(mySdk)) { + if (1==2 && !SystemInfo.isWindows && !PySdkUtil.isRemote(mySdk)) { cmd.setExePath("bash"); ParamsGroup bashParams = cmd.getParametersList().addParamsGroupAt(0, "Bash"); bashParams.addParameter("-cl"); From 56203f9a5907e81be1e924245dd40d5d68725e11 Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Wed, 17 Apr 2013 16:11:24 +0200 Subject: [PATCH 06/13] use standard focus management instead of later invocators --- .../com/jetbrains/python/console/PydevConsoleRunner.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/python/src/com/jetbrains/python/console/PydevConsoleRunner.java b/python/src/com/jetbrains/python/console/PydevConsoleRunner.java index 5e68993a5713..97309b117d07 100644 --- a/python/src/com/jetbrains/python/console/PydevConsoleRunner.java +++ b/python/src/com/jetbrains/python/console/PydevConsoleRunner.java @@ -116,6 +116,11 @@ public class PydevConsoleRunner extends AbstractConsoleRunnerWithHistory fillToolBarActions(final DefaultActionGroup toolbarActions, final Executor defaultExecutor, @@ -378,9 +383,6 @@ public class PydevConsoleRunner extends AbstractConsoleRunnerWithHistory Date: Wed, 17 Apr 2013 16:24:37 +0200 Subject: [PATCH 07/13] make auto focus for all consoles with history --- .../src/com/jetbrains/python/console/PydevConsoleRunner.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/python/src/com/jetbrains/python/console/PydevConsoleRunner.java b/python/src/com/jetbrains/python/console/PydevConsoleRunner.java index 97309b117d07..d09bf4201e05 100644 --- a/python/src/com/jetbrains/python/console/PydevConsoleRunner.java +++ b/python/src/com/jetbrains/python/console/PydevConsoleRunner.java @@ -116,10 +116,6 @@ public class PydevConsoleRunner extends AbstractConsoleRunnerWithHistory fillToolBarActions(final DefaultActionGroup toolbarActions, From 1d8313a61d9a0698a35d54e5e20c2e72520b1e81 Mon Sep 17 00:00:00 2001 From: Dmitry Trofimov Date: Wed, 17 Apr 2013 16:32:57 +0200 Subject: [PATCH 08/13] We should override getpass for Unix too. --- python/helpers/pycharm/fix_getpass.py | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/python/helpers/pycharm/fix_getpass.py b/python/helpers/pycharm/fix_getpass.py index 1ef209c3384e..c81d93523238 100644 --- a/python/helpers/pycharm/fix_getpass.py +++ b/python/helpers/pycharm/fix_getpass.py @@ -1,12 +1,10 @@ -# on win32, redefines getpass from too clandestine to more explicit -import sys def fixGetpass(): - if sys.platform == 'win32': - import getpass - import warnings - fallback = getattr(getpass, 'fallback_getpass', None) # >= 2.6 - if not fallback: - fallback = getpass.default_getpass # <= 2.5 - getpass.getpass = fallback - if hasattr(getpass, 'GetPassWarning'): - warnings.simplefilter("ignore", category=getpass.GetPassWarning) + import getpass + import warnings + fallback = getattr(getpass, 'fallback_getpass', None) # >= 2.6 + if not fallback: + fallback = getpass.default_getpass # <= 2.5 + getpass.getpass = fallback + if hasattr(getpass, 'GetPassWarning'): + warnings.simplefilter("ignore", category=getpass.GetPassWarning) + From 862ccef1ccfc1b95771445f2ff155acde54f70c8 Mon Sep 17 00:00:00 2001 From: Dmitry Trofimov Date: Wed, 17 Apr 2013 17:12:47 +0200 Subject: [PATCH 09/13] Fixed getpass in debugger (PY-4012). --- python/helpers/pydev/fix_getpass.py | 10 ++++++++++ python/helpers/pydev/pydevd.py | 3 +++ 2 files changed, 13 insertions(+) create mode 100644 python/helpers/pydev/fix_getpass.py diff --git a/python/helpers/pydev/fix_getpass.py b/python/helpers/pydev/fix_getpass.py new file mode 100644 index 000000000000..c81d93523238 --- /dev/null +++ b/python/helpers/pydev/fix_getpass.py @@ -0,0 +1,10 @@ +def fixGetpass(): + import getpass + import warnings + fallback = getattr(getpass, 'fallback_getpass', None) # >= 2.6 + if not fallback: + fallback = getpass.default_getpass # <= 2.5 + getpass.getpass = fallback + if hasattr(getpass, 'GetPassWarning'): + warnings.simplefilter("ignore", category=getpass.GetPassWarning) + diff --git a/python/helpers/pydev/pydevd.py b/python/helpers/pydev/pydevd.py index 8d68e503c7cb..b75d388bc80b 100644 --- a/python/helpers/pydev/pydevd.py +++ b/python/helpers/pydev/pydevd.py @@ -5,6 +5,7 @@ from pydevd_frame import add_exception_to_frame from pydevd_constants import * #@UnusedWildImport import pydev_imports from pydevd_breakpoints import * #@UnusedWildImport +import fix_getpass from pydevd_comm import CMD_CHANGE_VARIABLE, \ CMD_EVALUATE_EXPRESSION, \ @@ -1433,6 +1434,8 @@ if __name__ == '__main__': import pydevd_psyco_stub sys.modules['psyco'] = pydevd_psyco_stub + fix_getpass.fixGetpass() + pydev_log.debug("Executing file %s" % setup['file']) pydev_log.debug("arguments: %s"% str(sys.argv)) From 73f0ba3db74161ffb725967c1107fa4628a7caf0 Mon Sep 17 00:00:00 2001 From: Dmitry Trofimov Date: Wed, 17 Apr 2013 17:20:25 +0200 Subject: [PATCH 10/13] Fix getpass in pydevconsole. --- python/helpers/pydev/pydevconsole.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/helpers/pydev/pydevconsole.py b/python/helpers/pydev/pydevconsole.py index 1f75c21fd2f2..6b2688162948 100644 --- a/python/helpers/pydev/pydevconsole.py +++ b/python/helpers/pydev/pydevconsole.py @@ -14,6 +14,8 @@ else: import threading import traceback +import fix_getpass +fix_getpass.fixGetpass() try: if USE_LIB_COPY: From eb3aa615c5bbc8bc569d68e9697ba44dc1bc0c54 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Wed, 17 Apr 2013 17:16:25 +0400 Subject: [PATCH 11/13] NotNull --- .../src/com/jetbrains/python/psi/PyStubElementType.java | 3 ++- .../documentation/doctest/PyDocstringFileElementType.java | 2 ++ python/src/com/jetbrains/python/psi/PyFileElementType.java | 6 ++++-- .../python/psi/impl/stubs/PyAnnotationElementType.java | 5 +++-- .../python/psi/impl/stubs/PyClassElementType.java | 7 ++++--- .../python/psi/impl/stubs/PyDecoratorCallElementType.java | 5 +++-- .../python/psi/impl/stubs/PyDecoratorListElementType.java | 5 +++-- .../python/psi/impl/stubs/PyExceptPartElementType.java | 5 +++-- .../psi/impl/stubs/PyFromImportStatementElementType.java | 5 +++-- .../python/psi/impl/stubs/PyFunctionElementType.java | 7 ++++--- .../python/psi/impl/stubs/PyImportElementElementType.java | 5 +++-- .../psi/impl/stubs/PyImportStatementElementType.java | 5 +++-- .../python/psi/impl/stubs/PyNamedParameterElementType.java | 5 +++-- .../python/psi/impl/stubs/PyParameterListElementType.java | 5 +++-- .../psi/impl/stubs/PySingleStarParameterElementType.java | 5 +++-- .../psi/impl/stubs/PyTargetExpressionElementType.java | 7 ++++--- .../python/psi/impl/stubs/PyTupleParameterElementType.java | 5 +++-- 17 files changed, 53 insertions(+), 34 deletions(-) diff --git a/python/psi-api/src/com/jetbrains/python/psi/PyStubElementType.java b/python/psi-api/src/com/jetbrains/python/psi/PyStubElementType.java index 63aa84ac338a..7ac7547e2c47 100644 --- a/python/psi-api/src/com/jetbrains/python/psi/PyStubElementType.java +++ b/python/psi-api/src/com/jetbrains/python/psi/PyStubElementType.java @@ -24,9 +24,10 @@ public abstract class PyStubElementType { return ((PyFile)file).getLanguageLevel(); } + @NotNull @Override public String getExternalId() { return "python.FILE"; } @Override - public void serialize(PyFileStub stub, StubOutputStream dataStream) throws IOException { + public void serialize(@NotNull PyFileStub stub, @NotNull StubOutputStream dataStream) throws IOException { writeNullableList(dataStream, stub.getDunderAll()); writeBitSet(dataStream, stub.getFutureFeatures()); dataStream.writeName(stub.getDeprecationMessage()); } + @NotNull @Override - public PyFileStub deserialize(StubInputStream dataStream, StubElement parentStub) throws IOException { + public PyFileStub deserialize(@NotNull StubInputStream dataStream, StubElement parentStub) throws IOException { List all = readNullableList(dataStream); BitSet future_features = readBitSet(dataStream); StringRef deprecationMessage = dataStream.readName(); diff --git a/python/src/com/jetbrains/python/psi/impl/stubs/PyAnnotationElementType.java b/python/src/com/jetbrains/python/psi/impl/stubs/PyAnnotationElementType.java index 7512acd3befd..daa5038f2f45 100644 --- a/python/src/com/jetbrains/python/psi/impl/stubs/PyAnnotationElementType.java +++ b/python/src/com/jetbrains/python/psi/impl/stubs/PyAnnotationElementType.java @@ -38,11 +38,12 @@ public class PyAnnotationElementType extends PyStubElementType getStubElementType()); } - public void serialize(final PyClassStub pyClassStub, final StubOutputStream dataStream) throws IOException { + public void serialize(@NotNull final PyClassStub pyClassStub, @NotNull final StubOutputStream dataStream) throws IOException { dataStream.writeName(pyClassStub.getName()); final PyQualifiedName[] classes = pyClassStub.getSuperClasses(); dataStream.writeByte(classes.length); @@ -66,7 +66,8 @@ public class PyClassElementType extends PyStubElementType dataStream.writeUTFFast(docString != null ? docString : ""); } - public PyClassStub deserialize(final StubInputStream dataStream, final StubElement parentStub) throws IOException { + @NotNull + public PyClassStub deserialize(@NotNull final StubInputStream dataStream, final StubElement parentStub) throws IOException { String name = StringRef.toString(dataStream.readName()); int superClassCount = dataStream.readByte(); PyQualifiedName[] superClasses = new PyQualifiedName[superClassCount]; @@ -78,7 +79,7 @@ public class PyClassElementType extends PyStubElementType return new PyClassStubImpl(name, parentStub, superClasses, slots, docString.length() > 0 ? docString : null, getStubElementType()); } - public void indexStub(final PyClassStub stub, final IndexSink sink) { + public void indexStub(@NotNull final PyClassStub stub, @NotNull final IndexSink sink) { final String name = stub.getName(); if (name != null) { sink.occurrence(PyClassNameIndex.KEY, name); diff --git a/python/src/com/jetbrains/python/psi/impl/stubs/PyDecoratorCallElementType.java b/python/src/com/jetbrains/python/psi/impl/stubs/PyDecoratorCallElementType.java index 9eff8fae4d23..1d78a798d5aa 100644 --- a/python/src/com/jetbrains/python/psi/impl/stubs/PyDecoratorCallElementType.java +++ b/python/src/com/jetbrains/python/psi/impl/stubs/PyDecoratorCallElementType.java @@ -36,11 +36,12 @@ public class PyDecoratorCallElementType extends PyStubElementType 0 ? docString : null, deprecationMessage, parentStub, getStubElementType()); } - public void indexStub(final PyFunctionStub stub, final IndexSink sink) { + public void indexStub(@NotNull final PyFunctionStub stub, @NotNull final IndexSink sink) { final String name = stub.getName(); if (name != null) { sink.occurrence(PyFunctionNameIndex.KEY, name); diff --git a/python/src/com/jetbrains/python/psi/impl/stubs/PyImportElementElementType.java b/python/src/com/jetbrains/python/psi/impl/stubs/PyImportElementElementType.java index 3cbc48b5fa9b..e2d6dad14c8e 100644 --- a/python/src/com/jetbrains/python/psi/impl/stubs/PyImportElementElementType.java +++ b/python/src/com/jetbrains/python/psi/impl/stubs/PyImportElementElementType.java @@ -46,12 +46,13 @@ public class PyImportElementElementType extends PyStubElementType Date: Thu, 18 Apr 2013 14:14:58 +0200 Subject: [PATCH 12/13] Fixed broken condition. --- python/src/com/jetbrains/python/run/PythonTask.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/src/com/jetbrains/python/run/PythonTask.java b/python/src/com/jetbrains/python/run/PythonTask.java index 17971ed49367..1a1496454428 100644 --- a/python/src/com/jetbrains/python/run/PythonTask.java +++ b/python/src/com/jetbrains/python/run/PythonTask.java @@ -114,7 +114,7 @@ public class PythonTask { assert scriptParams != null; cmd.setPassParentEnvs(true); Map envs = new HashMap(); - if (1==2 && !SystemInfo.isWindows && !PySdkUtil.isRemote(mySdk)) { + if (!SystemInfo.isWindows && !PySdkUtil.isRemote(mySdk)) { cmd.setExePath("bash"); ParamsGroup bashParams = cmd.getParametersList().addParamsGroupAt(0, "Bash"); bashParams.addParameter("-cl"); From b2816e58d0510e07e4dda4fa987d4abfecd7c404 Mon Sep 17 00:00:00 2001 From: Alexey Kudravtsev Date: Thu, 18 Apr 2013 17:08:27 +0400 Subject: [PATCH 13/13] NotNull --- .../jetbrains/python/inspections/PyTypeCheckerInspection.java | 2 +- .../python/inspections/PyUnresolvedReferencesInspection.java | 2 +- .../jetbrains/python/inspections/PyUnusedLocalInspection.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/src/com/jetbrains/python/inspections/PyTypeCheckerInspection.java b/python/src/com/jetbrains/python/inspections/PyTypeCheckerInspection.java index 5b51beb6b42a..95d870b77379 100644 --- a/python/src/com/jetbrains/python/inspections/PyTypeCheckerInspection.java +++ b/python/src/com/jetbrains/python/inspections/PyTypeCheckerInspection.java @@ -109,7 +109,7 @@ public class PyTypeCheckerInspection extends PyInspection { } @Override - public void inspectionFinished(LocalInspectionToolSession session, ProblemsHolder problemsHolder) { + public void inspectionFinished(@NotNull LocalInspectionToolSession session, @NotNull ProblemsHolder problemsHolder) { if (LOG.isDebugEnabled()) { final Long startTime = session.getUserData(TIME_KEY); if (startTime != null) { diff --git a/python/src/com/jetbrains/python/inspections/PyUnresolvedReferencesInspection.java b/python/src/com/jetbrains/python/inspections/PyUnresolvedReferencesInspection.java index e292d30494e2..1099d990ea48 100644 --- a/python/src/com/jetbrains/python/inspections/PyUnresolvedReferencesInspection.java +++ b/python/src/com/jetbrains/python/inspections/PyUnresolvedReferencesInspection.java @@ -94,7 +94,7 @@ public class PyUnresolvedReferencesInspection extends PyInspection { } @Override - public void inspectionFinished(LocalInspectionToolSession session, ProblemsHolder holder) { + public void inspectionFinished(@NotNull LocalInspectionToolSession session, @NotNull ProblemsHolder holder) { final Visitor visitor = session.getUserData(KEY); assert visitor != null; if (PyCodeInsightSettings.getInstance().HIGHLIGHT_UNUSED_IMPORTS) { diff --git a/python/src/com/jetbrains/python/inspections/PyUnusedLocalInspection.java b/python/src/com/jetbrains/python/inspections/PyUnusedLocalInspection.java index 242d22d6d6a7..ff585a2b7645 100644 --- a/python/src/com/jetbrains/python/inspections/PyUnusedLocalInspection.java +++ b/python/src/com/jetbrains/python/inspections/PyUnusedLocalInspection.java @@ -45,7 +45,7 @@ public class PyUnusedLocalInspection extends PyInspection { } @Override - public void inspectionFinished(LocalInspectionToolSession session, ProblemsHolder holder) { + public void inspectionFinished(@NotNull LocalInspectionToolSession session, @NotNull ProblemsHolder holder) { final PyUnusedLocalInspectionVisitor visitor = session.getUserData(KEY); if (visitor != null) { visitor.registerProblems();