Thread: [Pydev-cvs] org.python.pydev.debug/src/org/python/pydev/debug/ui/launching PythonRunnerConfig.java
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2008-08-17 00:26:48
|
Update of /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7013/src/org/python/pydev/debug/ui/launching Modified Files: PythonRunnerConfig.java AbstractLaunchShortcut.java PythonRunner.java Log Message: <li><strong>Pydev debugger</strong>Workaround for python bug when filenames don't have absolute paths correctly generated</li> <li><strong>Pydev code-completion</strong>Wild import will only show tokens defined in __all__ (if it's available)</li> <li><strong>Interactive console</strong>: Fixed problem when more attempts to connect were needed</li> <li><strong>Interactive console</strong>Fixed console integration problem with other plugins because of interfaces not properly implemented</li> <li><strong>Code Formatter</strong>: Exponentials handled correctly</li> <li><strong>Launching</strong>: Unit-test and code-coverage may launch multiple folders/files at once</li> <li><strong>Code coverage</strong>: Number format exception no longer given when trying to show lines not executed in the editor and all lines are executed</li> Index: PythonRunner.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching/PythonRunner.java,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** PythonRunner.java 28 Jun 2008 12:35:43 -0000 1.37 --- PythonRunner.java 17 Aug 2008 00:26:56 -0000 1.38 *************** *** 13,16 **** --- 13,17 ---- import org.eclipse.core.runtime.CoreException; + import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; *************** *** 235,239 **** HashMap<Object, Object> processAttributes = new HashMap<Object, Object>(); processAttributes.put(IProcess.ATTR_CMDLINE, config.getCommandLineAsString()); ! return registerWithDebugPlugin(config.resource.lastSegment(), launch,p, processAttributes); } --- 236,240 ---- HashMap<Object, Object> processAttributes = new HashMap<Object, Object>(); processAttributes.put(IProcess.ATTR_CMDLINE, config.getCommandLineAsString()); ! return registerWithDebugPlugin(config.getRunningName(), launch,p, processAttributes); } Index: PythonRunnerConfig.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching/PythonRunnerConfig.java,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** PythonRunnerConfig.java 21 May 2008 01:38:15 -0000 1.66 --- PythonRunnerConfig.java 17 Aug 2008 00:26:56 -0000 1.67 *************** *** 32,35 **** --- 32,36 ---- import org.python.pydev.core.REF; import org.python.pydev.core.docutils.StringUtils; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.debug.codecoverage.PyCoverage; import org.python.pydev.debug.core.Constants; *************** *** 59,63 **** public IProject project; ! public IPath resource; public IPath interpreter; public String interpreterLocation; --- 60,64 ---- public IProject project; ! public IPath[] resource; public IPath interpreter; public String interpreterLocation; *************** *** 105,119 **** * system */ ! public static IPath getLocation(ILaunchConfiguration configuration) throws CoreException { ! String location = configuration.getAttribute(Constants.ATTR_LOCATION, (String) null); ! if (location == null) { throw new CoreException(PydevDebugPlugin.makeStatus(IStatus.ERROR, "Unable to get location for run", null)); } else { ! String expandedLocation = getStringVariableManager().performStringSubstitution(location); ! if (expandedLocation == null || expandedLocation.length() == 0) { ! throw new CoreException(PydevDebugPlugin.makeStatus(IStatus.ERROR, "Unable to get expanded location for run", null)); ! } else { ! return new Path(expandedLocation); ! } } } --- 106,128 ---- * system */ ! public static IPath[] getLocation(ILaunchConfiguration configuration) throws CoreException { ! String locationsStr = configuration.getAttribute(Constants.ATTR_LOCATION, (String) null); ! ! if (locationsStr == null) { throw new CoreException(PydevDebugPlugin.makeStatus(IStatus.ERROR, "Unable to get location for run", null)); } else { ! String[] locations = StringUtils.split(locationsStr, '|'); ! Path[] ret = new Path[locations.length]; ! int i=0; ! for(String location:locations){ ! String expandedLocation = getStringVariableManager().performStringSubstitution(location); ! if (expandedLocation == null || expandedLocation.length() == 0) { ! throw new CoreException(PydevDebugPlugin.makeStatus(IStatus.ERROR, "Unable to get expanded location for run", null)); ! } else { ! ret[i] = new Path(expandedLocation); ! } ! i++; ! } ! return ret; } } *************** *** 431,436 **** public String getRunningName() { ! return resource.lastSegment(); } --- 440,458 ---- + public static String getRunningName(IPath[] paths) { + FastStringBuffer buf = new FastStringBuffer(20*paths.length); + for(IPath p:paths){ + if(buf.length() > 0){ + buf.append(" - "); + } + buf.append(p.lastSegment()); + } + return buf.toString(); + + } + + public String getRunningName() { ! return getRunningName(resource); } *************** *** 581,585 **** } ! cmdArgs.add(resource.toOSString()); String runArguments[] = null; --- 603,609 ---- } ! for(IPath p:resource){ ! cmdArgs.add(p.toOSString()); ! } String runArguments[] = null; Index: AbstractLaunchShortcut.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching/AbstractLaunchShortcut.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** AbstractLaunchShortcut.java 12 Apr 2008 19:51:14 -0000 1.17 --- AbstractLaunchShortcut.java 17 Aug 2008 00:26:56 -0000 1.18 *************** *** 39,42 **** --- 39,43 ---- import org.eclipse.ui.dialogs.ElementListSelectionDialog; import org.python.pydev.core.IInterpreterManager; + import org.python.pydev.core.structure.FastStringBuffer; import org.python.pydev.debug.core.Constants; import org.python.pydev.debug.core.PydevDebugPlugin; *************** *** 339,346 **** private static String makeFileRelativeToWorkspace(IResource[] resource, IStringVariableManager varManager) { ! String moduleFile; ! moduleFile = resource[0].getFullPath().makeRelative().toString(); ! moduleFile = varManager.generateVariableExpression("workspace_loc", moduleFile); ! return moduleFile; } --- 340,353 ---- private static String makeFileRelativeToWorkspace(IResource[] resource, IStringVariableManager varManager) { ! FastStringBuffer moduleFile = new FastStringBuffer(80*resource.length); ! for(IResource r:resource){ ! String m = r.getFullPath().makeRelative().toString(); ! m = varManager.generateVariableExpression("workspace_loc", m); ! if(moduleFile.length() > 0){ ! moduleFile.append("|"); ! } ! moduleFile.append(m); ! } ! return moduleFile.toString(); } |