[Pydev-cvs] org.python.pydev.debug/src/org/python/pydev/debug/ui/launching PythonRunnerConfig.java,1
Brought to you by:
fabioz
From: Aleksandar T. <at...@us...> - 2004-07-02 02:26:11
|
Update of /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14307/src/org/python/pydev/debug/ui/launching Modified Files: PythonRunnerConfig.java PythonLaunchConfigurationDelegate.java Log Message: 3.0 port Index: PythonRunnerConfig.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching/PythonRunnerConfig.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PythonRunnerConfig.java 7 May 2004 21:50:59 -0000 1.5 --- PythonRunnerConfig.java 2 Jul 2004 02:26:01 -0000 1.6 *************** *** 7,10 **** --- 7,11 ---- import java.io.File; + import java.io.IOException; import java.net.URL; import java.util.Vector; *************** *** 14,21 **** import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.ui.externaltools.internal.launchConfigurations.ExternalToolsUtil; ! import org.eclipse.ui.externaltools.internal.variable.ExpandVariableContext; import org.python.pydev.debug.core.Constants; import org.python.pydev.debug.core.PydevDebugPlugin; --- 15,24 ---- import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; + import org.eclipse.core.runtime.Platform; + import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.ui.externaltools.internal.launchConfigurations.ExternalToolsUtil; ! import org.osgi.framework.Bundle; import org.python.pydev.debug.core.Constants; import org.python.pydev.debug.core.PydevDebugPlugin; *************** *** 38,41 **** --- 41,45 ---- public String debugScript; public int acceptTimeout = 5000; // miliseconds + public String[] envp = null; /** *************** *** 43,58 **** */ ! public PythonRunnerConfig(ILaunchConfiguration conf, String mode, ExpandVariableContext resourceContext) throws CoreException { isDebug = mode.equals(ILaunchManager.DEBUG_MODE); ! file = ExternalToolsUtil.getLocation(conf, resourceContext); interpreter = conf.getAttribute(Constants.ATTR_INTERPRETER, "python"); ! arguments = ExternalToolsUtil.getArguments(conf, resourceContext); ! IPath workingPath = ExternalToolsUtil.getWorkingDirectory(conf, resourceContext); workingDirectory = workingPath == null ? null : workingPath.toFile(); if (isDebug) { debugScript = getDebugScript(); } ! // E3 String[] envp = DebugPlugin.getDefault().getLaunchManager().getEnvironment(conf); ! } --- 47,61 ---- */ ! public PythonRunnerConfig(ILaunchConfiguration conf, String mode) throws CoreException { isDebug = mode.equals(ILaunchManager.DEBUG_MODE); ! file = ExternalToolsUtil.getLocation(conf); interpreter = conf.getAttribute(Constants.ATTR_INTERPRETER, "python"); ! arguments = ExternalToolsUtil.getArguments(conf); ! IPath workingPath = ExternalToolsUtil.getWorkingDirectory(conf); workingDirectory = workingPath == null ? null : workingPath.toFile(); if (isDebug) { debugScript = getDebugScript(); } ! envp = DebugPlugin.getDefault().getLaunchManager().getEnvironment(conf); } *************** *** 92,99 **** // IPath relative = new Path("pysrc").addTrailingSeparator().append("jpydaemon.py"); // IPath relative = new Path("pysrc").addTrailingSeparator().append("rpdb.py"); ! URL location = org.python.pydev.debug.core.PydevDebugPlugin.getDefault().find(relative); ! if (location == null) ! throw new CoreException(PydevDebugPlugin.makeStatus(IStatus.ERROR, "Internal pydev error: Cannot find pydevd.py", null)); ! return location.getPath(); } --- 95,111 ---- // IPath relative = new Path("pysrc").addTrailingSeparator().append("jpydaemon.py"); // IPath relative = new Path("pysrc").addTrailingSeparator().append("rpdb.py"); ! Bundle bundle = PydevDebugPlugin.getDefault().getBundle(); ! URL bundleURL = Platform.find( bundle, relative); ! URL fileURL; ! try { ! fileURL = Platform.resolve( bundleURL); ! String fixmePath = fileURL.getPath(); // this gets you /D:/eclipse3/workspace/org.python.pydev.debug/pysrc/pydevd.py ! if (fixmePath.charAt(2) == ':') // Windows path, fix remove the front slash ! fixmePath = fixmePath.substring(1); ! IPath fullPath = new Path(fixmePath); ! return fullPath.toOSString(); ! } catch (IOException e) { ! throw new CoreException(PydevDebugPlugin.makeStatus(IStatus.ERROR, "Can't find python debug script", null)); ! } } Index: PythonLaunchConfigurationDelegate.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching/PythonLaunchConfigurationDelegate.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PythonLaunchConfigurationDelegate.java 7 May 2004 02:03:06 -0000 1.6 --- PythonLaunchConfigurationDelegate.java 2 Jul 2004 02:26:01 -0000 1.7 *************** *** 16,22 **** import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; import org.eclipse.ui.IWindowListener; - import org.eclipse.ui.externaltools.internal.launchConfigurations.ExternalToolsUtil; - // import org.eclipse.ui.externaltools.internal.program.launchConfigurations.BackgroundResourceRefresher; - import org.eclipse.ui.externaltools.internal.variable.ExpandVariableContext; import org.python.pydev.debug.core.PydevDebugPlugin; --- 16,19 ---- *************** *** 47,52 **** monitor.beginTask("Preparing configuration", 3); ! ExpandVariableContext resourceContext = ExternalToolsUtil.getVariableContext(); ! PythonRunnerConfig runConfig = new PythonRunnerConfig(conf, mode, resourceContext); PythonRunner runner = new PythonRunner(); --- 44,48 ---- monitor.beginTask("Preparing configuration", 3); ! PythonRunnerConfig runConfig = new PythonRunnerConfig(conf, mode); PythonRunner runner = new PythonRunner(); *************** *** 62,79 **** // try { // PythonDebugClient test = new PythonDebugClient(); ! // test.init("localhost", 29000, -1, null, null, null); // do whatever needs the contextClassLoader // } catch (PythonDebugException e1) { // DebugPlugin.log(e1); // } finally { // cur.setContextClassLoader(save); ! // } ! // E3 if (CommonTab.isLaunchInBackground(conf)) { ! // E3 // refresh resources after process finishes ! // E3 if (RefreshTab.getRefreshScope(conf) != null) { ! // E3 BackgroundResourceRefresher refresher = new BackgroundResourceRefresher(conf, process); ! // E3 refresher.startBackgroundRefresh(); ! // E3 } ! // refresh resources ! // E3 RefreshTab.refreshResources(conf, monitor); } } --- 58,77 ---- // try { // PythonDebugClient test = new PythonDebugClient(); ! // test.init("localhost", 29000, -1, null, null, null); // do whatever needs the ! // contextClassLoader // } catch (PythonDebugException e1) { // DebugPlugin.log(e1); // } finally { // cur.setContextClassLoader(save); ! // } ! // if (CommonTab.isLaunchInBackground(conf)) { ! // // refresh resources after process finishes ! // if (RefreshTab.getRefreshScope(conf) != null) { ! // BackgroundResourceRefresher refresher = new BackgroundResourceRefresher(conf, process); ! // refresher.startBackgroundRefresh(); ! // } ! // // refresh resources ! // RefreshTab.refreshResources(conf, monitor); ! // } } } |