2
* Created on Aug 16, 2004
4
* @author Fabio Zadrozny
6
package org.python.pydev.editor.codecompletion.shell;
9
import java.io.IOException;
11
import org.eclipse.core.runtime.CoreException;
12
import org.python.pydev.core.REF;
13
import org.python.pydev.plugin.PydevPlugin;
14
import org.python.pydev.runners.SimplePythonRunner;
15
import org.python.pydev.runners.SimpleRunner;
18
* @author Fabio Zadrozny
20
public class PythonShell extends AbstractShell{
24
* Initialize with the default python server file.
27
* @throws CoreException
29
public PythonShell() throws IOException, CoreException {
30
super(PydevPlugin.getScriptWithinPySrc("pycompletionserver.py"));
35
protected synchronized String createServerProcess(int pWrite, int pRead) throws IOException {
36
String interpreter = PydevPlugin.getPythonInterpreterManager().getDefaultInterpreter();
37
File file = new File(interpreter);
38
if(file.exists() == false ){
39
throw new RuntimeException("The interpreter location found does not exist. "+interpreter);
41
if(file.isDirectory() == true){
42
throw new RuntimeException("The interpreter location found is a directory. "+interpreter);
47
if(SimpleRunner.isWindowsPlatform()){ //in windows, we have to put python "path_to_file.py"
48
execMsg = interpreter+" \""+REF.getFileAbsolutePath(serverFile)+"\" "+pWrite+" "+pRead;
49
}else{ //however in mac, or linux, this gives an error...
50
execMsg = interpreter+" "+REF.getFileAbsolutePath(serverFile)+" "+pWrite+" "+pRead;
52
process = new SimplePythonRunner().createProcess(execMsg, serverFile.getParentFile());
b'\\ No newline at end of file'