[Pydev-cvs] org.python.pydev/src/org/python/pydev/editor/codecompletion PythonShell.java,1.9,1.10
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2004-09-24 19:23:59
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/codecompletion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13822/src/org/python/pydev/editor/codecompletion Modified Files: PythonShell.java Log Message: Changes to server, was hanging if too many completions were returned... That is, if the namespace is too polluted...ehhehehe Index: PythonShell.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/codecompletion/PythonShell.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PythonShell.java 24 Sep 2004 16:41:21 -0000 1.9 --- PythonShell.java 24 Sep 2004 19:23:49 -0000 1.10 *************** *** 212,216 **** public String read(Operation operation) throws IOException { String str = ""; ! int j = 0; while(j != 100){ --- 212,216 ---- public String read(Operation operation) throws IOException { String str = ""; ! String tempStr = ""; int j = 0; while(j != 100){ *************** *** 248,253 **** break; }else{ ! j++; sleepALittle(10); } --- 248,259 ---- break; }else{ ! ! if(tempStr.equals(str) == true){ //only raise if nothing was received. ! j++; ! }else{ ! j = 0; //we are receiving, even though that may take a long time if the namespace is really polluted... ! } sleepALittle(10); + tempStr = str; } *************** *** 258,264 **** //remove END@@ try { ! str = str.substring(0, str.lastIndexOf("END@@")); ! return str; } catch (RuntimeException e) { PydevPlugin.log(IStatus.ERROR, "ERROR WITH STRING:"+str, e); return ""; --- 264,278 ---- //remove END@@ try { ! if(str.indexOf("END@@")!= -1){ ! str = str.substring(0, str.indexOf("END@@")); ! return str; ! }else{ ! throw new RuntimeException("Couldn't find END@@ on received string."); ! } } catch (RuntimeException e) { + e.printStackTrace(); + if(str.length() > 1000){ + str = str.substring(0, 999)+"...(continued)...";//if the string gets too big, it can crash Eclipse... + } PydevPlugin.log(IStatus.ERROR, "ERROR WITH STRING:"+str, e); return ""; |