From e3167e6a405ce4cc329d2c5b1504d4973fed8966 Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Wed, 25 Apr 2012 13:45:53 +0400 Subject: [PATCH 1/4] fixed PY-6248 django 1.4 manage.py error running shell fixed PY-2921 Django shell problem django console execute users manage.py --- python/helpers/pycharm/django_manage_shell.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/python/helpers/pycharm/django_manage_shell.py b/python/helpers/pycharm/django_manage_shell.py index 6a5b23fa2f07..0afd54a9dfcf 100644 --- a/python/helpers/pycharm/django_manage_shell.py +++ b/python/helpers/pycharm/django_manage_shell.py @@ -15,14 +15,17 @@ def run(): if not manage_file: manage_file = 'manage' - execute_manager_original = management.execute_manager - - def execute_manager(settings_mod): + def execute_manager(settings_mod, argv = None): management.setup_environ(settings_mod) management.execute_manager = execute_manager + def execute_from_command_line(argv=None): + pass + + management.execute_from_command_line = execute_from_command_line + fixGetpass() -# run_module(manage_file, None, '__main__', True) + run_module(manage_file, None, '__main__', True) From 7bb6c02560363ff25e0c5cf85ce1c2a9372915a1 Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Wed, 25 Apr 2012 17:36:18 +0400 Subject: [PATCH 2/4] fixed broken order in pythonpath (append value to the end) so fixed PY-6312 Unit Tests no longer run in PyCharm 2.x and probably(can't reproduce any) it helped with PY-3852 Since 1.5 I can not launch the django runserver via the PyCharm PY-5076 Unable to run manage.py commands from PyCharm 2.0 beta --- python/src/com/jetbrains/python/sdk/PythonEnvUtil.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/src/com/jetbrains/python/sdk/PythonEnvUtil.java b/python/src/com/jetbrains/python/sdk/PythonEnvUtil.java index 228de82bb1eb..2bc2031eeb94 100644 --- a/python/src/com/jetbrains/python/sdk/PythonEnvUtil.java +++ b/python/src/com/jetbrains/python/sdk/PythonEnvUtil.java @@ -62,7 +62,7 @@ public class PythonEnvUtil { assert source != null; Set vals = Sets.newHashSet(source.split(File.pathSeparator)); if (!vals.contains(value)) { - return value + File.pathSeparatorChar + source; + return source + File.pathSeparatorChar + value; } else { return source; From f70e2c290d014514da8308af24e41d14c9800569 Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Wed, 25 Apr 2012 17:48:31 +0400 Subject: [PATCH 3/4] fixed collect pythonpath for tests --- .../python/testing/attest/PythonAtTestCommandLineState.java | 2 +- .../python/testing/doctest/PythonDocTestCommandLineState.java | 2 +- .../python/testing/unittest/PythonUnitTestCommandLineState.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/src/com/jetbrains/python/testing/attest/PythonAtTestCommandLineState.java b/python/src/com/jetbrains/python/testing/attest/PythonAtTestCommandLineState.java index 3ea1c08498e9..58a12a6a587a 100644 --- a/python/src/com/jetbrains/python/testing/attest/PythonAtTestCommandLineState.java +++ b/python/src/com/jetbrains/python/testing/attest/PythonAtTestCommandLineState.java @@ -38,7 +38,7 @@ public class PythonAtTestCommandLineState extends PythonTestCommandLineStateBase pythonPath.add(1, myConfig.getFolderName()); } else { - pythonPath.add(1, new File(myConfig.getWorkingDirectory(), myConfig.getScriptName()).getParent()); + pythonPath.add(1, new File(myConfig.getScriptName()).getParent()); } return pythonPath; } diff --git a/python/src/com/jetbrains/python/testing/doctest/PythonDocTestCommandLineState.java b/python/src/com/jetbrains/python/testing/doctest/PythonDocTestCommandLineState.java index f01d09908097..eecdd8ee4dc4 100644 --- a/python/src/com/jetbrains/python/testing/doctest/PythonDocTestCommandLineState.java +++ b/python/src/com/jetbrains/python/testing/doctest/PythonDocTestCommandLineState.java @@ -38,7 +38,7 @@ public class PythonDocTestCommandLineState extends PythonTestCommandLineStateBas pythonPath.add(1, myConfig.getFolderName()); } else { - pythonPath.add(1, new File(myConfig.getWorkingDirectory(), myConfig.getScriptName()).getParent()); + pythonPath.add(1, new File(myConfig.getScriptName()).getParent()); } return pythonPath; } diff --git a/python/src/com/jetbrains/python/testing/unittest/PythonUnitTestCommandLineState.java b/python/src/com/jetbrains/python/testing/unittest/PythonUnitTestCommandLineState.java index 6d859b450e55..372b2950cc13 100644 --- a/python/src/com/jetbrains/python/testing/unittest/PythonUnitTestCommandLineState.java +++ b/python/src/com/jetbrains/python/testing/unittest/PythonUnitTestCommandLineState.java @@ -42,7 +42,7 @@ public class PythonUnitTestCommandLineState extends pythonPath.add(1, myConfig.getFolderName()); } else { - pythonPath.add(1, new File(myConfig.getWorkingDirectory(), myConfig.getScriptName()).getParent()); + pythonPath.add(1, new File(myConfig.getScriptName()).getParent()); } return pythonPath; } From 22e3067b0fe64844998eefcd89985f2f4a5280f5 Mon Sep 17 00:00:00 2001 From: Ekaterina Tuzova Date: Wed, 25 Apr 2012 20:50:09 +0400 Subject: [PATCH 4/4] fixed regression caused by PY-6366 fix (unable to install distribute/pip) --- .../src/com/jetbrains/python/packaging/PyPackageManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/src/com/jetbrains/python/packaging/PyPackageManager.java b/python/src/com/jetbrains/python/packaging/PyPackageManager.java index 02acf4c574c8..38cd937e6139 100644 --- a/python/src/com/jetbrains/python/packaging/PyPackageManager.java +++ b/python/src/com/jetbrains/python/packaging/PyPackageManager.java @@ -257,7 +257,7 @@ public class PyPackageManager { private void installManagement(String name) throws PyExternalProcessException { final File helperFile = PythonHelpersLocator.getHelperFile(name + ".tar.gz"); - String helpersPath = getHelperPath(name); + final String helpersPath = getHelperPath(name); ProcessOutput output = getHelperOutput(PACKAGING_TOOL, Lists.newArrayList(UNTAR, helpersPath), false, helperFile.getParent()); @@ -271,7 +271,7 @@ public class PyPackageManager { } final String fileName = dirName + name + File.separatorChar + "setup.py"; try { - output = getProcessOutput(fileName, Collections.singletonList(INSTALL), true, dirName); + output = getProcessOutput(fileName, Collections.singletonList(INSTALL), true, dirName + name); final int retcode = output.getExitCode(); if (output.isTimeout()) { throw new PyExternalProcessException(ERROR_TIMEOUT, fileName, Lists.newArrayList(INSTALL), "Timed out");