Thread: [Pydev-cvs] org.python.pydev/src/org/python/pydev/editor/codecompletion PythonShell.java,1.7,1.8 PyC
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2004-09-20 13:18:14
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/codecompletion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31827/src/org/python/pydev/editor/codecompletion Modified Files: PythonShell.java PyCodeCompletion.java Log Message: Using pydev preferences to know which python interpreter to use. Index: PythonShell.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/codecompletion/PythonShell.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PythonShell.java 17 Sep 2004 19:22:04 -0000 1.7 --- PythonShell.java 20 Sep 2004 13:18:05 -0000 1.8 *************** *** 18,21 **** --- 18,22 ---- import org.eclipse.core.runtime.CoreException; import org.python.pydev.editor.actions.refactoring.PyRefactorAction.Operation; + import org.python.pydev.plugin.PydevPrefs; import org.python.pydev.plugin.SocketUtil; *************** *** 135,139 **** if(process != null) endIt(); ! process = Runtime.getRuntime().exec("python "+serverFile.getAbsolutePath()+" "+pWrite+" "+pRead); boolean connected = false; --- 136,140 ---- if(process != null) endIt(); ! process = Runtime.getRuntime().exec(PydevPrefs.getDefaultInterpreter()+" "+serverFile.getAbsolutePath()+" "+pWrite+" "+pRead); boolean connected = false; *************** *** 249,253 **** public String read() throws IOException { String r = read(null); ! System.out.println("RETURNING:"+r); return r; } --- 250,254 ---- public String read() throws IOException { String r = read(null); ! // System.out.println("RETURNING:"+r); return r; } *************** *** 259,263 **** */ public void write(String str) throws IOException { ! System.out.println("WRITING:"+str); this.socketToWrite.getOutputStream().write(str.getBytes()); } --- 260,264 ---- */ public void write(String str) throws IOException { ! // System.out.println("WRITING:"+str); this.socketToWrite.getOutputStream().write(str.getBytes()); } Index: PyCodeCompletion.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/codecompletion/PyCodeCompletion.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PyCodeCompletion.java 17 Sep 2004 19:22:04 -0000 1.7 --- PyCodeCompletion.java 20 Sep 2004 13:18:05 -0000 1.8 *************** *** 105,112 **** .getPythonModel(), loc); ! Scope scope = closest.getScope().findContainingClass(); ! String token = scope.getStartNode().getName(); ! completions = serverShell ! .getClassCompletions(token, docToParse); } else { completions = serverShell.getTokenCompletions(trimmed, --- 105,117 ---- .getPythonModel(), loc); ! if(closest == null){ ! completions = serverShell.getTokenCompletions(trimmed, ! docToParse); ! }else{ ! Scope scope = closest.getScope().findContainingClass(); ! String token = scope.getStartNode().getName(); ! completions = serverShell ! .getClassCompletions(token, docToParse); ! } } else { completions = serverShell.getTokenCompletions(trimmed, *************** *** 206,210 **** e1.printStackTrace(); } ! return newDoc; } --- 211,215 ---- e1.printStackTrace(); } ! return "\n"+newDoc; } *************** *** 294,299 **** return " "; } ! if(str.lastIndexOf(' ') != -1){ ! return str.substring(str.lastIndexOf(' '), str.length()); } return str; --- 299,309 ---- return " "; } ! ! int lastSpaceIndex = str.lastIndexOf(' '); ! int lastParIndex = str.lastIndexOf('('); ! ! if(lastParIndex != -1 || lastSpaceIndex != -1){ ! int lastIndex = lastSpaceIndex > lastParIndex ? lastSpaceIndex : lastParIndex; ! return str.substring(lastIndex+1, str.length()); } return str; |