[Pydev-cvs] org.python.pydev/src/org/python/pydev/runners SimpleRunner.java, 1.21, 1.22
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2008-04-13 16:55:18
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/runners In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13489/src/org/python/pydev/runners Modified Files: SimpleRunner.java Log Message: Better error message when launch config is not valid. Index: SimpleRunner.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/runners/SimpleRunner.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** SimpleRunner.java 7 Apr 2008 00:52:02 -0000 1.21 --- SimpleRunner.java 13 Apr 2008 16:55:23 -0000 1.22 *************** *** 22,25 **** --- 22,26 ---- import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.ILaunchManager; + import org.python.pydev.core.IPythonNature; import org.python.pydev.core.IPythonPathNature; import org.python.pydev.core.REF; *************** *** 47,52 **** * default PYTHONPATH added). */ ! public String[] getEnvironment(IProject project, String interpreter) throws CoreException { ! PythonNature pythonNature = PythonNature.getPythonNature(project); if(pythonNature == null){ //no associated nature in the project... just get the default env return getDefaultSystemEnvAsArray(); --- 48,52 ---- * default PYTHONPATH added). */ ! public String[] getEnvironment(IPythonNature pythonNature, String interpreter) throws CoreException { if(pythonNature == null){ //no associated nature in the project... just get the default env return getDefaultSystemEnvAsArray(); *************** *** 58,62 **** if (PydevPlugin.getInterpreterManager(pythonNature).hasInfoOnInterpreter(interpreter)){ //check if we have a default interpreter. ! pythonPathEnvStr = makePythonPathEnvString(project, interpreter); } } catch (Exception e) { --- 58,62 ---- if (PydevPlugin.getInterpreterManager(pythonNature).hasInfoOnInterpreter(interpreter)){ //check if we have a default interpreter. ! pythonPathEnvStr = makePythonPathEnvString(pythonNature, interpreter); } } catch (Exception e) { *************** *** 190,195 **** * @return a string that can be used as the PYTHONPATH env variable */ ! public static String makePythonPathEnvString(IProject project, String interpreter) { ! if(project == null){ return makePythonPathEnvFromPaths(new ArrayList<String>()); //no pythonpath can be gotten (set to empty, so that the default is gotten) } --- 190,195 ---- * @return a string that can be used as the PYTHONPATH env variable */ ! public static String makePythonPathEnvString(IPythonNature pythonNature, String interpreter) { ! if(pythonNature == null){ return makePythonPathEnvFromPaths(new ArrayList<String>()); //no pythonpath can be gotten (set to empty, so that the default is gotten) } *************** *** 198,204 **** //if we have a project, get its complete pythonpath ! IPythonPathNature pythonPathNature = PythonNature.getPythonPathNature(project); if(pythonPathNature == null){ ! throw new RuntimeException("The project "+project.getName()+" does not have the pythonpath configured, \n" + "please configure it correcly (please check the pydev faq at \n" + "http://pydev.sf.net/faq.html for better information on how to do it)."); --- 198,211 ---- //if we have a project, get its complete pythonpath ! IPythonPathNature pythonPathNature = pythonNature.getPythonPathNature(); if(pythonPathNature == null){ ! IProject project = pythonNature.getProject(); ! String projectName; ! if(project == null){ ! projectName = "null?"; ! }else{ ! projectName = project.getName(); ! } ! throw new RuntimeException("The project "+projectName+" does not have the pythonpath configured, \n" + "please configure it correcly (please check the pydev faq at \n" + "http://pydev.sf.net/faq.html for better information on how to do it)."); *************** *** 314,318 **** try { monitor.setTaskName("Making pythonpath environment..."+executionString); ! String[] envp = getEnvironment(project, null); //should get the environment for the default interpreter and the given project monitor.setTaskName("Making exec..."+executionString); if(workingDir != null){ --- 321,325 ---- try { monitor.setTaskName("Making pythonpath environment..."+executionString); ! String[] envp = getEnvironment(PythonNature.getPythonNature(project), null); //should get the environment for the default interpreter and the given project monitor.setTaskName("Making exec..."+executionString); if(workingDir != null){ |