Skip to content

Commit 3d36f5f

Browse files
committed
Remove Pytest Test results windows draft
Package installer improvment Fix incorrec venv console mode
1 parent 627f674 commit 3d36f5f

File tree

4 files changed

+34
-17
lines changed

4 files changed

+34
-17
lines changed

src/main/java/org/netbeans/modules/python/actions/PythonVEnvConsoleAction.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import org.openide.util.LookupListener;
2020
import org.openide.util.NbBundle;
2121
import org.openide.util.Utilities;
22+
import org.openide.windows.Mode;
23+
import org.openide.windows.WindowManager;
2224

2325
/**
2426
*
@@ -92,6 +94,12 @@ public void actionPerformed(ActionEvent ev) {
9294
PythonProject get = lkpInfo.allInstances().stream().findFirst().get();
9395
PythonVEnvConsoleActionTopComponent pythonVEnvConsoleActionTopComponent
9496
= new PythonVEnvConsoleActionTopComponent(get, "venv");
97+
for (Mode mode : WindowManager.getDefault().getModes()) {
98+
if (mode.getName().equals("output") && mode.canDock(pythonVEnvConsoleActionTopComponent)) {
99+
mode.dockInto(pythonVEnvConsoleActionTopComponent);
100+
break;
101+
}
102+
}
95103
pythonVEnvConsoleActionTopComponent.open();
96104
pythonVEnvConsoleActionTopComponent.requestActive();
97105
}

src/main/java/org/netbeans/modules/python/options/PythonLspServerConfigsPanel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ final class PythonLspServerConfigsPanel extends javax.swing.JPanel {
4242

4343
public static String[] PACKAGES = {
4444
"pylsp",
45-
"pyls-isort",
45+
"python-lsp-isort",
4646
"pylsp-mypy",
4747
"pylsp-rope",
4848
"black",

src/main/java/org/netbeans/modules/python/packagemanager/PythonPackageManagerTopComponent.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,21 @@ private void installButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN
243243
switch (text) {
244244
case "Install":
245245
RP.post(() -> {
246-
PythonUtility.processExecutor(new String[]{pyPath, "-m", "pip",
247-
"install", name + "==" + versionsComboBox.getSelectedItem()
248-
.toString()}, "Installing Package " + name);
246+
PythonUtility.processExecutor(
247+
new String[]{
248+
pyPath,
249+
"-m",
250+
"pip",
251+
"install",
252+
String.format(
253+
"%s%s",
254+
name,
255+
versionsComboBox.getSelectedItem() != null
256+
? "==" + versionsComboBox.getSelectedItem().toString()
257+
: "")
258+
},
259+
"Installing Package " + name
260+
);
249261
PythonPackagesModel.loadInstalled(pyPath);
250262
});
251263
break;

src/main/java/org/netbeans/modules/python/testrunner/PythonTestResultsTopComponent.java

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@
1717
import org.netbeans.api.editor.EditorRegistry;
1818
import org.netbeans.api.project.FileOwnerQuery;
1919
import org.netbeans.api.project.Project;
20-
import org.netbeans.api.settings.ConvertAsProperties;
2120
import org.netbeans.modules.editor.NbEditorUtilities;
22-
import org.openide.awt.ActionID;
23-
import org.openide.awt.ActionReference;
2421
import org.openide.filesystems.FileObject;
2522
import org.openide.filesystems.FileUtil;
2623
import org.openide.util.Exceptions;
@@ -31,16 +28,16 @@
3128
/**
3229
* Top component which displays something.
3330
*/
34-
@ConvertAsProperties(dtd = "-//org.netbeans.modules.python.testrunner//PythonTestResults//EN", autostore = false)
35-
@TopComponent.Description(preferredID = "PythonTestResultsTopComponent", iconBase = "org/netbeans/modules/python/pytest.png", persistenceType = TopComponent.PERSISTENCE_ALWAYS)
36-
@TopComponent.Registration(mode = "output", openAtStartup = false)
37-
@ActionID(category = "Window", id = "org.netbeans.modules.python.testrunner.PythonTestResultsTopComponent")
38-
@ActionReference(path = "Menu/Window/Tools", position = 255)
39-
@TopComponent.OpenActionRegistration(displayName = "#CTL_PythonTestResultsAction", preferredID = "PythonTestResultsTopComponent")
31+
//@ConvertAsProperties(dtd = "-//org.netbeans.modules.python.testrunner//PythonTestResults//EN", autostore = false)
32+
//@TopComponent.Description(preferredID = "PythonTestResultsTopComponent", iconBase = "org/netbeans/modules/python/pytest.png", persistenceType = TopComponent.PERSISTENCE_ALWAYS)
33+
//@TopComponent.Registration(mode = "output", openAtStartup = false)
34+
//@ActionID(category = "Window", id = "org.netbeans.modules.python.testrunner.PythonTestResultsTopComponent")
35+
//@ActionReference(path = "Menu/Window/Tools", position = 255)
36+
//@TopComponent.OpenActionRegistration(displayName = "#CTL_PythonTestResultsAction", preferredID = "PythonTestResultsTopComponent")
4037
@Messages({
41-
"CTL_PythonTestResultsAction=PyTest Results",
42-
"CTL_PythonTestResultsTopComponent=PyTest Results Window",
43-
"HINT_PythonTestResultsTopComponent=This is a PyTest Results window"
38+
"CTL_PythonTestResultsAction=PyTest Results",
39+
"CTL_PythonTestResultsTopComponent=PyTest Results Window",
40+
"HINT_PythonTestResultsTopComponent=This is a PyTest Results window"
4441
})
4542
public final class PythonTestResultsTopComponent extends TopComponent {
4643

@@ -91,7 +88,7 @@ public void componentOpened() {
9188
.getProjectDirectory()).toPath())
9289
.map(Path::toFile)
9390
.filter(file -> file.getName()
94-
.equals("report.html"))
91+
.equals("report.html"))
9592
.collect(Collectors.toList());
9693
collect.sort(LastModifiedFileComparator.LASTMODIFIED_REVERSE);
9794
if (!collect.isEmpty()) {

0 commit comments

Comments
 (0)