Update of /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/core
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12376/src/org/python/pydev/debug/core
Modified Files:
PydevDebugPlugin.java
Log Message:
Making code coverage.
Index: PydevDebugPlugin.java
===================================================================
RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/core/PydevDebugPlugin.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** PydevDebugPlugin.java 23 Sep 2004 22:20:31 -0000 1.8
--- PydevDebugPlugin.java 8 Oct 2004 16:43:40 -0000 1.9
***************
*** 1,4 ****
--- 1,8 ----
package org.python.pydev.debug.core;
+ import java.io.File;
+ import java.io.IOException;
+ import java.net.URL;
+
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
***************
*** 8,11 ****
--- 12,16 ----
import org.eclipse.core.resources.*;
import org.eclipse.jface.dialogs.ErrorDialog;
+ import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.python.pydev.ui.ImageCache;
***************
*** 83,85 ****
--- 88,143 ----
}
+ /**
+ *
+ * @return the script to get the variables.
+ *
+ * @throws CoreException
+ */
+ public static File getScriptWithinPySrc(String targetExec)
+ throws CoreException {
+
+ IPath relative = new Path("pysrc").addTrailingSeparator().append(
+ targetExec);
+
+ Bundle bundle = getDefault().getBundle();
+
+ URL bundleURL = Platform.find(bundle, relative);
+ URL fileURL;
+ try {
+ fileURL = Platform.asLocalURL(bundleURL);
+ File f = new File(fileURL.getPath());
+
+ return f;
+ } catch (IOException e) {
+ throw new CoreException(makeStatus(IStatus.ERROR,
+ "Can't find python debug script", null));
+ }
+ }
+
+ /**
+ *
+ * @return the script to get the variables.
+ *
+ * @throws CoreException
+ */
+ public static File getPySrcPath()
+ throws CoreException {
+
+ IPath relative = new Path("pysrc");
+
+ Bundle bundle = getDefault().getBundle();
+
+ URL bundleURL = Platform.find(bundle, relative);
+ URL fileURL;
+ try {
+ fileURL = Platform.asLocalURL(bundleURL);
+ File f = new File(fileURL.getPath());
+
+ return f;
+ } catch (IOException e) {
+ throw new CoreException(makeStatus(IStatus.ERROR,
+ "Can't find python debug script", null));
+ }
+ }
+
}
|