diff --git a/python/helpers/pydev/pydev_console/console.thrift b/python/helpers/pydev/pydev_console/console.thrift index 4b80e11e5ed7..d8ef277c317f 100644 --- a/python/helpers/pydev/pydev_console/console.thrift +++ b/python/helpers/pydev/pydev_console/console.thrift @@ -106,7 +106,7 @@ typedef string AttributeDescription typedef list DebugValues -service PythonConsole { +service PythonConsoleBackendService { /** * Returns `true` if Python console script needs more code to evaluate it. * Returns `false` if the code is scheduled for evaluation. @@ -160,12 +160,12 @@ service PythonConsole { GetArrayResponse getArray(1: string vars, 2: i32 rowOffset, 3: i32 colOffset, 4: i32 rows, 5: i32 cols, 6: string format), /** - * The result is returned asyncronously with `IDE.returnFullValue`. + * The result is returned asyncronously with `PythonConsoleFrontendService.returnFullValue`. */ void loadFullValue(1: LoadFullValueRequestSeq seq, 2: list variables), } -service IDE { +service PythonConsoleFrontendService { void notifyFinished(1: bool needsMoreInput), string requestInput(1: string path), @@ -175,7 +175,7 @@ service IDE { void showConsole(), /** - * Returns the result for `PythonConsole.loadFullValue`. + * Returns the result for `PythonConsoleBackendService.loadFullValue`. */ void returnFullValue(1: LoadFullValueRequestSeq requestSeq, 2: list response), diff --git a/python/helpers/pydev/pydevconsole.py b/python/helpers/pydev/pydevconsole.py index a501afbaa07e..603f79ba74d6 100644 --- a/python/helpers/pydev/pydevconsole.py +++ b/python/helpers/pydev/pydevconsole.py @@ -282,8 +282,8 @@ def start_server(port): enable_thrift_logging() - server_service = console_thrift.PythonConsole - client_service = console_thrift.IDE + server_service = console_thrift.PythonConsoleBackendService + client_service = console_thrift.PythonConsoleFrontendService # 1. Start Python console server @@ -315,7 +315,7 @@ def start_client(host, port): enable_thrift_logging() - client_service = console_thrift.IDE + client_service = console_thrift.PythonConsoleFrontendService client, server_transport = make_rpc_client(client_service, host, port) @@ -328,7 +328,7 @@ def start_client(host, port): # # Tell UMD the proper default namespace # _set_globals_function(interpreter.get_namespace) - server_service = console_thrift.PythonConsole + server_service = console_thrift.PythonConsoleBackendService # `InterpreterInterface` implements all methods required for the handler server_handler = interpreter diff --git a/python/python-console/gen/com/jetbrains/python/console/PythonConsole.java b/python/python-console/gen/com/jetbrains/python/console/PythonConsoleBackendService.java similarity index 99% rename from python/python-console/gen/com/jetbrains/python/console/PythonConsole.java rename to python/python-console/gen/com/jetbrains/python/console/PythonConsoleBackendService.java index bc4e7bc3d369..f1c13d0d103b 100644 --- a/python/python-console/gen/com/jetbrains/python/console/PythonConsole.java +++ b/python/python-console/gen/com/jetbrains/python/console/PythonConsoleBackendService.java @@ -7,8 +7,8 @@ package com.jetbrains.python.console; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-07-02") -public class PythonConsole { +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-07-09") +public class PythonConsoleBackendService { public interface Iface { @@ -77,7 +77,7 @@ public class PythonConsole { public GetArrayResponse getArray(java.lang.String vars, int rowOffset, int colOffset, int rows, int cols, java.lang.String format) throws org.apache.thrift.TException; /** - * The result is returned asyncronously with `IDE.returnFullValue`. + * The result is returned asyncronously with `PythonConsoleFrontendService.returnFullValue`. * * @param seq * @param variables diff --git a/python/python-console/gen/com/jetbrains/python/console/IDE.java b/python/python-console/gen/com/jetbrains/python/console/PythonConsoleFrontendService.java similarity index 99% rename from python/python-console/gen/com/jetbrains/python/console/IDE.java rename to python/python-console/gen/com/jetbrains/python/console/PythonConsoleFrontendService.java index f1f01ba1cd6c..9e50efcf6b83 100644 --- a/python/python-console/gen/com/jetbrains/python/console/IDE.java +++ b/python/python-console/gen/com/jetbrains/python/console/PythonConsoleFrontendService.java @@ -7,8 +7,8 @@ package com.jetbrains.python.console; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-05-18") -public class IDE { +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-07-09") +public class PythonConsoleFrontendService { public interface Iface { @@ -21,7 +21,7 @@ public class IDE { public void showConsole() throws org.apache.thrift.TException; /** - * Returns the result for `PythonConsole.loadFullValue`. + * Returns the result for `PythonConsoleBackendService.loadFullValue`. * * @param requestSeq * @param response diff --git a/python/src/com/jetbrains/python/console/PydevConsoleCommunication.java b/python/src/com/jetbrains/python/console/PydevConsoleCommunication.java index 78a7373460f5..91e3c52e3bd1 100644 --- a/python/src/com/jetbrains/python/console/PydevConsoleCommunication.java +++ b/python/src/com/jetbrains/python/console/PydevConsoleCommunication.java @@ -59,7 +59,7 @@ public class PydevConsoleCommunication extends AbstractConsoleCommunication impl /** * Thrift RPC client for sending messages to the server. */ - private PythonConsole.Iface myClient; + private PythonConsoleBackendService.Iface myClient; /** * This is the server responsible for giving input to a raw_input() requested. @@ -107,8 +107,9 @@ public class PydevConsoleCommunication extends AbstractConsoleCommunication impl } public void startServer(int port) throws InterruptedException { - IDEHandler serverHandler = new IDEHandler(); - IDE.Processor serverProcessor = new IDE.Processor<>(serverHandler); + PythonConsoleFrontendHandler serverHandler = new PythonConsoleFrontendHandler(); + PythonConsoleFrontendService.Processor serverProcessor = + new PythonConsoleFrontendService.Processor<>(serverHandler); //noinspection IOResourceOpenedButNotSafelyClosed TNettyServerTransport serverTransport = new TNettyServerTransport(port); TThreadPoolServer server = new TThreadPoolServer( @@ -120,7 +121,7 @@ public class PydevConsoleCommunication extends AbstractConsoleCommunication impl ApplicationManager.getApplication().executeOnPooledThread(() -> { TTransport clientTransport = serverTransport.getReverseTransport(); TBinaryProtocol clientProtocol = new TBinaryProtocol(clientTransport); - PythonConsole.Client client = new PythonConsole.Client(clientProtocol); + PythonConsoleBackendService.Client client = new PythonConsoleBackendService.Client(clientProtocol); this.myServer = server; this.myClient = PythonConsoleClientUtil.synchronizedPythonConsoleClient(PydevConsoleCommunication.class.getClassLoader(), client); @@ -144,12 +145,13 @@ public class PydevConsoleCommunication extends AbstractConsoleCommunication impl clientTransport.open(); TBinaryProtocol clientProtocol = new TBinaryProtocol(clientTransport); - PythonConsole.Client client = new PythonConsole.Client(clientProtocol); + PythonConsoleBackendService.Client client = new PythonConsoleBackendService.Client(clientProtocol); TServerTransport serverTransport = clientTransport.getServerTransport(); - IDEHandler serverHandler = new IDEHandler(); - IDE.Processor serverProcessor = new IDE.Processor<>(serverHandler); + PythonConsoleFrontendHandler serverHandler = new PythonConsoleFrontendHandler(); + PythonConsoleFrontendService.Processor serverProcessor = + new PythonConsoleFrontendService.Processor<>(serverHandler); TThreadPoolServer server = new TThreadPoolServer( new TThreadPoolServer.Args(serverTransport).processor(serverProcessor).protocolFactory(new TBinaryProtocol.Factory()) @@ -732,7 +734,7 @@ public class PydevConsoleCommunication extends AbstractConsoleCommunication impl return CompletableFuture.completedFuture(null); } - private class IDEHandler implements IDE.Iface { + private class PythonConsoleFrontendHandler implements PythonConsoleFrontendService.Iface { @Override public void notifyFinished(boolean needsMoreInput) { diff --git a/python/src/com/jetbrains/python/console/PythonConsoleClientUtil.kt b/python/src/com/jetbrains/python/console/PythonConsoleClientUtil.kt index 0c5d809e0778..8167f3f165c7 100644 --- a/python/src/com/jetbrains/python/console/PythonConsoleClientUtil.kt +++ b/python/src/com/jetbrains/python/console/PythonConsoleClientUtil.kt @@ -13,10 +13,10 @@ import java.util.concurrent.locks.ReentrantLock @JvmOverloads fun synchronizedPythonConsoleClient(loader: ClassLoader, - delegate: PythonConsole.Iface, - pythonConsoleProcess: Process? = null): PythonConsole.Iface { + delegate: PythonConsoleBackendService.Iface, + pythonConsoleProcess: Process? = null): PythonConsoleBackendService.Iface { val lock = ReentrantLock() - return Proxy.newProxyInstance(loader, arrayOf>(PythonConsole.Iface::class.java), + return Proxy.newProxyInstance(loader, arrayOf>(PythonConsoleBackendService.Iface::class.java), InvocationHandler { _, method, args -> val future = ApplicationManager.getApplication().executeOnPooledThread(Callable { lock.lock() @@ -49,5 +49,5 @@ fun synchronizedPythonConsoleClient(loader: ClassLoader, } } } - }) as PythonConsole.Iface + }) as PythonConsoleBackendService.Iface }