diff --git a/python/build/build-plugin.xml b/python/build/build-plugin.xml
index bd723494de05..b4c6d4d2988b 100644
--- a/python/build/build-plugin.xml
+++ b/python/build/build-plugin.xml
@@ -1,197 +1,196 @@
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
+
-
+
-
+
-
-
-
-
+
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/python/build/pycharm.sh b/python/build/pycharm.sh
index 44f1a9e86824..04415d96db96 100644
--- a/python/build/pycharm.sh
+++ b/python/build/pycharm.sh
@@ -83,7 +83,7 @@ if [ -z "$PYCHARM_VM_OPTIONS" ]; then
fi
# isEap
-if ["@@isEap@@" -eq "true" ]
+if [ "@@isEap@@" -eq "true" ]; then
$AGENT="-agentlib:yjpagent$BITS=disablej2ee,sessionname=pycharm"
fi
diff --git a/python/build/pycharm_build.gant b/python/build/pycharm_build.gant
index 3cf89800e612..0e4f7c529900 100644
--- a/python/build/pycharm_build.gant
+++ b/python/build/pycharm_build.gant
@@ -486,10 +486,15 @@ def layoutMac(Map args, String target) {
layout(target) {
dir("bin") {
fileset(dir: "$home/community/bin/mac")
- fileset(dir: "$home/community/bin/nix")
+ fileset(dir: "$home/community/bin/nix") {
+ exclude(name: "idea.sh")
+ }
fileset(dir: "$home/bin") {
include(name: "*.jnilib")
}
+ fileset(dir: "$home/python/build") {
+ include(name: "pycharm.sh")
+ }
}
dir("lib") {
fileset(dir: "$home/community/build/conf/mac/lib")
diff --git a/python/helpers/pycharm/django_manage.py b/python/helpers/pycharm/django_manage.py
index 951ff61099a3..1602c37b1055 100644
--- a/python/helpers/pycharm/django_manage.py
+++ b/python/helpers/pycharm/django_manage.py
@@ -1,8 +1,13 @@
#!/usr/bin/env python
from pycharm.fix_getpass import fixGetpass
-from django.core.management import execute_manager
from pycharm import django_settings
+import os
+from runpy import run_module
+
+manage_file = os.getenv('PYCHARM_DJANGO_MANAGE_MODULE')
+if not manage_file:
+ manage_file = 'manage'
if __name__ == "__main__":
fixGetpass()
- execute_manager(django_settings)
+ run_module(manage_file)
diff --git a/python/helpers/pycharm/utrunner.py b/python/helpers/pycharm/utrunner.py
index bf42c8291b90..82980c27c80a 100644
--- a/python/helpers/pycharm/utrunner.py
+++ b/python/helpers/pycharm/utrunner.py
@@ -3,9 +3,19 @@ import os
import imp
import sys
import types
+import re
from pycharm.tcmessages import TeamcityServiceMessages
from pycharm.tcunittest import TeamcityTestRunner
+try:
+ import unittest2 as unittest
+except:
+ # python version doesn't have unittest2
+ pass
+
+PYTHON_VERSION_MAJOR = sys.version_info[0]
+PYTHON_VERSION_MINOR = sys.version_info[1]
+
ENABLE_DEBUG_LOGGING = False
if os.getenv("UTRUNNER_ENABLE_DEBUG_LOGGING"):
ENABLE_DEBUG_LOGGING = True
@@ -39,9 +49,28 @@ def walkModules(modules, dirname, names):
def loadModulesFromFolderRec(folder):
modules = []
- os.path.walk(folder, walkModules, modules)
+ if PYTHON_VERSION_MAJOR == 3:
+ for root, dirs, files in os.walk(folder, walkModules, modules):
+ for name in files:
+ if name.endswith(".py"):
+ modules.append(loadSource(os.path.join(root, name)))
+ else:
+ os.path.walk(folder, walkModules, modules)
+
return modules
+def loadModulesFromFolderUsingPattern(folder, pattern):
+ ''' loads modules from folder ,
+ check if module name matches given pattern'''
+ modules = loadModulesFromFolderRec(folder)
+ result = []
+ prog = re.compile(pattern)
+
+ for module in modules:
+ if prog.match(module.__name__):
+ result.append(module)
+ return result
+
testLoader = unittest.TestLoader()
all = unittest.TestSuite()
@@ -53,12 +82,19 @@ for arg in sys.argv[1:]:
a = arg.split("::")
if len(a) == 1:
# From module or folder
- if a[0].endswith("/"):
- debug("/ from folder " + a[0])
- modules = loadModulesFromFolderRec(a[0])
+ a_splitted = a[0].split(";")
+ if len(a_splitted) != 1:
+ # means we have pattern to match against
+ if a_splitted[0].endswith("/"):
+ debug("/ from folder " + a_splitted[0] + ". Use pattern: " + a_splitted[1])
+ modules = loadModulesFromFolderUsingPattern(a_splitted[0], a_splitted[1])
else:
- debug("/ from module " + a[0])
- modules = [loadSource(a[0])]
+ if a[0].endswith("/"):
+ debug("/ from folder " + a[0])
+ modules = loadModulesFromFolderRec(a[0])
+ else:
+ debug("/ from module " + a[0])
+ modules = [loadSource(a[0])]
for module in modules:
all.addTests(testLoader.loadTestsFromModule(module)._tests)
diff --git a/python/helpers/pydev/pydevd_comm.py b/python/helpers/pydev/pydevd_comm.py
index 34e1b219b96d..31b448993cff 100644
--- a/python/helpers/pydev/pydevd_comm.py
+++ b/python/helpers/pydev/pydevd_comm.py
@@ -48,11 +48,11 @@ each command has a format:
120 CMD_GET_COMPLETIONS JAVA
500 series diagnostics/ok
- 901 VERSION either Version string (1.0) Currently just used at startup
- 902 RETURN either Depends on caller -
+ 501 VERSION either Version string (1.0) Currently just used at startup
+ 502 RETURN either Depends on caller -
900 series: errors
- 501 ERROR either - This is reserved for unexpected errors.
+ 901 ERROR either - This is reserved for unexpected errors.
* JAVA - remote debugger, the java end
* PYDB - pydevd, the python end
@@ -755,7 +755,7 @@ class InternalGetCompletions(InternalThreadCommand):
except:
exc = GetExceptionTracebackStr()
sys.stderr.write('%s\n' % (exc,))
- cmd = dbg.cmdFactory.makeErrorMessage(self.sequence, "Error evaluating expression " + exc)
+ cmd = dbg.cmdFactory.makeErrorMessage(self.sequence, "Error getting completion " + exc)
dbg.writer.addCommand(cmd)
diff --git a/python/helpers/pydev/pydevd_vars.py b/python/helpers/pydev/pydevd_vars.py
index e4bef21924e2..164cf1613a8b 100644
--- a/python/helpers/pydev/pydevd_vars.py
+++ b/python/helpers/pydev/pydevd_vars.py
@@ -325,6 +325,11 @@ def resolveCompoundVariable(thread_id, frame_id, scope, attrs):
del attrList[0] # globals are special, and they get a single dummy unused attribute
else:
var = frame.f_locals
+ type, _typeName, resolver = getType(var)
+ try:
+ resolver.resolve(var, attrList[0])
+ except:
+ var = frame.f_globals
for k in attrList:
type, _typeName, resolver = getType(var)
@@ -423,7 +428,7 @@ def changeAttrExpression(thread_id, frame_id, attr, expression):
#default way (only works for changing it in the topmost frame)
result = eval(expression, frame.f_globals, frame.f_locals)
exec('%s=%s' % (attr, expression), frame.f_globals, frame.f_locals)
- return result;
+ return result
except Exception:
diff --git a/python/pluginSrc/META-INF/plugin.xml b/python/pluginSrc/META-INF/plugin.xml
index c69ad04b367c..b88d07d36e14 100644
--- a/python/pluginSrc/META-INF/plugin.xml
+++ b/python/pluginSrc/META-INF/plugin.xml
@@ -4,10 +4,11 @@
Pythonid
Python
-
+
Smart editing for Python scripts
- 2.6.2
+ 2.6.3
com.intellij.modules.ultimate
+ com.intellij.modules.java
org.jetbrains.plugins.yaml
JetBrains, Keith Lea
@@ -22,6 +23,8 @@
+
@@ -42,4 +45,6 @@
+
+
diff --git a/python/pluginSrc/com/jetbrains/python/module/PythonSdkChooserPanel.java b/python/pluginSrc/com/jetbrains/python/module/PythonSdkChooserPanel.java
index 579492811e38..c97115b6a8b1 100644
--- a/python/pluginSrc/com/jetbrains/python/module/PythonSdkChooserPanel.java
+++ b/python/pluginSrc/com/jetbrains/python/module/PythonSdkChooserPanel.java
@@ -57,7 +57,7 @@ public class PythonSdkChooserPanel extends JComponent {
myJdkChooser.setAllowedJdkTypes(new SdkType[]{PythonSdkType.getInstance()});
- final Sdk selectedJdk = project == null ? null : ProjectRootManager.getInstance(project).getProjectJdk();
+ final Sdk selectedJdk = project == null ? null : ProjectRootManager.getInstance(project).getProjectSdk();
myJdkChooser.updateList(selectedJdk, null);
}
diff --git a/python/python-ide.iml b/python/python-ide.iml
index 7216109fe347..40af0d8cc13f 100644
--- a/python/python-ide.iml
+++ b/python/python-ide.iml
@@ -17,6 +17,7 @@
+
diff --git a/python/src/META-INF/python-plugin-common.xml b/python/src/META-INF/python-plugin-common.xml
index 93f9a92322eb..b37d64a92fe9 100644
--- a/python/src/META-INF/python-plugin-common.xml
+++ b/python/src/META-INF/python-plugin-common.xml
@@ -41,7 +41,7 @@
serviceImplementation="com.jetbrains.python.psi.impl.PyElementGeneratorImpl"/>
-
+
@@ -150,6 +150,8 @@
+
@@ -274,6 +276,8 @@
+
+
@@ -363,6 +367,7 @@
id="Devmode.DumpPsi"
class="com.jetbrains.python.devmode.DumpPsiToClipboardAction"
text="Dump PSI to clipboard"
+ internal="true"
>
diff --git a/python/src/com/jetbrains/python/PyBundle.properties b/python/src/com/jetbrains/python/PyBundle.properties
index 0d28e940bd9d..55fa59a81113 100644
--- a/python/src/com/jetbrains/python/PyBundle.properties
+++ b/python/src/com/jetbrains/python/PyBundle.properties
@@ -437,6 +437,7 @@ runcfg.captions.script_parameters_dialog=Enter script parameters
runcfg.captions.interpreter_options_dialog=Enter interpreter options
sdk.error.invalid.interpreter.name.$0=Invalid Python interpeter name '{0}'!
sdk.select.path=Select Python Interpreter
+runcfg.unittest.dlg.pattern=Pattern:
# Consoles messages
python.console=Python Console
diff --git a/python/src/com/jetbrains/python/PythonModuleTypeBase.java b/python/src/com/jetbrains/python/PythonModuleTypeBase.java
index c9500db06d15..4199f4b36aa5 100644
--- a/python/src/com/jetbrains/python/PythonModuleTypeBase.java
+++ b/python/src/com/jetbrains/python/PythonModuleTypeBase.java
@@ -25,7 +25,7 @@ public abstract class PythonModuleTypeBase extends Modu
}
public String getDescription() {
- return "Provides facilities for developing Python applications";
+ return "Provides facilities for developing Python and Django applications";
}
public Icon getBigIcon() {
diff --git a/python/src/com/jetbrains/python/buildout/BuildoutConfigurable.java b/python/src/com/jetbrains/python/buildout/BuildoutConfigurable.java
index 657d6dc0d5eb..e4c6626a8321 100644
--- a/python/src/com/jetbrains/python/buildout/BuildoutConfigurable.java
+++ b/python/src/com/jetbrains/python/buildout/BuildoutConfigurable.java
@@ -80,7 +80,7 @@ public class BuildoutConfigurable implements Configurable, NonDefaultProjectConf
@Override
public Icon getIcon() {
- return BuildoutFacetType.ourIcon;
+ return BuildoutFacetType.BUILDOUT_ICON;
}
@Override
diff --git a/python/src/com/jetbrains/python/buildout/BuildoutFacetType.java b/python/src/com/jetbrains/python/buildout/BuildoutFacetType.java
index 19eafd93a224..d999e0fa539b 100644
--- a/python/src/com/jetbrains/python/buildout/BuildoutFacetType.java
+++ b/python/src/com/jetbrains/python/buildout/BuildoutFacetType.java
@@ -4,11 +4,8 @@ import com.intellij.facet.Facet;
import com.intellij.facet.FacetType;
import com.intellij.facet.FacetTypeId;
import com.intellij.facet.FacetTypeRegistry;
-import com.intellij.ide.DataManager;
-import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleType;
-import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.IconLoader;
import com.jetbrains.python.PythonModuleTypeBase;
import org.jetbrains.annotations.NotNull;
@@ -51,10 +48,10 @@ public class BuildoutFacetType extends FacetType";
+ }
return element.getName();
}
diff --git a/python/src/com/jetbrains/python/codeInsight/override/PyOverrideImplementUtil.java b/python/src/com/jetbrains/python/codeInsight/override/PyOverrideImplementUtil.java
index 130502b1d72c..213b96b78550 100644
--- a/python/src/com/jetbrains/python/codeInsight/override/PyOverrideImplementUtil.java
+++ b/python/src/com/jetbrains/python/codeInsight/override/PyOverrideImplementUtil.java
@@ -169,24 +169,29 @@ public class PyOverrideImplementUtil {
}, ArrayUtil.EMPTY_STRING_ARRAY);
int startIndex = 0;
- if (baseFunction.getReturnType() != PyNoneType.INSTANCE) {
- statementBody.append("return ");
- }
- if (baseClass.isNewStyleClass()) {
- statementBody.append(PyNames.SUPER);
- statementBody.append("(");
- final LanguageLevel langLevel = ((PyFile)pyClass.getContainingFile()).getLanguageLevel();
- if (!langLevel.isPy3K()) {
- statementBody.append(pyClass.getName()).append(", ").append(PyUtil.getFirstParameterName(baseFunction));
- }
- statementBody.append(").").append(baseFunction.getName()).append("(");
- startIndex = 1;
+ if (PyNames.FAKE_OLD_BASE.equals(baseFunction.getContainingClass().getName())) {
+ statementBody.append("pass");
}
else {
- statementBody.append(baseClass.getName()).append(".").append(baseFunction.getName()).append("(");
+ if (baseFunction.getReturnType() != PyNoneType.INSTANCE) {
+ statementBody.append("return ");
+ }
+ if (baseClass.isNewStyleClass()) {
+ statementBody.append(PyNames.SUPER);
+ statementBody.append("(");
+ final LanguageLevel langLevel = ((PyFile)pyClass.getContainingFile()).getLanguageLevel();
+ if (!langLevel.isPy3K()) {
+ statementBody.append(pyClass.getName()).append(", ").append(PyUtil.getFirstParameterName(baseFunction));
+ }
+ statementBody.append(").").append(baseFunction.getName()).append("(");
+ startIndex = 1;
+ }
+ else {
+ statementBody.append(baseClass.getName()).append(".").append(baseFunction.getName()).append("(");
+ }
+ statementBody.append(StringUtil.join(paramTexts, startIndex, paramTexts.length, ", "));
+ statementBody.append(")");
}
- statementBody.append(StringUtil.join(paramTexts, startIndex, paramTexts.length, ", "));
- statementBody.append(")");
pyFunctionBuilder.statement(statementBody.toString());
return pyFunctionBuilder;
diff --git a/python/src/com/jetbrains/python/console/PydevCompletionAutopopupBlockingHandler.java b/python/src/com/jetbrains/python/console/PydevCompletionAutopopupBlockingHandler.java
new file mode 100644
index 000000000000..d5393f33f5b3
--- /dev/null
+++ b/python/src/com/jetbrains/python/console/PydevCompletionAutopopupBlockingHandler.java
@@ -0,0 +1,24 @@
+package com.jetbrains.python.console;
+
+import com.intellij.codeInsight.editorActions.TypedHandlerDelegate;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Key;
+import com.intellij.psi.PsiFile;
+
+/**
+ * @author oleg
+ * @date 10/26/10
+ */
+public class PydevCompletionAutopopupBlockingHandler extends TypedHandlerDelegate {
+
+ public static final Key