diff --git a/python/helpers/pydev/pydev_console/console.thrift b/python/helpers/pydev/pydev_console/console.thrift index 6a755e190886..89f479dc1420 100644 --- a/python/helpers/pydev/pydev_console/console.thrift +++ b/python/helpers/pydev/pydev_console/console.thrift @@ -141,7 +141,9 @@ service PythonConsole { */ void changeVariable(1: string evaluationExpression, 2: string value), - void connectToDebugger(i32 localPort, map opts), + void connectToDebugger(1: i32 localPort, 2: map opts, 3: map extraEnvs), + + void interrupt(), /** * Should normally return "PyCharm" string. @@ -160,7 +162,7 @@ service PythonConsole { /** * The result is returned asyncronously with `IDE.returnFullValue`. */ - LoadFullValueRequestSeq loadFullValue(1: list variables), + void loadFullValue(1: LoadFullValueRequestSeq seq, 2: list variables), } service IDE { @@ -176,4 +178,6 @@ service IDE { * Returns the result for `PythonConsole.loadFullValue`. */ void returnFullValue(1: LoadFullValueRequestSeq requestSeq, 2: list response), + + bool IPythonEditor(1: string path, 2: string line), } \ No newline at end of file diff --git a/python/python-console/gen/com/jetbrains/python/console/ArrayData.java b/python/python-console/gen/com/jetbrains/python/console/ArrayData.java index 52846ed0c431..8335b87d8bc8 100644 --- a/python/python-console/gen/com/jetbrains/python/console/ArrayData.java +++ b/python/python-console/gen/com/jetbrains/python/console/ArrayData.java @@ -7,7 +7,7 @@ package com.jetbrains.python.console; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-04-16") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-05-18") public class ArrayData implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ArrayData"); diff --git a/python/python-console/gen/com/jetbrains/python/console/ArrayHeaders.java b/python/python-console/gen/com/jetbrains/python/console/ArrayHeaders.java index bafd79f576ae..de80cdc892d2 100644 --- a/python/python-console/gen/com/jetbrains/python/console/ArrayHeaders.java +++ b/python/python-console/gen/com/jetbrains/python/console/ArrayHeaders.java @@ -7,7 +7,7 @@ package com.jetbrains.python.console; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-04-16") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-05-18") public class ArrayHeaders implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ArrayHeaders"); diff --git a/python/python-console/gen/com/jetbrains/python/console/ColHeader.java b/python/python-console/gen/com/jetbrains/python/console/ColHeader.java index 766a5124f323..9e344fa170cb 100644 --- a/python/python-console/gen/com/jetbrains/python/console/ColHeader.java +++ b/python/python-console/gen/com/jetbrains/python/console/ColHeader.java @@ -7,7 +7,7 @@ package com.jetbrains.python.console; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-04-16") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-05-18") public class ColHeader implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ColHeader"); diff --git a/python/python-console/gen/com/jetbrains/python/console/CompletionOption.java b/python/python-console/gen/com/jetbrains/python/console/CompletionOption.java index 08c146fd4eca..18f2f1deb8a3 100644 --- a/python/python-console/gen/com/jetbrains/python/console/CompletionOption.java +++ b/python/python-console/gen/com/jetbrains/python/console/CompletionOption.java @@ -7,7 +7,7 @@ package com.jetbrains.python.console; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-04-16") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-05-18") public class CompletionOption implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CompletionOption"); diff --git a/python/python-console/gen/com/jetbrains/python/console/DebugValue.java b/python/python-console/gen/com/jetbrains/python/console/DebugValue.java index 9026304c862c..26ab44365e0c 100644 --- a/python/python-console/gen/com/jetbrains/python/console/DebugValue.java +++ b/python/python-console/gen/com/jetbrains/python/console/DebugValue.java @@ -10,7 +10,7 @@ package com.jetbrains.python.console; /** * Corresponds to `PyDebugValue`. */ -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-04-16") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-05-18") public class DebugValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DebugValue"); diff --git a/python/python-console/gen/com/jetbrains/python/console/GetArrayResponse.java b/python/python-console/gen/com/jetbrains/python/console/GetArrayResponse.java index 3474392878bb..64984e8e9ea1 100644 --- a/python/python-console/gen/com/jetbrains/python/console/GetArrayResponse.java +++ b/python/python-console/gen/com/jetbrains/python/console/GetArrayResponse.java @@ -11,7 +11,7 @@ package com.jetbrains.python.console; * Corresponds to `ArrayChunk`. * */ -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-04-16") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-05-18") public class GetArrayResponse implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetArrayResponse"); diff --git a/python/python-console/gen/com/jetbrains/python/console/IDE.java b/python/python-console/gen/com/jetbrains/python/console/IDE.java index f34130ca9c4b..f1f01ba1cd6c 100644 --- a/python/python-console/gen/com/jetbrains/python/console/IDE.java +++ b/python/python-console/gen/com/jetbrains/python/console/IDE.java @@ -7,7 +7,7 @@ package com.jetbrains.python.console; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-04-16") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-05-18") public class IDE { public interface Iface { @@ -28,6 +28,8 @@ public class IDE { */ public void returnFullValue(int requestSeq, java.util.List response) throws org.apache.thrift.TException; + public boolean IPythonEditor(java.lang.String path, java.lang.String line) throws org.apache.thrift.TException; + } public interface AsyncIface { @@ -42,6 +44,8 @@ public class IDE { public void returnFullValue(int requestSeq, java.util.List response, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void IPythonEditor(java.lang.String path, java.lang.String line, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + } public static class Client extends org.apache.thrift.TServiceClient implements Iface { @@ -168,6 +172,30 @@ public class IDE { return; } + public boolean IPythonEditor(java.lang.String path, java.lang.String line) throws org.apache.thrift.TException + { + send_IPythonEditor(path, line); + return recv_IPythonEditor(); + } + + public void send_IPythonEditor(java.lang.String path, java.lang.String line) throws org.apache.thrift.TException + { + IPythonEditor_args args = new IPythonEditor_args(); + args.setPath(path); + args.setLine(line); + sendBase("IPythonEditor", args); + } + + public boolean recv_IPythonEditor() throws org.apache.thrift.TException + { + IPythonEditor_result result = new IPythonEditor_result(); + receiveBase(result, "IPythonEditor"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "IPythonEditor failed: unknown result"); + } + } public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { @@ -349,6 +377,41 @@ public class IDE { } } + public void IPythonEditor(java.lang.String path, java.lang.String line, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + IPythonEditor_call method_call = new IPythonEditor_call(path, line, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class IPythonEditor_call extends org.apache.thrift.async.TAsyncMethodCall { + private java.lang.String path; + private java.lang.String line; + public IPythonEditor_call(java.lang.String path, java.lang.String line, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.path = path; + this.line = line; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("IPythonEditor", org.apache.thrift.protocol.TMessageType.CALL, 0)); + IPythonEditor_args args = new IPythonEditor_args(); + args.setPath(path); + args.setLine(line); + args.write(prot); + prot.writeMessageEnd(); + } + + public java.lang.Boolean getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_IPythonEditor(); + } + } + } public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { @@ -367,6 +430,7 @@ public class IDE { processMap.put("notifyAboutMagic", new notifyAboutMagic()); processMap.put("showConsole", new showConsole()); processMap.put("returnFullValue", new returnFullValue()); + processMap.put("IPythonEditor", new IPythonEditor()); return processMap; } @@ -495,6 +559,32 @@ public class IDE { } } + public static class IPythonEditor extends org.apache.thrift.ProcessFunction { + public IPythonEditor() { + super("IPythonEditor"); + } + + public IPythonEditor_args getEmptyArgsInstance() { + return new IPythonEditor_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean handleRuntimeExceptions() { + return false; + } + + public IPythonEditor_result getResult(I iface, IPythonEditor_args args) throws org.apache.thrift.TException { + IPythonEditor_result result = new IPythonEditor_result(); + result.success = iface.IPythonEditor(args.path, args.line); + result.setSuccessIsSet(true); + return result; + } + } + } public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { @@ -513,6 +603,7 @@ public class IDE { processMap.put("notifyAboutMagic", new notifyAboutMagic()); processMap.put("showConsole", new showConsole()); processMap.put("returnFullValue", new returnFullValue()); + processMap.put("IPythonEditor", new IPythonEditor()); return processMap; } @@ -817,6 +908,68 @@ public class IDE { } } + public static class IPythonEditor extends org.apache.thrift.AsyncProcessFunction { + public IPythonEditor() { + super("IPythonEditor"); + } + + public IPythonEditor_args getEmptyArgsInstance() { + return new IPythonEditor_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(java.lang.Boolean o) { + IPythonEditor_result result = new IPythonEditor_result(); + result.success = o; + result.setSuccessIsSet(true); + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + IPythonEditor_result result = new IPythonEditor_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, IPythonEditor_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.IPythonEditor(args.path, args.line,resultHandler); + } + } + } public static class notifyFinished_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -2541,13 +2694,13 @@ public class IDE { case 1: // COMMANDS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list90 = iprot.readListBegin(); - struct.commands = new java.util.ArrayList(_list90.size); - java.lang.String _elem91; - for (int _i92 = 0; _i92 < _list90.size; ++_i92) + org.apache.thrift.protocol.TList _list100 = iprot.readListBegin(); + struct.commands = new java.util.ArrayList(_list100.size); + java.lang.String _elem101; + for (int _i102 = 0; _i102 < _list100.size; ++_i102) { - _elem91 = iprot.readString(); - struct.commands.add(_elem91); + _elem101 = iprot.readString(); + struct.commands.add(_elem101); } iprot.readListEnd(); } @@ -2583,9 +2736,9 @@ public class IDE { oprot.writeFieldBegin(COMMANDS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.commands.size())); - for (java.lang.String _iter93 : struct.commands) + for (java.lang.String _iter103 : struct.commands) { - oprot.writeString(_iter93); + oprot.writeString(_iter103); } oprot.writeListEnd(); } @@ -2622,9 +2775,9 @@ public class IDE { if (struct.isSetCommands()) { { oprot.writeI32(struct.commands.size()); - for (java.lang.String _iter94 : struct.commands) + for (java.lang.String _iter104 : struct.commands) { - oprot.writeString(_iter94); + oprot.writeString(_iter104); } } } @@ -2639,13 +2792,13 @@ public class IDE { java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list95 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.commands = new java.util.ArrayList(_list95.size); - java.lang.String _elem96; - for (int _i97 = 0; _i97 < _list95.size; ++_i97) + org.apache.thrift.protocol.TList _list105 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.commands = new java.util.ArrayList(_list105.size); + java.lang.String _elem106; + for (int _i107 = 0; _i107 < _list105.size; ++_i107) { - _elem96 = iprot.readString(); - struct.commands.add(_elem96); + _elem106 = iprot.readString(); + struct.commands.add(_elem106); } } struct.setCommandsIsSet(true); @@ -3813,14 +3966,14 @@ public class IDE { case 2: // RESPONSE if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list98 = iprot.readListBegin(); - struct.response = new java.util.ArrayList(_list98.size); - DebugValue _elem99; - for (int _i100 = 0; _i100 < _list98.size; ++_i100) + org.apache.thrift.protocol.TList _list108 = iprot.readListBegin(); + struct.response = new java.util.ArrayList(_list108.size); + DebugValue _elem109; + for (int _i110 = 0; _i110 < _list108.size; ++_i110) { - _elem99 = new DebugValue(); - _elem99.read(iprot); - struct.response.add(_elem99); + _elem109 = new DebugValue(); + _elem109.read(iprot); + struct.response.add(_elem109); } iprot.readListEnd(); } @@ -3851,9 +4004,9 @@ public class IDE { oprot.writeFieldBegin(RESPONSE_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.response.size())); - for (DebugValue _iter101 : struct.response) + for (DebugValue _iter111 : struct.response) { - _iter101.write(oprot); + _iter111.write(oprot); } oprot.writeListEnd(); } @@ -3890,9 +4043,9 @@ public class IDE { if (struct.isSetResponse()) { { oprot.writeI32(struct.response.size()); - for (DebugValue _iter102 : struct.response) + for (DebugValue _iter112 : struct.response) { - _iter102.write(oprot); + _iter112.write(oprot); } } } @@ -3908,14 +4061,14 @@ public class IDE { } if (incoming.get(1)) { { - org.apache.thrift.protocol.TList _list103 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.response = new java.util.ArrayList(_list103.size); - DebugValue _elem104; - for (int _i105 = 0; _i105 < _list103.size; ++_i105) + org.apache.thrift.protocol.TList _list113 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.response = new java.util.ArrayList(_list113.size); + DebugValue _elem114; + for (int _i115 = 0; _i115 < _list113.size; ++_i115) { - _elem104 = new DebugValue(); - _elem104.read(iprot); - struct.response.add(_elem104); + _elem114 = new DebugValue(); + _elem114.read(iprot); + struct.response.add(_elem114); } } struct.setResponseIsSet(true); @@ -4178,4 +4331,830 @@ public class IDE { } } + public static class IPythonEditor_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("IPythonEditor_args"); + + private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField LINE_FIELD_DESC = new org.apache.thrift.protocol.TField("line", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new IPythonEditor_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new IPythonEditor_argsTupleSchemeFactory(); + + public java.lang.String path; // required + public java.lang.String line; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + PATH((short)1, "path"), + LINE((short)2, "line"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // PATH + return PATH; + case 2: // LINE + return LINE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.LINE, new org.apache.thrift.meta_data.FieldMetaData("line", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(IPythonEditor_args.class, metaDataMap); + } + + public IPythonEditor_args() { + } + + public IPythonEditor_args( + java.lang.String path, + java.lang.String line) + { + this(); + this.path = path; + this.line = line; + } + + /** + * Performs a deep copy on other. + */ + public IPythonEditor_args(IPythonEditor_args other) { + if (other.isSetPath()) { + this.path = other.path; + } + if (other.isSetLine()) { + this.line = other.line; + } + } + + public IPythonEditor_args deepCopy() { + return new IPythonEditor_args(this); + } + + @Override + public void clear() { + this.path = null; + this.line = null; + } + + public java.lang.String getPath() { + return this.path; + } + + public IPythonEditor_args setPath(java.lang.String path) { + this.path = path; + return this; + } + + public void unsetPath() { + this.path = null; + } + + /** Returns true if field path is set (has been assigned a value) and false otherwise */ + public boolean isSetPath() { + return this.path != null; + } + + public void setPathIsSet(boolean value) { + if (!value) { + this.path = null; + } + } + + public java.lang.String getLine() { + return this.line; + } + + public IPythonEditor_args setLine(java.lang.String line) { + this.line = line; + return this; + } + + public void unsetLine() { + this.line = null; + } + + /** Returns true if field line is set (has been assigned a value) and false otherwise */ + public boolean isSetLine() { + return this.line != null; + } + + public void setLineIsSet(boolean value) { + if (!value) { + this.line = null; + } + } + + public void setFieldValue(_Fields field, java.lang.Object value) { + switch (field) { + case PATH: + if (value == null) { + unsetPath(); + } else { + setPath((java.lang.String)value); + } + break; + + case LINE: + if (value == null) { + unsetLine(); + } else { + setLine((java.lang.String)value); + } + break; + + } + } + + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case PATH: + return getPath(); + + case LINE: + return getLine(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case PATH: + return isSetPath(); + case LINE: + return isSetLine(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof IPythonEditor_args) + return this.equals((IPythonEditor_args)that); + return false; + } + + public boolean equals(IPythonEditor_args that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_path = true && this.isSetPath(); + boolean that_present_path = true && that.isSetPath(); + if (this_present_path || that_present_path) { + if (!(this_present_path && that_present_path)) + return false; + if (!this.path.equals(that.path)) + return false; + } + + boolean this_present_line = true && this.isSetLine(); + boolean that_present_line = true && that.isSetLine(); + if (this_present_line || that_present_line) { + if (!(this_present_line && that_present_line)) + return false; + if (!this.line.equals(that.line)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetPath()) ? 131071 : 524287); + if (isSetPath()) + hashCode = hashCode * 8191 + path.hashCode(); + + hashCode = hashCode * 8191 + ((isSetLine()) ? 131071 : 524287); + if (isSetLine()) + hashCode = hashCode * 8191 + line.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(IPythonEditor_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPath()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetLine()).compareTo(other.isSetLine()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLine()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.line, other.line); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("IPythonEditor_args("); + boolean first = true; + + sb.append("path:"); + if (this.path == null) { + sb.append("null"); + } else { + sb.append(this.path); + } + first = false; + if (!first) sb.append(", "); + sb.append("line:"); + if (this.line == null) { + sb.append("null"); + } else { + sb.append(this.line); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class IPythonEditor_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public IPythonEditor_argsStandardScheme getScheme() { + return new IPythonEditor_argsStandardScheme(); + } + } + + private static class IPythonEditor_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, IPythonEditor_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // LINE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.line = iprot.readString(); + struct.setLineIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, IPythonEditor_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.path != null) { + oprot.writeFieldBegin(PATH_FIELD_DESC); + oprot.writeString(struct.path); + oprot.writeFieldEnd(); + } + if (struct.line != null) { + oprot.writeFieldBegin(LINE_FIELD_DESC); + oprot.writeString(struct.line); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class IPythonEditor_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public IPythonEditor_argsTupleScheme getScheme() { + return new IPythonEditor_argsTupleScheme(); + } + } + + private static class IPythonEditor_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, IPythonEditor_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetPath()) { + optionals.set(0); + } + if (struct.isSetLine()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetPath()) { + oprot.writeString(struct.path); + } + if (struct.isSetLine()) { + oprot.writeString(struct.line); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, IPythonEditor_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } + if (incoming.get(1)) { + struct.line = iprot.readString(); + struct.setLineIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class IPythonEditor_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("IPythonEditor_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new IPythonEditor_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new IPythonEditor_resultTupleSchemeFactory(); + + public boolean success; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + SUCCESS((short)0, "success"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(IPythonEditor_result.class, metaDataMap); + } + + public IPythonEditor_result() { + } + + public IPythonEditor_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public IPythonEditor_result(IPythonEditor_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + public IPythonEditor_result deepCopy() { + return new IPythonEditor_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public IPythonEditor_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((java.lang.Boolean)value); + } + break; + + } + } + + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return isSuccess(); + + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof IPythonEditor_result) + return this.equals((IPythonEditor_result)that); + return false; + } + + public boolean equals(IPythonEditor_result that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((success) ? 131071 : 524287); + + return hashCode; + } + + @Override + public int compareTo(IPythonEditor_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("IPythonEditor_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class IPythonEditor_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public IPythonEditor_resultStandardScheme getScheme() { + return new IPythonEditor_resultStandardScheme(); + } + } + + private static class IPythonEditor_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, IPythonEditor_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, IPythonEditor_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class IPythonEditor_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public IPythonEditor_resultTupleScheme getScheme() { + return new IPythonEditor_resultTupleScheme(); + } + } + + private static class IPythonEditor_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, IPythonEditor_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, IPythonEditor_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + } diff --git a/python/python-console/gen/com/jetbrains/python/console/PythonConsole.java b/python/python-console/gen/com/jetbrains/python/console/PythonConsole.java index 3a47f29fa885..063fd63a0ee2 100644 --- a/python/python-console/gen/com/jetbrains/python/console/PythonConsole.java +++ b/python/python-console/gen/com/jetbrains/python/console/PythonConsole.java @@ -7,7 +7,7 @@ package com.jetbrains.python.console; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-04-16") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-05-18") public class PythonConsole { public interface Iface { @@ -60,7 +60,9 @@ public class PythonConsole { */ public void changeVariable(java.lang.String evaluationExpression, java.lang.String value) throws org.apache.thrift.TException; - public void connectToDebugger(int localPort, java.util.Map opts) throws org.apache.thrift.TException; + public void connectToDebugger(int localPort, java.util.Map opts, java.util.Map extraEnvs) throws org.apache.thrift.TException; + + public void interrupt() throws org.apache.thrift.TException; /** * Should normally return "PyCharm" string. @@ -79,9 +81,10 @@ public class PythonConsole { /** * The result is returned asyncronously with `IDE.returnFullValue`. * + * @param seq * @param variables */ - public int loadFullValue(java.util.List variables) throws org.apache.thrift.TException; + public void loadFullValue(int seq, java.util.List variables) throws org.apache.thrift.TException; } @@ -101,7 +104,9 @@ public class PythonConsole { public void changeVariable(java.lang.String evaluationExpression, java.lang.String value, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void connectToDebugger(int localPort, java.util.Map opts, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void connectToDebugger(int localPort, java.util.Map opts, java.util.Map extraEnvs, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void interrupt(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void handshake(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -111,7 +116,7 @@ public class PythonConsole { public void getArray(java.lang.String vars, int rowOffset, int colOffset, int rows, int cols, java.lang.String format, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void loadFullValue(java.util.List variables, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void loadFullValue(int seq, java.util.List variables, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; } @@ -294,17 +299,18 @@ public class PythonConsole { return; } - public void connectToDebugger(int localPort, java.util.Map opts) throws org.apache.thrift.TException + public void connectToDebugger(int localPort, java.util.Map opts, java.util.Map extraEnvs) throws org.apache.thrift.TException { - send_connectToDebugger(localPort, opts); + send_connectToDebugger(localPort, opts, extraEnvs); recv_connectToDebugger(); } - public void send_connectToDebugger(int localPort, java.util.Map opts) throws org.apache.thrift.TException + public void send_connectToDebugger(int localPort, java.util.Map opts, java.util.Map extraEnvs) throws org.apache.thrift.TException { connectToDebugger_args args = new connectToDebugger_args(); args.setLocalPort(localPort); args.setOpts(opts); + args.setExtraEnvs(extraEnvs); sendBase("connectToDebugger", args); } @@ -315,6 +321,25 @@ public class PythonConsole { return; } + public void interrupt() throws org.apache.thrift.TException + { + send_interrupt(); + recv_interrupt(); + } + + public void send_interrupt() throws org.apache.thrift.TException + { + interrupt_args args = new interrupt_args(); + sendBase("interrupt", args); + } + + public void recv_interrupt() throws org.apache.thrift.TException + { + interrupt_result result = new interrupt_result(); + receiveBase(result, "interrupt"); + return; + } + public java.lang.String handshake() throws org.apache.thrift.TException { send_handshake(); @@ -407,27 +432,25 @@ public class PythonConsole { throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getArray failed: unknown result"); } - public int loadFullValue(java.util.List variables) throws org.apache.thrift.TException + public void loadFullValue(int seq, java.util.List variables) throws org.apache.thrift.TException { - send_loadFullValue(variables); - return recv_loadFullValue(); + send_loadFullValue(seq, variables); + recv_loadFullValue(); } - public void send_loadFullValue(java.util.List variables) throws org.apache.thrift.TException + public void send_loadFullValue(int seq, java.util.List variables) throws org.apache.thrift.TException { loadFullValue_args args = new loadFullValue_args(); + args.setSeq(seq); args.setVariables(variables); sendBase("loadFullValue", args); } - public int recv_loadFullValue() throws org.apache.thrift.TException + public void recv_loadFullValue() throws org.apache.thrift.TException { loadFullValue_result result = new loadFullValue_result(); receiveBase(result, "loadFullValue"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "loadFullValue failed: unknown result"); + return; } } @@ -675,20 +698,22 @@ public class PythonConsole { } } - public void connectToDebugger(int localPort, java.util.Map opts, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void connectToDebugger(int localPort, java.util.Map opts, java.util.Map extraEnvs, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); - connectToDebugger_call method_call = new connectToDebugger_call(localPort, opts, resultHandler, this, ___protocolFactory, ___transport); + connectToDebugger_call method_call = new connectToDebugger_call(localPort, opts, extraEnvs, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class connectToDebugger_call extends org.apache.thrift.async.TAsyncMethodCall { private int localPort; - private java.util.Map opts; - public connectToDebugger_call(int localPort, java.util.Map opts, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + private java.util.Map opts; + private java.util.Map extraEnvs; + public connectToDebugger_call(int localPort, java.util.Map opts, java.util.Map extraEnvs, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); this.localPort = localPort; this.opts = opts; + this.extraEnvs = extraEnvs; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { @@ -696,6 +721,36 @@ public class PythonConsole { connectToDebugger_args args = new connectToDebugger_args(); args.setLocalPort(localPort); args.setOpts(opts); + args.setExtraEnvs(extraEnvs); + args.write(prot); + prot.writeMessageEnd(); + } + + public Void getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return null; + } + } + + public void interrupt(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + interrupt_call method_call = new interrupt_call(resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class interrupt_call extends org.apache.thrift.async.TAsyncMethodCall { + public interrupt_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("interrupt", org.apache.thrift.protocol.TMessageType.CALL, 0)); + interrupt_args args = new interrupt_args(); args.write(prot); prot.writeMessageEnd(); } @@ -847,35 +902,38 @@ public class PythonConsole { } } - public void loadFullValue(java.util.List variables, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void loadFullValue(int seq, java.util.List variables, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); - loadFullValue_call method_call = new loadFullValue_call(variables, resultHandler, this, ___protocolFactory, ___transport); + loadFullValue_call method_call = new loadFullValue_call(seq, variables, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class loadFullValue_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class loadFullValue_call extends org.apache.thrift.async.TAsyncMethodCall { + private int seq; private java.util.List variables; - public loadFullValue_call(java.util.List variables, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + public loadFullValue_call(int seq, java.util.List variables, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); + this.seq = seq; this.variables = variables; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("loadFullValue", org.apache.thrift.protocol.TMessageType.CALL, 0)); loadFullValue_args args = new loadFullValue_args(); + args.setSeq(seq); args.setVariables(variables); args.write(prot); prot.writeMessageEnd(); } - public java.lang.Integer getResult() throws org.apache.thrift.TException { + public Void getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new java.lang.IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_loadFullValue(); + return null; } } @@ -900,6 +958,7 @@ public class PythonConsole { processMap.put("getVariable", new getVariable()); processMap.put("changeVariable", new changeVariable()); processMap.put("connectToDebugger", new connectToDebugger()); + processMap.put("interrupt", new interrupt()); processMap.put("handshake", new handshake()); processMap.put("close", new close()); processMap.put("evaluate", new evaluate()); @@ -1105,7 +1164,32 @@ public class PythonConsole { public connectToDebugger_result getResult(I iface, connectToDebugger_args args) throws org.apache.thrift.TException { connectToDebugger_result result = new connectToDebugger_result(); - iface.connectToDebugger(args.localPort, args.opts); + iface.connectToDebugger(args.localPort, args.opts, args.extraEnvs); + return result; + } + } + + public static class interrupt extends org.apache.thrift.ProcessFunction { + public interrupt() { + super("interrupt"); + } + + public interrupt_args getEmptyArgsInstance() { + return new interrupt_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean handleRuntimeExceptions() { + return false; + } + + public interrupt_result getResult(I iface, interrupt_args args) throws org.apache.thrift.TException { + interrupt_result result = new interrupt_result(); + iface.interrupt(); return result; } } @@ -1230,8 +1314,7 @@ public class PythonConsole { public loadFullValue_result getResult(I iface, loadFullValue_args args) throws org.apache.thrift.TException { loadFullValue_result result = new loadFullValue_result(); - result.success = iface.loadFullValue(args.variables); - result.setSuccessIsSet(true); + iface.loadFullValue(args.seq, args.variables); return result; } } @@ -1257,6 +1340,7 @@ public class PythonConsole { processMap.put("getVariable", new getVariable()); processMap.put("changeVariable", new changeVariable()); processMap.put("connectToDebugger", new connectToDebugger()); + processMap.put("interrupt", new interrupt()); processMap.put("handshake", new handshake()); processMap.put("close", new close()); processMap.put("evaluate", new evaluate()); @@ -1749,7 +1833,67 @@ public class PythonConsole { } public void start(I iface, connectToDebugger_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.connectToDebugger(args.localPort, args.opts,resultHandler); + iface.connectToDebugger(args.localPort, args.opts, args.extraEnvs,resultHandler); + } + } + + public static class interrupt extends org.apache.thrift.AsyncProcessFunction { + public interrupt() { + super("interrupt"); + } + + public interrupt_args getEmptyArgsInstance() { + return new interrupt_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(Void o) { + interrupt_result result = new interrupt_result(); + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + interrupt_result result = new interrupt_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, interrupt_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.interrupt(resultHandler); } } @@ -1996,7 +2140,7 @@ public class PythonConsole { } } - public static class loadFullValue extends org.apache.thrift.AsyncProcessFunction { + public static class loadFullValue extends org.apache.thrift.AsyncProcessFunction { public loadFullValue() { super("loadFullValue"); } @@ -2005,13 +2149,11 @@ public class PythonConsole { return new loadFullValue_args(); } - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(java.lang.Integer o) { + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(Void o) { loadFullValue_result result = new loadFullValue_result(); - result.success = o; - result.setSuccessIsSet(true); try { fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); } catch (org.apache.thrift.transport.TTransportException e) { @@ -2053,8 +2195,8 @@ public class PythonConsole { return false; } - public void start(I iface, loadFullValue_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.loadFullValue(args.variables,resultHandler); + public void start(I iface, loadFullValue_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.loadFullValue(args.seq, args.variables,resultHandler); } } @@ -7270,19 +7412,22 @@ public class PythonConsole { public static class connectToDebugger_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("connectToDebugger_args"); - private static final org.apache.thrift.protocol.TField LOCAL_PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("localPort", org.apache.thrift.protocol.TType.I32, (short)-1); - private static final org.apache.thrift.protocol.TField OPTS_FIELD_DESC = new org.apache.thrift.protocol.TField("opts", org.apache.thrift.protocol.TType.MAP, (short)-2); + private static final org.apache.thrift.protocol.TField LOCAL_PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("localPort", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField OPTS_FIELD_DESC = new org.apache.thrift.protocol.TField("opts", org.apache.thrift.protocol.TType.MAP, (short)2); + private static final org.apache.thrift.protocol.TField EXTRA_ENVS_FIELD_DESC = new org.apache.thrift.protocol.TField("extraEnvs", org.apache.thrift.protocol.TType.MAP, (short)3); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new connectToDebugger_argsStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new connectToDebugger_argsTupleSchemeFactory(); public int localPort; // required - public java.util.Map opts; // required + public java.util.Map opts; // required + public java.util.Map extraEnvs; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { - LOCAL_PORT((short)-1, "localPort"), - OPTS((short)-2, "opts"); + LOCAL_PORT((short)1, "localPort"), + OPTS((short)2, "opts"), + EXTRA_ENVS((short)3, "extraEnvs"); private static final java.util.Map byName = new java.util.HashMap(); @@ -7297,10 +7442,12 @@ public class PythonConsole { */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case -1: // LOCAL_PORT + case 1: // LOCAL_PORT return LOCAL_PORT; - case -2: // OPTS + case 2: // OPTS return OPTS; + case 3: // EXTRA_ENVS + return EXTRA_ENVS; default: return null; } @@ -7349,6 +7496,10 @@ public class PythonConsole { tmpMap.put(_Fields.LOCAL_PORT, new org.apache.thrift.meta_data.FieldMetaData("localPort", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.OPTS, new org.apache.thrift.meta_data.FieldMetaData("opts", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)))); + tmpMap.put(_Fields.EXTRA_ENVS, new org.apache.thrift.meta_data.FieldMetaData("extraEnvs", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); @@ -7361,12 +7512,14 @@ public class PythonConsole { public connectToDebugger_args( int localPort, - java.util.Map opts) + java.util.Map opts, + java.util.Map extraEnvs) { this(); this.localPort = localPort; setLocalPortIsSet(true); this.opts = opts; + this.extraEnvs = extraEnvs; } /** @@ -7376,9 +7529,13 @@ public class PythonConsole { __isset_bitfield = other.__isset_bitfield; this.localPort = other.localPort; if (other.isSetOpts()) { - java.util.Map __this__opts = new java.util.HashMap(other.opts); + java.util.Map __this__opts = new java.util.HashMap(other.opts); this.opts = __this__opts; } + if (other.isSetExtraEnvs()) { + java.util.Map __this__extraEnvs = new java.util.HashMap(other.extraEnvs); + this.extraEnvs = __this__extraEnvs; + } } public connectToDebugger_args deepCopy() { @@ -7390,6 +7547,7 @@ public class PythonConsole { setLocalPortIsSet(false); this.localPort = 0; this.opts = null; + this.extraEnvs = null; } public int getLocalPort() { @@ -7419,18 +7577,18 @@ public class PythonConsole { return (this.opts == null) ? 0 : this.opts.size(); } - public void putToOpts(java.lang.String key, java.lang.String val) { + public void putToOpts(java.lang.String key, boolean val) { if (this.opts == null) { - this.opts = new java.util.HashMap(); + this.opts = new java.util.HashMap(); } this.opts.put(key, val); } - public java.util.Map getOpts() { + public java.util.Map getOpts() { return this.opts; } - public connectToDebugger_args setOpts(java.util.Map opts) { + public connectToDebugger_args setOpts(java.util.Map opts) { this.opts = opts; return this; } @@ -7450,6 +7608,41 @@ public class PythonConsole { } } + public int getExtraEnvsSize() { + return (this.extraEnvs == null) ? 0 : this.extraEnvs.size(); + } + + public void putToExtraEnvs(java.lang.String key, java.lang.String val) { + if (this.extraEnvs == null) { + this.extraEnvs = new java.util.HashMap(); + } + this.extraEnvs.put(key, val); + } + + public java.util.Map getExtraEnvs() { + return this.extraEnvs; + } + + public connectToDebugger_args setExtraEnvs(java.util.Map extraEnvs) { + this.extraEnvs = extraEnvs; + return this; + } + + public void unsetExtraEnvs() { + this.extraEnvs = null; + } + + /** Returns true if field extraEnvs is set (has been assigned a value) and false otherwise */ + public boolean isSetExtraEnvs() { + return this.extraEnvs != null; + } + + public void setExtraEnvsIsSet(boolean value) { + if (!value) { + this.extraEnvs = null; + } + } + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case LOCAL_PORT: @@ -7464,7 +7657,15 @@ public class PythonConsole { if (value == null) { unsetOpts(); } else { - setOpts((java.util.Map)value); + setOpts((java.util.Map)value); + } + break; + + case EXTRA_ENVS: + if (value == null) { + unsetExtraEnvs(); + } else { + setExtraEnvs((java.util.Map)value); } break; @@ -7479,6 +7680,9 @@ public class PythonConsole { case OPTS: return getOpts(); + case EXTRA_ENVS: + return getExtraEnvs(); + } throw new java.lang.IllegalStateException(); } @@ -7494,6 +7698,8 @@ public class PythonConsole { return isSetLocalPort(); case OPTS: return isSetOpts(); + case EXTRA_ENVS: + return isSetExtraEnvs(); } throw new java.lang.IllegalStateException(); } @@ -7531,6 +7737,15 @@ public class PythonConsole { return false; } + boolean this_present_extraEnvs = true && this.isSetExtraEnvs(); + boolean that_present_extraEnvs = true && that.isSetExtraEnvs(); + if (this_present_extraEnvs || that_present_extraEnvs) { + if (!(this_present_extraEnvs && that_present_extraEnvs)) + return false; + if (!this.extraEnvs.equals(that.extraEnvs)) + return false; + } + return true; } @@ -7544,6 +7759,10 @@ public class PythonConsole { if (isSetOpts()) hashCode = hashCode * 8191 + opts.hashCode(); + hashCode = hashCode * 8191 + ((isSetExtraEnvs()) ? 131071 : 524287); + if (isSetExtraEnvs()) + hashCode = hashCode * 8191 + extraEnvs.hashCode(); + return hashCode; } @@ -7575,6 +7794,16 @@ public class PythonConsole { return lastComparison; } } + lastComparison = java.lang.Boolean.valueOf(isSetExtraEnvs()).compareTo(other.isSetExtraEnvs()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExtraEnvs()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.extraEnvs, other.extraEnvs); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -7606,6 +7835,14 @@ public class PythonConsole { sb.append(this.opts); } first = false; + if (!first) sb.append(", "); + sb.append("extraEnvs:"); + if (this.extraEnvs == null) { + sb.append("null"); + } else { + sb.append(this.extraEnvs); + } + first = false; sb.append(")"); return sb.toString(); } @@ -7651,7 +7888,7 @@ public class PythonConsole { break; } switch (schemeField.id) { - case -1: // LOCAL_PORT + case 1: // LOCAL_PORT if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.localPort = iprot.readI32(); struct.setLocalPortIsSet(true); @@ -7659,17 +7896,17 @@ public class PythonConsole { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case -2: // OPTS + case 2: // OPTS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map64 = iprot.readMapBegin(); - struct.opts = new java.util.HashMap(2*_map64.size); + struct.opts = new java.util.HashMap(2*_map64.size); java.lang.String _key65; - java.lang.String _val66; + boolean _val66; for (int _i67 = 0; _i67 < _map64.size; ++_i67) { _key65 = iprot.readString(); - _val66 = iprot.readString(); + _val66 = iprot.readBool(); struct.opts.put(_key65, _val66); } iprot.readMapEnd(); @@ -7679,6 +7916,26 @@ public class PythonConsole { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 3: // EXTRA_ENVS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map68 = iprot.readMapBegin(); + struct.extraEnvs = new java.util.HashMap(2*_map68.size); + java.lang.String _key69; + java.lang.String _val70; + for (int _i71 = 0; _i71 < _map68.size; ++_i71) + { + _key69 = iprot.readString(); + _val70 = iprot.readString(); + struct.extraEnvs.put(_key69, _val70); + } + iprot.readMapEnd(); + } + struct.setExtraEnvsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -7694,22 +7951,35 @@ public class PythonConsole { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(LOCAL_PORT_FIELD_DESC); + oprot.writeI32(struct.localPort); + oprot.writeFieldEnd(); if (struct.opts != null) { oprot.writeFieldBegin(OPTS_FIELD_DESC); { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.opts.size())); - for (java.util.Map.Entry _iter68 : struct.opts.entrySet()) + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.BOOL, struct.opts.size())); + for (java.util.Map.Entry _iter72 : struct.opts.entrySet()) { - oprot.writeString(_iter68.getKey()); - oprot.writeString(_iter68.getValue()); + oprot.writeString(_iter72.getKey()); + oprot.writeBool(_iter72.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.extraEnvs != null) { + oprot.writeFieldBegin(EXTRA_ENVS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.extraEnvs.size())); + for (java.util.Map.Entry _iter73 : struct.extraEnvs.entrySet()) + { + oprot.writeString(_iter73.getKey()); + oprot.writeString(_iter73.getValue()); } oprot.writeMapEnd(); } oprot.writeFieldEnd(); } - oprot.writeFieldBegin(LOCAL_PORT_FIELD_DESC); - oprot.writeI32(struct.localPort); - oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -7734,17 +8004,30 @@ public class PythonConsole { if (struct.isSetOpts()) { optionals.set(1); } - oprot.writeBitSet(optionals, 2); + if (struct.isSetExtraEnvs()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); if (struct.isSetLocalPort()) { oprot.writeI32(struct.localPort); } if (struct.isSetOpts()) { { oprot.writeI32(struct.opts.size()); - for (java.util.Map.Entry _iter69 : struct.opts.entrySet()) + for (java.util.Map.Entry _iter74 : struct.opts.entrySet()) { - oprot.writeString(_iter69.getKey()); - oprot.writeString(_iter69.getValue()); + oprot.writeString(_iter74.getKey()); + oprot.writeBool(_iter74.getValue()); + } + } + } + if (struct.isSetExtraEnvs()) { + { + oprot.writeI32(struct.extraEnvs.size()); + for (java.util.Map.Entry _iter75 : struct.extraEnvs.entrySet()) + { + oprot.writeString(_iter75.getKey()); + oprot.writeString(_iter75.getValue()); } } } @@ -7753,26 +8036,41 @@ public class PythonConsole { @Override public void read(org.apache.thrift.protocol.TProtocol prot, connectToDebugger_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(2); + java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.localPort = iprot.readI32(); struct.setLocalPortIsSet(true); } if (incoming.get(1)) { { - org.apache.thrift.protocol.TMap _map70 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.opts = new java.util.HashMap(2*_map70.size); - java.lang.String _key71; - java.lang.String _val72; - for (int _i73 = 0; _i73 < _map70.size; ++_i73) + org.apache.thrift.protocol.TMap _map76 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.BOOL, iprot.readI32()); + struct.opts = new java.util.HashMap(2*_map76.size); + java.lang.String _key77; + boolean _val78; + for (int _i79 = 0; _i79 < _map76.size; ++_i79) { - _key71 = iprot.readString(); - _val72 = iprot.readString(); - struct.opts.put(_key71, _val72); + _key77 = iprot.readString(); + _val78 = iprot.readBool(); + struct.opts.put(_key77, _val78); } } struct.setOptsIsSet(true); } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TMap _map80 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.extraEnvs = new java.util.HashMap(2*_map80.size); + java.lang.String _key81; + java.lang.String _val82; + for (int _i83 = 0; _i83 < _map80.size; ++_i83) + { + _key81 = iprot.readString(); + _val82 = iprot.readString(); + struct.extraEnvs.put(_key81, _val82); + } + } + struct.setExtraEnvsIsSet(true); + } } } @@ -8031,6 +8329,506 @@ public class PythonConsole { } } + public static class interrupt_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("interrupt_args"); + + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new interrupt_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new interrupt_argsTupleSchemeFactory(); + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(interrupt_args.class, metaDataMap); + } + + public interrupt_args() { + } + + /** + * Performs a deep copy on other. + */ + public interrupt_args(interrupt_args other) { + } + + public interrupt_args deepCopy() { + return new interrupt_args(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, java.lang.Object value) { + switch (field) { + } + } + + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof interrupt_args) + return this.equals((interrupt_args)that); + return false; + } + + public boolean equals(interrupt_args that) { + if (that == null) + return false; + if (this == that) + return true; + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + return hashCode; + } + + @Override + public int compareTo(interrupt_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("interrupt_args("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class interrupt_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public interrupt_argsStandardScheme getScheme() { + return new interrupt_argsStandardScheme(); + } + } + + private static class interrupt_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, interrupt_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, interrupt_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class interrupt_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public interrupt_argsTupleScheme getScheme() { + return new interrupt_argsTupleScheme(); + } + } + + private static class interrupt_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, interrupt_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, interrupt_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class interrupt_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("interrupt_result"); + + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new interrupt_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new interrupt_resultTupleSchemeFactory(); + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(interrupt_result.class, metaDataMap); + } + + public interrupt_result() { + } + + /** + * Performs a deep copy on other. + */ + public interrupt_result(interrupt_result other) { + } + + public interrupt_result deepCopy() { + return new interrupt_result(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, java.lang.Object value) { + switch (field) { + } + } + + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + } + throw new java.lang.IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new java.lang.IllegalArgumentException(); + } + + switch (field) { + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof interrupt_result) + return this.equals((interrupt_result)that); + return false; + } + + public boolean equals(interrupt_result that) { + if (that == null) + return false; + if (this == that) + return true; + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + return hashCode; + } + + @Override + public int compareTo(interrupt_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("interrupt_result("); + boolean first = true; + + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class interrupt_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public interrupt_resultStandardScheme getScheme() { + return new interrupt_resultStandardScheme(); + } + } + + private static class interrupt_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, interrupt_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, interrupt_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class interrupt_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public interrupt_resultTupleScheme getScheme() { + return new interrupt_resultTupleScheme(); + } + } + + private static class interrupt_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, interrupt_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, interrupt_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + public static class handshake_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("handshake_args"); @@ -9818,14 +10616,14 @@ public class PythonConsole { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list74 = iprot.readListBegin(); - struct.success = new java.util.ArrayList(_list74.size); - DebugValue _elem75; - for (int _i76 = 0; _i76 < _list74.size; ++_i76) + org.apache.thrift.protocol.TList _list84 = iprot.readListBegin(); + struct.success = new java.util.ArrayList(_list84.size); + DebugValue _elem85; + for (int _i86 = 0; _i86 < _list84.size; ++_i86) { - _elem75 = new DebugValue(); - _elem75.read(iprot); - struct.success.add(_elem75); + _elem85 = new DebugValue(); + _elem85.read(iprot); + struct.success.add(_elem85); } iprot.readListEnd(); } @@ -9853,9 +10651,9 @@ public class PythonConsole { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (DebugValue _iter77 : struct.success) + for (DebugValue _iter87 : struct.success) { - _iter77.write(oprot); + _iter87.write(oprot); } oprot.writeListEnd(); } @@ -9886,9 +10684,9 @@ public class PythonConsole { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (DebugValue _iter78 : struct.success) + for (DebugValue _iter88 : struct.success) { - _iter78.write(oprot); + _iter88.write(oprot); } } } @@ -9900,14 +10698,14 @@ public class PythonConsole { java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list79 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new java.util.ArrayList(_list79.size); - DebugValue _elem80; - for (int _i81 = 0; _i81 < _list79.size; ++_i81) + org.apache.thrift.protocol.TList _list89 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new java.util.ArrayList(_list89.size); + DebugValue _elem90; + for (int _i91 = 0; _i91 < _list89.size; ++_i91) { - _elem80 = new DebugValue(); - _elem80.read(iprot); - struct.success.add(_elem80); + _elem90 = new DebugValue(); + _elem90.read(iprot); + struct.success.add(_elem90); } } struct.setSuccessIsSet(true); @@ -11144,16 +11942,19 @@ public class PythonConsole { public static class loadFullValue_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("loadFullValue_args"); - private static final org.apache.thrift.protocol.TField VARIABLES_FIELD_DESC = new org.apache.thrift.protocol.TField("variables", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField SEQ_FIELD_DESC = new org.apache.thrift.protocol.TField("seq", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField VARIABLES_FIELD_DESC = new org.apache.thrift.protocol.TField("variables", org.apache.thrift.protocol.TType.LIST, (short)2); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new loadFullValue_argsStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new loadFullValue_argsTupleSchemeFactory(); + public int seq; // required public java.util.List variables; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VARIABLES((short)1, "variables"); + SEQ((short)1, "seq"), + VARIABLES((short)2, "variables"); private static final java.util.Map byName = new java.util.HashMap(); @@ -11168,7 +11969,9 @@ public class PythonConsole { */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // VARIABLES + case 1: // SEQ + return SEQ; + case 2: // VARIABLES return VARIABLES; default: return null; @@ -11210,9 +12013,13 @@ public class PythonConsole { } // isset id assignments + private static final int __SEQ_ISSET_ID = 0; + private byte __isset_bitfield = 0; public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SEQ, new org.apache.thrift.meta_data.FieldMetaData("seq", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "LoadFullValueRequestSeq"))); tmpMap.put(_Fields.VARIABLES, new org.apache.thrift.meta_data.FieldMetaData("variables", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); @@ -11224,9 +12031,12 @@ public class PythonConsole { } public loadFullValue_args( + int seq, java.util.List variables) { this(); + this.seq = seq; + setSeqIsSet(true); this.variables = variables; } @@ -11234,6 +12044,8 @@ public class PythonConsole { * Performs a deep copy on other. */ public loadFullValue_args(loadFullValue_args other) { + __isset_bitfield = other.__isset_bitfield; + this.seq = other.seq; if (other.isSetVariables()) { java.util.List __this__variables = new java.util.ArrayList(other.variables); this.variables = __this__variables; @@ -11246,9 +12058,34 @@ public class PythonConsole { @Override public void clear() { + setSeqIsSet(false); + this.seq = 0; this.variables = null; } + public int getSeq() { + return this.seq; + } + + public loadFullValue_args setSeq(int seq) { + this.seq = seq; + setSeqIsSet(true); + return this; + } + + public void unsetSeq() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SEQ_ISSET_ID); + } + + /** Returns true if field seq is set (has been assigned a value) and false otherwise */ + public boolean isSetSeq() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SEQ_ISSET_ID); + } + + public void setSeqIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SEQ_ISSET_ID, value); + } + public int getVariablesSize() { return (this.variables == null) ? 0 : this.variables.size(); } @@ -11290,6 +12127,14 @@ public class PythonConsole { public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { + case SEQ: + if (value == null) { + unsetSeq(); + } else { + setSeq((java.lang.Integer)value); + } + break; + case VARIABLES: if (value == null) { unsetVariables(); @@ -11303,6 +12148,9 @@ public class PythonConsole { public java.lang.Object getFieldValue(_Fields field) { switch (field) { + case SEQ: + return getSeq(); + case VARIABLES: return getVariables(); @@ -11317,6 +12165,8 @@ public class PythonConsole { } switch (field) { + case SEQ: + return isSetSeq(); case VARIABLES: return isSetVariables(); } @@ -11338,6 +12188,15 @@ public class PythonConsole { if (this == that) return true; + boolean this_present_seq = true; + boolean that_present_seq = true; + if (this_present_seq || that_present_seq) { + if (!(this_present_seq && that_present_seq)) + return false; + if (this.seq != that.seq) + return false; + } + boolean this_present_variables = true && this.isSetVariables(); boolean that_present_variables = true && that.isSetVariables(); if (this_present_variables || that_present_variables) { @@ -11354,6 +12213,8 @@ public class PythonConsole { public int hashCode() { int hashCode = 1; + hashCode = hashCode * 8191 + seq; + hashCode = hashCode * 8191 + ((isSetVariables()) ? 131071 : 524287); if (isSetVariables()) hashCode = hashCode * 8191 + variables.hashCode(); @@ -11369,6 +12230,16 @@ public class PythonConsole { int lastComparison = 0; + lastComparison = java.lang.Boolean.valueOf(isSetSeq()).compareTo(other.isSetSeq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSeq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.seq, other.seq); + if (lastComparison != 0) { + return lastComparison; + } + } lastComparison = java.lang.Boolean.valueOf(isSetVariables()).compareTo(other.isSetVariables()); if (lastComparison != 0) { return lastComparison; @@ -11399,6 +12270,10 @@ public class PythonConsole { java.lang.StringBuilder sb = new java.lang.StringBuilder("loadFullValue_args("); boolean first = true; + sb.append("seq:"); + sb.append(this.seq); + first = false; + if (!first) sb.append(", "); sb.append("variables:"); if (this.variables == null) { sb.append("null"); @@ -11425,6 +12300,8 @@ public class PythonConsole { private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); @@ -11449,16 +12326,24 @@ public class PythonConsole { break; } switch (schemeField.id) { - case 1: // VARIABLES + case 1: // SEQ + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.seq = iprot.readI32(); + struct.setSeqIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // VARIABLES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list82 = iprot.readListBegin(); - struct.variables = new java.util.ArrayList(_list82.size); - java.lang.String _elem83; - for (int _i84 = 0; _i84 < _list82.size; ++_i84) + org.apache.thrift.protocol.TList _list92 = iprot.readListBegin(); + struct.variables = new java.util.ArrayList(_list92.size); + java.lang.String _elem93; + for (int _i94 = 0; _i94 < _list92.size; ++_i94) { - _elem83 = iprot.readString(); - struct.variables.add(_elem83); + _elem93 = iprot.readString(); + struct.variables.add(_elem93); } iprot.readListEnd(); } @@ -11482,13 +12367,16 @@ public class PythonConsole { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(SEQ_FIELD_DESC); + oprot.writeI32(struct.seq); + oprot.writeFieldEnd(); if (struct.variables != null) { oprot.writeFieldBegin(VARIABLES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.variables.size())); - for (java.lang.String _iter85 : struct.variables) + for (java.lang.String _iter95 : struct.variables) { - oprot.writeString(_iter85); + oprot.writeString(_iter95); } oprot.writeListEnd(); } @@ -11512,16 +12400,22 @@ public class PythonConsole { public void write(org.apache.thrift.protocol.TProtocol prot, loadFullValue_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetVariables()) { + if (struct.isSetSeq()) { optionals.set(0); } - oprot.writeBitSet(optionals, 1); + if (struct.isSetVariables()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSeq()) { + oprot.writeI32(struct.seq); + } if (struct.isSetVariables()) { { oprot.writeI32(struct.variables.size()); - for (java.lang.String _iter86 : struct.variables) + for (java.lang.String _iter96 : struct.variables) { - oprot.writeString(_iter86); + oprot.writeString(_iter96); } } } @@ -11530,16 +12424,20 @@ public class PythonConsole { @Override public void read(org.apache.thrift.protocol.TProtocol prot, loadFullValue_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { + struct.seq = iprot.readI32(); + struct.setSeqIsSet(true); + } + if (incoming.get(1)) { { - org.apache.thrift.protocol.TList _list87 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.variables = new java.util.ArrayList(_list87.size); - java.lang.String _elem88; - for (int _i89 = 0; _i89 < _list87.size; ++_i89) + org.apache.thrift.protocol.TList _list97 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.variables = new java.util.ArrayList(_list97.size); + java.lang.String _elem98; + for (int _i99 = 0; _i99 < _list97.size; ++_i99) { - _elem88 = iprot.readString(); - struct.variables.add(_elem88); + _elem98 = iprot.readString(); + struct.variables.add(_elem98); } } struct.setVariablesIsSet(true); @@ -11555,16 +12453,14 @@ public class PythonConsole { public static class loadFullValue_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("loadFullValue_result"); - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new loadFullValue_resultStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new loadFullValue_resultTupleSchemeFactory(); - public int success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); +; private static final java.util.Map byName = new java.util.HashMap(); @@ -11579,8 +12475,6 @@ public class PythonConsole { */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; default: return null; } @@ -11619,15 +12513,9 @@ public class PythonConsole { return _fieldName; } } - - // isset id assignments - private static final int __SUCCESS_ISSET_ID = 0; - private byte __isset_bitfield = 0; public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "LoadFullValueRequestSeq"))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(loadFullValue_result.class, metaDataMap); } @@ -11635,20 +12523,10 @@ public class PythonConsole { public loadFullValue_result() { } - public loadFullValue_result( - int success) - { - this(); - this.success = success; - setSuccessIsSet(true); - } - /** * Performs a deep copy on other. */ public loadFullValue_result(loadFullValue_result other) { - __isset_bitfield = other.__isset_bitfield; - this.success = other.success; } public loadFullValue_result deepCopy() { @@ -11657,51 +12535,15 @@ public class PythonConsole { @Override public void clear() { - setSuccessIsSet(false); - this.success = 0; - } - - public int getSuccess() { - return this.success; - } - - public loadFullValue_result setSuccess(int success) { - this.success = success; - setSuccessIsSet(true); - return this; - } - - public void unsetSuccess() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); - } - - public void setSuccessIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((java.lang.Integer)value); - } - break; - } } public java.lang.Object getFieldValue(_Fields field) { switch (field) { - case SUCCESS: - return getSuccess(); - } throw new java.lang.IllegalStateException(); } @@ -11713,8 +12555,6 @@ public class PythonConsole { } switch (field) { - case SUCCESS: - return isSetSuccess(); } throw new java.lang.IllegalStateException(); } @@ -11734,15 +12574,6 @@ public class PythonConsole { if (this == that) return true; - boolean this_present_success = true; - boolean that_present_success = true; - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (this.success != that.success) - return false; - } - return true; } @@ -11750,8 +12581,6 @@ public class PythonConsole { public int hashCode() { int hashCode = 1; - hashCode = hashCode * 8191 + success; - return hashCode; } @@ -11763,16 +12592,6 @@ public class PythonConsole { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } return 0; } @@ -11793,9 +12612,6 @@ public class PythonConsole { java.lang.StringBuilder sb = new java.lang.StringBuilder("loadFullValue_result("); boolean first = true; - sb.append("success:"); - sb.append(this.success); - first = false; sb.append(")"); return sb.toString(); } @@ -11815,8 +12631,6 @@ public class PythonConsole { private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); @@ -11841,14 +12655,6 @@ public class PythonConsole { break; } switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.success = iprot.readI32(); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -11864,11 +12670,6 @@ public class PythonConsole { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI32(struct.success); - oprot.writeFieldEnd(); - } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -11886,24 +12687,11 @@ public class PythonConsole { @Override public void write(org.apache.thrift.protocol.TProtocol prot, loadFullValue_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - oprot.writeI32(struct.success); - } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, loadFullValue_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = iprot.readI32(); - struct.setSuccessIsSet(true); - } } } diff --git a/python/python-console/gen/com/jetbrains/python/console/RowHeader.java b/python/python-console/gen/com/jetbrains/python/console/RowHeader.java index c9174937c714..295db1aa700a 100644 --- a/python/python-console/gen/com/jetbrains/python/console/RowHeader.java +++ b/python/python-console/gen/com/jetbrains/python/console/RowHeader.java @@ -7,7 +7,7 @@ package com.jetbrains.python.console; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-04-16") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-05-18") public class RowHeader implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RowHeader"); diff --git a/python/python-console/src/com/jetbrains/python/console/main.kt b/python/python-console/src/com/jetbrains/python/console/main.kt index 00d0d6c6fc86..81c048a688bb 100644 --- a/python/python-console/src/com/jetbrains/python/console/main.kt +++ b/python/python-console/src/com/jetbrains/python/console/main.kt @@ -100,6 +100,10 @@ private fun startAsyncClient(serverPort: Int) { } class IDEHandler : IDE.Iface { + override fun IPythonEditor(path: String?, line: String?): Boolean { + TODO("not implemented") //To change body of created functions use File | Settings | File Templates. + } + private val requestNumber = AtomicInteger(0) override fun notifyFinished(needsMoreInput: Boolean) { diff --git a/python/python-console/src/com/jetbrains/python/console/newMain.kt b/python/python-console/src/com/jetbrains/python/console/newMain.kt index c7e3a55eca67..b4f6dc8902a7 100644 --- a/python/python-console/src/com/jetbrains/python/console/newMain.kt +++ b/python/python-console/src/com/jetbrains/python/console/newMain.kt @@ -26,6 +26,10 @@ fun main(args: Array) { private fun startSyncServer(serverPort: Int) { val serverTransport = TNettyServerTransport(serverPort) val handler: IDE.Iface = object : IDE.Iface { + override fun IPythonEditor(path: String?, line: String?): Boolean { + TODO("not implemented") //To change body of created functions use File | Settings | File Templates. + } + override fun notifyFinished(needsMoreInput: Boolean) { TODO("not implemented") //To change body of created functions use File | Settings | File Templates. } @@ -89,6 +93,14 @@ private fun startSyncClient(serverPort: Int) { val serverTransport = clientTransport.serverTransport val handler: PythonConsole.Iface = object : PythonConsole.Iface { + override fun loadFullValue(seq: Int, variables: MutableList?) { + TODO("not implemented") //To change body of created functions use File | Settings | File Templates. + } + + override fun interrupt() { + TODO("not implemented") //To change body of created functions use File | Settings | File Templates. + } + override fun execLine(line: String?): Boolean { TODO("not implemented") //To change body of created functions use File | Settings | File Templates. } @@ -117,7 +129,7 @@ private fun startSyncClient(serverPort: Int) { TODO("not implemented") //To change body of created functions use File | Settings | File Templates. } - override fun connectToDebugger(localPort: Int, opts: MutableMap?) { + override fun connectToDebugger(localPort: Int, opts: MutableMap?, extraEnvs: MutableMap?) { TODO("not implemented") //To change body of created functions use File | Settings | File Templates. } @@ -137,10 +149,6 @@ private fun startSyncClient(serverPort: Int) { TODO("not implemented") //To change body of created functions use File | Settings | File Templates. } - override fun loadFullValue(variables: MutableList?): Int { - TODO("not implemented") //To change body of created functions use File | Settings | File Templates. - } - } val processor: PythonConsole.Processor = PythonConsole.Processor(handler) diff --git a/python/python-console/thrift/console-compile.sh b/python/python-console/thrift/console-compile.sh index e589a3bc35d3..2856789b0b83 100644 --- a/python/python-console/thrift/console-compile.sh +++ b/python/python-console/thrift/console-compile.sh @@ -1 +1,3 @@ +#!/bin/bash + thrift -r -out ../gen --gen java ../../../../community/python/helpers/pydev/pydev_console/console.thrift \ No newline at end of file