diff --git a/python/build/paths.nsi b/python/build/paths.nsi index c180dc416806..5720bbdfba65 100644 --- a/python/build/paths.nsi +++ b/python/build/paths.nsi @@ -1,6 +1,6 @@ ; Installer images -!define IMAGES_LOCATION ${BASE_DIR}\python\build\resources -!define LICENSE_FILE ${BASE_DIR}\python\license\PyCharm_Preview_License -!define PRODUCT_PROPERTIES_FILE ${BASE_DIR}\out\pycharm\layout\bin\idea.properties +!define IMAGES_LOCATION ${BASE_DIR}\python\community\build\resources +;!define LICENSE_FILE ${BASE_DIR}\python\license\PyCharm_Preview_License +!define PRODUCT_PROPERTIES_FILE ${BASE_DIR}\out\pycharmCE\layout\bin\idea.properties !define PRODUCT_VM_OPTIONS_NAME pycharm.exe.vmoptions -!define PRODUCT_VM_OPTIONS_FILE ${BASE_DIR}\out\pycharm\win\bin\${PRODUCT_VM_OPTIONS_NAME} \ No newline at end of file +!define PRODUCT_VM_OPTIONS_FILE ${BASE_DIR}\out\pycharmCE\win\bin\${PRODUCT_VM_OPTIONS_NAME} diff --git a/python/build/pycharm_build.gant b/python/build/pycharm_build.gant index 1a2103d42f1a..4d8b0bda56cd 100644 --- a/python/build/pycharm_build.gant +++ b/python/build/pycharm_build.gant @@ -33,6 +33,7 @@ private List pycharmImplementationModules() { //modules to put into pycharm.ja class Paths { final sandbox + final sandboxCE final distAll final distWin final distMac @@ -43,6 +44,7 @@ class Paths { def Paths(String home) { sandbox = "$home/out/pycharm" + sandboxCE = "$home/out/pycharmCE" distAll = "$sandbox/layout" distWin = "$sandbox/win" @@ -165,13 +167,17 @@ private communityEdition(Set usedJars) { s.setBinding(binding) s.layoutCommunity("${paths.sandbox}/classes/production", usedJars) + signExe("${paths.sandboxCE}/win/bin/pycharm.exe") + buildNSIS(["${paths.sandboxCE}/layout", "${paths.sandboxCE}/win"], + "$pythonCommunityHome/build/strings.nsi", "$pythonCommunityHome/build/paths.nsi", + "pycharm", false, true, system_selector) // todo: get rid of copying - //ant.copy(file: "$paths.artifacts/ideaIC-${buildNumber}.mac.zip", tofile: "$paths.artifacts/ideaIC-${buildNumber}.sit") - //def extraArgs = ["build.number": "IC-$buildNumber"] - //signMacZip("idea", extraArgs) - //notifyArtifactBuilt("$paths.artifacts/ideaIC-${buildNumber}.sit") - //buildDmg("idea", getDmgImage(true), extraArgs) + //ant.copy(file: "${paths.sandboxCE}/artifacts/ideaIC-${buildNumber}.mac.zip", tofile: "$paths.artifacts/ideaIC-${buildNumber}.sit") + def extraArgs = ["build.number": "PC-$buildNumber"] + signMacZip("pycharm", extraArgs) + notifyArtifactBuilt("$paths.artifacts/ideaIC-${buildNumber}.sit") + buildDmg("pycharm", "${home}/python/build/DMG_background.png", extraArgs) //ant.delete(file: "$paths.artifacts/ideaIC-${buildNumber}.sit") } diff --git a/python/build/pycharm_community_build.gant b/python/build/pycharm_community_build.gant index e99cb84df771..763e3a2c31de 100644 --- a/python/build/pycharm_community_build.gant +++ b/python/build/pycharm_community_build.gant @@ -50,7 +50,7 @@ class Paths { distWin = "$sandbox/win" distMac = "$sandbox/mac" distUnix = "$sandbox/unix" - artifacts = "$home/out/pycharmCE/artifacts" + artifacts = "$sandbox/artifacts" ideaSystem = "$sandbox/system" ideaConfig = "$sandbox/config" @@ -380,7 +380,7 @@ private layoutMac(Map _args, String target) { } Map args = new HashMap(_args) - args.icns = "$home/python/resources/PyCharm.icns" + args.icns = "$pythonCommunityHome/resources/PyCharmCore.icns" args.bundleIdentifier = "com.jetbrains.pycharm" args.platform_prefix = "Python" args.help_id = "PY" diff --git a/python/build/resources/PC_instCom.ico b/python/build/resources/PC_instCom.ico new file mode 100644 index 000000000000..44ecec9c8755 Binary files /dev/null and b/python/build/resources/PC_instCom.ico differ diff --git a/python/build/resources/PC_uninstCom.ico b/python/build/resources/PC_uninstCom.ico new file mode 100644 index 000000000000..13e9f96f9987 Binary files /dev/null and b/python/build/resources/PC_uninstCom.ico differ diff --git a/python/build/strings.nsi b/python/build/strings.nsi index 9e533d35d720..1f7399ce9e93 100644 --- a/python/build/strings.nsi +++ b/python/build/strings.nsi @@ -1,9 +1,9 @@ !define MANUFACTURER "JetBrains" -!define MUI_PRODUCT "PyCharm" -!define PRODUCT_FULL_NAME "JetBrains PyCharm" +!define MUI_PRODUCT "PyCharm Community Edition" +!define PRODUCT_FULL_NAME "JetBrains PyCharm Community Edition" !define PRODUCT_EXE_FILE "pycharm.exe" -!define PRODUCT_ICON_FILE "pycharm_inst.ico" -!define PRODUCT_UNINST_ICON_FILE "pycharm_uninst.ico" +!define PRODUCT_ICON_FILE "PC_instCom.ico" +!define PRODUCT_UNINST_ICON_FILE "PC_uninstCom.ico" !define PRODUCT_LOGO_FILE "logo.bmp" !define PRODUCT_HEADER_FILE "headerlogo.bmp" diff --git a/python/resources/PyCharmCore.icns b/python/resources/PyCharmCore.icns new file mode 100644 index 000000000000..65167d934ab6 Binary files /dev/null and b/python/resources/PyCharmCore.icns differ diff --git a/python/resources/PyCharmCore.ico b/python/resources/PyCharmCore.ico index 157c83e9d39a..095e0e14293f 100644 Binary files a/python/resources/PyCharmCore.ico and b/python/resources/PyCharmCore.ico differ diff --git a/python/resources/PyCharmCore128.png b/python/resources/PyCharmCore128.png new file mode 100644 index 000000000000..6f23e62d385d Binary files /dev/null and b/python/resources/PyCharmCore128.png differ diff --git a/python/resources/PyCharmCore16.png b/python/resources/PyCharmCore16.png new file mode 100644 index 000000000000..3328fdb44c8b Binary files /dev/null and b/python/resources/PyCharmCore16.png differ diff --git a/python/resources/PyCharmCore32.png b/python/resources/PyCharmCore32.png new file mode 100644 index 000000000000..0d06345e5189 Binary files /dev/null and b/python/resources/PyCharmCore32.png differ diff --git a/python/resources/idea/PyCharmCoreApplicationInfo.xml b/python/resources/idea/PyCharmCoreApplicationInfo.xml index 7ecb2013f08e..3897bdeeeac1 100644 --- a/python/resources/idea/PyCharmCoreApplicationInfo.xml +++ b/python/resources/idea/PyCharmCoreApplicationInfo.xml @@ -4,7 +4,7 @@ - + diff --git a/python/src/com/jetbrains/python/debugger/PyDebugProcess.java b/python/src/com/jetbrains/python/debugger/PyDebugProcess.java index f1ef38a2a38c..6c197885bac5 100644 --- a/python/src/com/jetbrains/python/debugger/PyDebugProcess.java +++ b/python/src/com/jetbrains/python/debugger/PyDebugProcess.java @@ -544,22 +544,16 @@ public class PyDebugProcess extends XDebugProcess implements IPyDebugProcess, Pr } public void addExceptionBreakpoint(XBreakpoint breakpoint) { - ExceptionBreakpointProperties properties = breakpoint.getProperties(); - if (properties == null) return; - - myRegisteredExceptionBreakpoints.put(properties.getException(), breakpoint); + myRegisteredExceptionBreakpoints.put(breakpoint.getProperties().getException(), breakpoint); if (isConnected()) { - myDebugger.addExceptionBreakpoint(properties); + myDebugger.addExceptionBreakpoint(breakpoint.getProperties()); } } public void removeExceptionBreakpoint(XBreakpoint breakpoint) { - ExceptionBreakpointProperties properties = breakpoint.getProperties(); - if (properties == null) return; - - myRegisteredExceptionBreakpoints.remove(properties.getException()); + myRegisteredExceptionBreakpoints.remove(breakpoint.getProperties().getException()); if (isConnected()) { - myDebugger.removeExceptionBreakpoint(properties); + myDebugger.removeExceptionBreakpoint(breakpoint.getProperties()); } } diff --git a/python/src/com/jetbrains/python/debugger/PyExceptionBreakpointType.java b/python/src/com/jetbrains/python/debugger/PyExceptionBreakpointType.java index d30aad7eac9c..c19e1d2f8273 100644 --- a/python/src/com/jetbrains/python/debugger/PyExceptionBreakpointType.java +++ b/python/src/com/jetbrains/python/debugger/PyExceptionBreakpointType.java @@ -225,24 +225,18 @@ public class PyExceptionBreakpointType @Override public void saveTo(@NotNull XBreakpoint breakpoint) { - PyExceptionBreakpointProperties properties = breakpoint.getProperties(); - if (properties == null) return; - - properties.setNotifyOnTerminate(myNotifyOnTerminateCheckBox.isSelected()); + breakpoint.getProperties().setNotifyOnTerminate(myNotifyOnTerminateCheckBox.isSelected()); - properties.setNotifyAlways(myNotifyOnRaiseCheckBox.isSelected() && myAlwaysRadio.isSelected()); - properties.setNotifyOnlyOnFirst(myNotifyOnRaiseCheckBox.isSelected() && myOnlyOnFirstRadio.isSelected()); + breakpoint.getProperties().setNotifyAlways(myNotifyOnRaiseCheckBox.isSelected() && myAlwaysRadio.isSelected()); + breakpoint.getProperties().setNotifyOnlyOnFirst(myNotifyOnRaiseCheckBox.isSelected() && myOnlyOnFirstRadio.isSelected()); } @Override public void loadFrom(@NotNull XBreakpoint breakpoint) { - PyExceptionBreakpointProperties properties = breakpoint.getProperties(); - if (properties == null) return; - - myNotifyOnTerminateCheckBox.setSelected(properties.isNotifyOnTerminate()); + myNotifyOnTerminateCheckBox.setSelected(breakpoint.getProperties().isNotifyOnTerminate()); - boolean always = properties.isNotifyAlways(); - boolean onFirst = properties.isNotifyOnlyOnFirst(); + boolean always = breakpoint.getProperties().isNotifyAlways(); + boolean onFirst = breakpoint.getProperties().isNotifyOnlyOnFirst(); setNotifyOnRaiseSelected(always || onFirst); diff --git a/python/src/com/jetbrains/python/inspections/PyUnresolvedReferencesInspection.java b/python/src/com/jetbrains/python/inspections/PyUnresolvedReferencesInspection.java index a3c9ba7d5127..94613ee403cb 100644 --- a/python/src/com/jetbrains/python/inspections/PyUnresolvedReferencesInspection.java +++ b/python/src/com/jetbrains/python/inspections/PyUnresolvedReferencesInspection.java @@ -396,8 +396,11 @@ public class PyUnresolvedReferencesInspection extends PyInspection { } final PsiElement element = reference.getElement(); final List actions = new ArrayList(2); - if (ref_text.length() <= 0) return; // empty text, nothing to highlight final String refname = (element instanceof PyQualifiedExpression) ? ((PyQualifiedExpression)element).getReferencedName() : ref_text; + // Empty text, nothing to highlight + if (refname == null || refname.length() <= 0) { + return; + } final PyQualifiedName canonicalQName = getCanonicalName(reference, myTypeEvalContext); final String canonicalName = canonicalQName != null ? canonicalQName.toString() : null; diff --git a/python/testData/inspections/PyUnresolvedReferencesInspection/NullReferenceInIncompleteImport/a.py b/python/testData/inspections/PyUnresolvedReferencesInspection/NullReferenceInIncompleteImport/a.py new file mode 100644 index 000000000000..4a8eaf6cc3b6 --- /dev/null +++ b/python/testData/inspections/PyUnresolvedReferencesInspection/NullReferenceInIncompleteImport/a.py @@ -0,0 +1 @@ +import foo. diff --git a/python/testData/inspections/PyUnresolvedReferencesInspection/NullReferenceInIncompleteImport/foo/__init__.py b/python/testData/inspections/PyUnresolvedReferencesInspection/NullReferenceInIncompleteImport/foo/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/python/testSrc/com/jetbrains/python/inspections/PyUnresolvedReferencesInspectionTest.java b/python/testSrc/com/jetbrains/python/inspections/PyUnresolvedReferencesInspectionTest.java index 3b9c39c548d9..363d4c0c7242 100644 --- a/python/testSrc/com/jetbrains/python/inspections/PyUnresolvedReferencesInspectionTest.java +++ b/python/testSrc/com/jetbrains/python/inspections/PyUnresolvedReferencesInspectionTest.java @@ -294,6 +294,10 @@ public class PyUnresolvedReferencesInspectionTest extends PyTestCase { doTest(); } + public void testNullReferenceInIncompleteImport() { + doMultiFileTest("a.py"); + } + private void doTest() { myFixture.configureByFile(TEST_DIRECTORY + getTestName(true) + ".py"); myFixture.enableInspections(PyUnresolvedReferencesInspection.class);