mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Handle empty starting script on Java side because of Remote Python Console (PY-25468)
This commit is contained in:
@@ -356,6 +356,9 @@ class BaseInterpreterInterface:
|
||||
return False
|
||||
|
||||
def execLine(self, line):
|
||||
if not self.banner_shown:
|
||||
line = self.build_banner() + line
|
||||
self.banner_shown = True
|
||||
return self.do_exec_code(line, True)
|
||||
|
||||
def execMultipleLines(self, lines):
|
||||
|
||||
@@ -325,8 +325,6 @@ def start_console_server(host, port, interpreter):
|
||||
print(port)
|
||||
print(interpreter.client_port)
|
||||
|
||||
interpreter.execMultipleLines("")
|
||||
|
||||
while True:
|
||||
try:
|
||||
server.serve_forever()
|
||||
|
||||
@@ -699,6 +699,10 @@ public class PydevConsoleRunnerImpl implements PydevConsoleRunner {
|
||||
enableConsoleExecuteAction();
|
||||
}
|
||||
|
||||
if (statements2execute.length == 1 && statements2execute[0].isEmpty()) {
|
||||
statements2execute[0] = "\t";
|
||||
}
|
||||
|
||||
for (String statement : statements2execute) {
|
||||
consoleView.executeStatement(statement + "\n", ProcessOutputTypes.SYSTEM);
|
||||
}
|
||||
|
||||
@@ -295,7 +295,10 @@ public class PythonConsoleView extends LanguageConsoleImpl implements Observable
|
||||
VirtualFile file = getVirtualFile();
|
||||
if (PyConsoleUtil.detectIPythonImported(text, outputType)) {
|
||||
PyConsoleUtil.markIPython(file);
|
||||
getExecuteActionHandler().updateConsoleState();
|
||||
PythonConsoleExecuteActionHandler handler = getExecuteActionHandler();
|
||||
if (handler != null) {
|
||||
handler.updateConsoleState();
|
||||
}
|
||||
}
|
||||
if (PyConsoleUtil.detectIPythonAutomagicOn(text)) {
|
||||
PyConsoleUtil.setIPythonAutomagic(file, true);
|
||||
|
||||
@@ -149,7 +149,7 @@ public class PyConsoleTask extends PyExecutionFixtureTestTask {
|
||||
new PydevConsoleRunnerImpl(project, sdk, PyConsoleType.PYTHON, myFixture.getTempDirPath(), Maps.newHashMap(),
|
||||
PyConsoleOptions.getInstance(project).getPythonConsoleSettings(),
|
||||
(s) -> {
|
||||
}) {
|
||||
}, PydevConsoleRunnerImpl.CONSOLE_START_COMMAND) {
|
||||
protected void showContentDescriptor(RunContentDescriptor contentDescriptor) {
|
||||
myContentDescriptorRef.set(contentDescriptor);
|
||||
super.showContentDescriptor(contentDescriptor);
|
||||
|
||||
Reference in New Issue
Block a user