Handle empty starting script on Java side because of Remote Python Console (PY-25468)

This commit is contained in:
Elizaveta Shashkova
2017-08-11 15:17:23 +03:00
parent 3da056f18d
commit a051f74964
5 changed files with 12 additions and 4 deletions
@@ -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):
-2
View File
@@ -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);