pydev-cvs Mailing List for PyDev for Eclipse (Page 21)
Brought to you by:
fabioz
You can subscribe to this list here.
2004 |
Jan
|
Feb
(4) |
Mar
(48) |
Apr
(56) |
May
(64) |
Jun
(27) |
Jul
(66) |
Aug
(81) |
Sep
(148) |
Oct
(194) |
Nov
(78) |
Dec
(46) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(125) |
Feb
(126) |
Mar
(163) |
Apr
(133) |
May
(115) |
Jun
(307) |
Jul
(387) |
Aug
(417) |
Sep
(283) |
Oct
(148) |
Nov
(45) |
Dec
(53) |
2006 |
Jan
(240) |
Feb
(200) |
Mar
(267) |
Apr
(231) |
May
(245) |
Jun
(361) |
Jul
(142) |
Aug
(12) |
Sep
(210) |
Oct
(99) |
Nov
(7) |
Dec
(30) |
2007 |
Jan
(161) |
Feb
(511) |
Mar
(265) |
Apr
(74) |
May
(147) |
Jun
(151) |
Jul
(94) |
Aug
(68) |
Sep
(98) |
Oct
(144) |
Nov
(26) |
Dec
(36) |
2008 |
Jan
(98) |
Feb
(107) |
Mar
(199) |
Apr
(113) |
May
(119) |
Jun
(112) |
Jul
(92) |
Aug
(71) |
Sep
(101) |
Oct
(16) |
Nov
|
Dec
|
From: Fabio Z. <fa...@us...> - 2008-05-02 13:41:57
|
Update of /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29973/src_completions/org/python/pydev/editor/codecompletion/revisited Modified Files: AbstractASTManager.java Log Message: __path__ not correctly found on some situations Index: AbstractASTManager.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited/AbstractASTManager.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** AbstractASTManager.java 27 Jan 2008 22:44:38 -0000 1.13 --- AbstractASTManager.java 2 May 2008 13:42:00 -0000 1.14 *************** *** 907,911 **** IToken[] completionsForModule = getCompletionsForModule(mod, state); for (int j = 0; j < completionsForModule.length; j++) { ! completions.add(completionsForModule[j]); } } else { --- 907,915 ---- IToken[] completionsForModule = getCompletionsForModule(mod, state); for (int j = 0; j < completionsForModule.length; j++) { ! IToken token = completionsForModule[j]; ! //on wild imports we don't get names that start with '_' ! if(!token.getRepresentation().startsWith("_")){ ! completions.add(token); ! } } } else { |
From: Fabio Z. <fa...@us...> - 2008-05-02 13:41:55
|
Update of /cvsroot/pydev/org.python.pydev/tests_completions/org/python/pydev/editor/codecompletion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29973/tests_completions/org/python/pydev/editor/codecompletion Modified Files: PythonCompletionCalltipsTest.java PythonCompletionWithBuiltinsTest.java PythonCompletionWithoutBuiltinsTest.java PythonCompletion25Test.java Log Message: __path__ not correctly found on some situations Index: PythonCompletionWithoutBuiltinsTest.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/tests_completions/org/python/pydev/editor/codecompletion/PythonCompletionWithoutBuiltinsTest.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** PythonCompletionWithoutBuiltinsTest.java 9 Apr 2008 00:43:47 -0000 1.18 --- PythonCompletionWithoutBuiltinsTest.java 2 May 2008 13:42:01 -0000 1.19 *************** *** 41,45 **** PythonCompletionWithoutBuiltinsTest test = new PythonCompletionWithoutBuiltinsTest(); test.setUp(); ! test.testInnerDefinition(); test.tearDown(); System.out.println("Finished"); --- 41,45 ---- PythonCompletionWithoutBuiltinsTest test = new PythonCompletionWithoutBuiltinsTest(); test.setUp(); ! // test.testImportMultipleFromImport2(); test.tearDown(); System.out.println("Finished"); *************** *** 85,94 **** requestCompl("from testl" , "testlib"); requestCompl("import testl" , "testlib"); ! requestCompl("from testlib import " , new String[]{"__init__", "unittest"}); requestCompl("from testlib import unittest, __in" , new String[]{"__init__"}); requestCompl("from testlib import unittest,__in" , new String[]{"__init__"}); requestCompl("from testlib import unittest ,__in" , new String[]{"__init__"}); requestCompl("from testlib import unittest , __in" , new String[]{"__init__"}); ! requestCompl("from testlib import unittest , " , new String[]{"__init__", "unittest"}); requestCompl("from testlib.unittest import ", getTestLibUnittestTokens()); --- 85,94 ---- requestCompl("from testl" , "testlib"); requestCompl("import testl" , "testlib"); ! requestCompl("from testlib import " , new String[]{"__init__", "unittest", "__path__"}); requestCompl("from testlib import unittest, __in" , new String[]{"__init__"}); requestCompl("from testlib import unittest,__in" , new String[]{"__init__"}); requestCompl("from testlib import unittest ,__in" , new String[]{"__init__"}); requestCompl("from testlib import unittest , __in" , new String[]{"__init__"}); ! requestCompl("from testlib import unittest , " , new String[]{"__init__", "unittest", "__path__"}); requestCompl("from testlib.unittest import ", getTestLibUnittestTokens()); *************** *** 215,219 **** String s = "from testlib import (\n"; ! requestCompl(s, new String[]{"__init__", "unittest"}); } --- 215,219 ---- String s = "from testlib import (\n"; ! requestCompl(s, new String[]{"__init__", "unittest", "__path__"}); } *************** *** 225,228 **** --- 225,229 ---- return new String[]{ "__init__" + , "__path__" , "anothertest" , "AnotherTest" *************** *** 503,507 **** s = "import testlib.unittest.relative\n" + "testlib."; ! requestCompl(s, -1, 0, new String[] { }); } --- 504,508 ---- s = "import testlib.unittest.relative\n" + "testlib."; ! requestCompl(s, -1, -1, new String[] {"__path__"}); } Index: PythonCompletionWithBuiltinsTest.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/tests_completions/org/python/pydev/editor/codecompletion/PythonCompletionWithBuiltinsTest.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PythonCompletionWithBuiltinsTest.java 2 Mar 2008 20:00:46 -0000 1.11 --- PythonCompletionWithBuiltinsTest.java 2 May 2008 13:42:01 -0000 1.12 *************** *** 131,136 **** //check for builtins..3 (builtins should not be available because it is an import request for completions) ! requestCompl("from testlib.unittest import ", new String[]{"__init__", "anothertest" ! , "AnotherTest", "GUITest", "guitestcase", "main", "relative", "t", "TestCase", "testcase", "TestCaseAlias" }); --- 131,136 ---- //check for builtins..3 (builtins should not be available because it is an import request for completions) ! requestCompl("from testlib.unittest import ", new String[]{"__init__", "__path__", "anothertest" ! , "AnotherTest", "GUITest", "guitestcase", "main", "relative", "t", "TestCase", "testcase", "TestCaseAlias", }); Index: PythonCompletion25Test.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/tests_completions/org/python/pydev/editor/codecompletion/PythonCompletion25Test.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PythonCompletion25Test.java 5 Feb 2008 13:07:13 -0000 1.3 --- PythonCompletion25Test.java 2 May 2008 13:42:01 -0000 1.4 *************** *** 54,57 **** --- 54,58 ---- return new String[]{ "__init__" + , "__path__" , "anothertest" , "AnotherTest" Index: PythonCompletionCalltipsTest.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/tests_completions/org/python/pydev/editor/codecompletion/PythonCompletionCalltipsTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PythonCompletionCalltipsTest.java 5 Feb 2008 13:07:13 -0000 1.2 --- PythonCompletionCalltipsTest.java 2 May 2008 13:42:01 -0000 1.3 *************** *** 178,182 **** "calltips."; ! requestCompl(s, s.length(), 1, new String[] {"method1(a, b)"}); } --- 178,182 ---- "calltips."; ! requestCompl(s, s.length(), 2, new String[] {"method1(a, b)", "__path__"}); } |
From: Fabio Z. <fa...@us...> - 2008-05-02 13:41:55
|
Update of /cvsroot/pydev/org.python.pydev/tests_completions/org/python/pydev/editor/codecompletion/revisited In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29973/tests_completions/org/python/pydev/editor/codecompletion/revisited Modified Files: PythonPathHelperTest.java Log Message: __path__ not correctly found on some situations Index: PythonPathHelperTest.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/tests_completions/org/python/pydev/editor/codecompletion/revisited/PythonPathHelperTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PythonPathHelperTest.java 21 Feb 2008 01:34:21 -0000 1.4 --- PythonPathHelperTest.java 2 May 2008 13:42:01 -0000 1.5 *************** *** 105,110 **** ICompletionState state = new CompletionState(line,col, token, nature, ""); comps = getComps(doc, state); ! assertEquals(9, comps.length); ASTManagerTest.assertIsIn("TestCase", comps); ASTManagerTest.assertIsIn("main", comps); --- 105,111 ---- ICompletionState state = new CompletionState(line,col, token, nature, ""); comps = getComps(doc, state); ! assertEquals(10, comps.length); + ASTManagerTest.assertIsIn("__path__", comps); ASTManagerTest.assertIsIn("TestCase", comps); ASTManagerTest.assertIsIn("main", comps); *************** *** 243,248 **** ICompletionState state = new CompletionState(line,col, token, nature,""); comps = getComps(doc, state); ! assertEquals(9, comps.length); ASTManagerTest.assertIsIn("TestCase", comps); ASTManagerTest.assertIsIn("main", comps); --- 244,250 ---- ICompletionState state = new CompletionState(line,col, token, nature,""); comps = getComps(doc, state); ! assertEquals(10, comps.length); + ASTManagerTest.assertIsIn("__path__", comps); ASTManagerTest.assertIsIn("TestCase", comps); ASTManagerTest.assertIsIn("main", comps); |
From: Fabio Z. <fa...@us...> - 2008-05-02 13:41:55
|
Update of /cvsroot/pydev/org.python.pydev/tests/pysrc/extendable In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29973/tests/pysrc/extendable Modified Files: __init__.py Added Files: with_path.py Log Message: __path__ not correctly found on some situations --- NEW FILE: with_path.py --- from extendable.calltips import __path__ print __path__ Index: __init__.py =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/tests/pysrc/extendable/__init__.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** __init__.py 8 Nov 2005 15:03:09 -0000 1.1 --- __init__.py 2 May 2008 13:42:00 -0000 1.2 *************** *** 2,4 **** This package was created so that many files may be added to it (tests can grow it as much as needed,so there should be no dependencies for the root of this package). ! ''' \ No newline at end of file --- 2,5 ---- This package was created so that many files may be added to it (tests can grow it as much as needed,so there should be no dependencies for the root of this package). ! ''' ! print __path__ \ No newline at end of file |
From: Fabio Z. <fa...@us...> - 2008-05-01 18:21:08
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11759 Modified Files: Changes.txt Log Message: Creating additional info when thread is found! Fix for http://sourceforge.net/tracker/index.php?func=detail&aid=1955428&group_id=85796&atid=577329: Index: Changes.txt =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/Changes.txt,v retrieving revision 1.376 retrieving revision 1.377 diff -C2 -d -r1.376 -r1.377 *** Changes.txt 1 May 2008 14:26:00 -0000 1.376 --- Changes.txt 1 May 2008 18:21:12 -0000 1.377 *************** *** 8,11 **** --- 8,12 ---- <li>Code completion: calltips context info correctly made 'bold'</li> <li>Debugger: Step over/Step return can now execute with untraced frames (much faster)</li> + <li>Debugger: Problem when handling thread that had no context traced and was directly removed.</li> <li>Launching: F9 will reuse an existing launch instead of creating a new one every time</li> <li>Launching: The default launch with Ctrl+F11 will not ask again for the launch associated with a file (for new launches)</li> |
From: Fabio Z. <fa...@us...> - 2008-05-01 18:21:01
|
Update of /cvsroot/pydev/org.python.pydev.debug/pysrc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11681/pysrc Modified Files: pydevd.py Log Message: Creating additional info when thread is found! Fix for http://sourceforge.net/tracker/index.php?func=detail&aid=1955428&group_id=85796&atid=577329: Index: pydevd.py =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/pysrc/pydevd.py,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** pydevd.py 12 Apr 2008 18:09:10 -0000 1.93 --- pydevd.py 1 May 2008 18:21:06 -0000 1.94 *************** *** 193,196 **** --- 193,201 ---- for t in all_threads: if id(t) == thread_id: + if not hasattr(t, 'additionalInfo'): + #see http://sourceforge.net/tracker/index.php?func=detail&aid=1955428&group_id=85796&atid=577329 + #Let's create the additional info right away! + t.additionalInfo = pydevd_additional_thread_info.PyDBAdditionalThreadInfo() + self.RUNNING_THREAD_IDS[thread_id] = t cmd = self.cmdFactory.makeThreadCreatedMessage(t) |
From: Fabio Z. <fa...@us...> - 2008-05-01 14:25:57
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/correctionassist/heuristics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19782/src/org/python/pydev/editor/correctionassist/heuristics Modified Files: IAssistProps.java Added Files: AssistSurroundWith.java Removed Files: AssistTry.java Log Message: Created more "surround with" options. --- AssistTry.java DELETED --- Index: IAssistProps.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/correctionassist/heuristics/IAssistProps.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** IAssistProps.java 6 Apr 2008 19:51:34 -0000 1.7 --- IAssistProps.java 1 May 2008 14:26:00 -0000 1.8 *************** *** 38,42 **** /** ! * Gets wether this assist proposal is valid to be applied at the current line * * @param ps the current selection --- 38,42 ---- /** ! * Gets whether this assist proposal is valid to be applied at the current line * * @param ps the current selection --- NEW FILE: AssistSurroundWith.java --- /* * Created on Apr 12, 2005 * * @author Fabio Zadrozny */ package org.python.pydev.editor.correctionassist.heuristics; import java.io.File; import java.util.ArrayList; import java.util.List; import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.ITextViewer; import org.eclipse.jface.text.contentassist.ICompletionProposal; import org.eclipse.jface.text.templates.Template; import org.eclipse.jface.text.templates.TemplateContext; import org.eclipse.jface.text.templates.TemplateProposal; import org.python.pydev.core.IPythonNature; import org.python.pydev.core.bundle.ImageCache; import org.python.pydev.core.docutils.PySelection; import org.python.pydev.core.docutils.StringUtils; import org.python.pydev.editor.PyEdit; import org.python.pydev.editor.actions.PyAction; import org.python.pydev.editor.codecompletion.AbstractTemplateCodeCompletion; import org.python.pydev.editor.codecompletion.CompletionRequest; import org.python.pydev.ui.UIConstants; /** * @author Fabio Zadrozny */ public class AssistSurroundWith extends AbstractTemplateCodeCompletion implements IAssistProps { /** * @throws BadLocationException * @see org.python.pydev.editor.correctionassist.heuristics.IAssistProps#getProps(org.python.pydev.core.docutils.PySelection, org.python.pydev.core.bundle.ImageCache) */ public List<ICompletionProposal> getProps(PySelection ps, ImageCache imageCache, File f, IPythonNature nature, PyEdit edit, int offset) throws BadLocationException { ArrayList<ICompletionProposal> l = new ArrayList<ICompletionProposal>(); String indentation = PyAction.getStaticIndentationString(edit); ps.selectCompleteLine(); int start = ps.getStartLine().getOffset(); int end = ps.getEndLine().getOffset()+ps.getEndLine().getLength(); //delimiter to use String delimiter = PyAction.getDelimiter(ps.getDoc()); //get the 1st char (determines indent) int firstCharPosition = PySelection.getFirstCharRelativePosition(ps.getDoc(), start); StringBuffer startIndentBuffer = new StringBuffer(); int i = 0; while(i < firstCharPosition){ startIndentBuffer.append(" "); i++; } final String startIndent = startIndentBuffer.toString(); //code to be surrounded String surroundedCode = ps.getDoc().get(start, end-start); surroundedCode = indentation+surroundedCode.replaceAll(delimiter, delimiter+indentation); //region IRegion region = ps.getRegion(); TemplateContext context = createContext(edit.getPySourceViewer(), region, ps.getDoc()); //not static because we need the actual code. String[] replace0to3 = new String[]{startIndent, delimiter, surroundedCode, delimiter, startIndent, delimiter, startIndent, indentation, indentation}; String[] replace4toEnd = new String[]{startIndent, delimiter, surroundedCode, delimiter, startIndent, indentation}; //actually create the template for (int iComp = 0, iRep=0; iComp < SURROUND_WITH_COMPLETIONS.length; iComp+= 2,iRep++) { String comp = SURROUND_WITH_COMPLETIONS[iComp]; if(iRep < 4){ comp = StringUtils.format(comp, (Object [])replace0to3); }else{ comp = StringUtils.format(comp, (Object [])replace4toEnd); } Template t = new Template("Surround with", SURROUND_WITH_COMPLETIONS[iComp+1], "", comp, false); l.add(new TemplateProposal(t, context, region, imageCache.get(UIConstants.COMPLETION_TEMPLATE), 5){ @Override public String getAdditionalProposalInfo() { return startIndent+super.getAdditionalProposalInfo(); } }); } return l; } /** * Template completions available for surround with... They %s will be replaced later for the actual code/indentation. * * Could be refactored so that we don't have to put the actual indent here (creating a subclass of PyDocumentTemplateContext) * Also, if that refactoring was done, we could give an interface for the user to configure those templates better. * * Another nice thing may be analyzing the current context for local variables so that * for item in collection could have 'good' choices for the collection variable based on the local variables. */ public static final String[] SURROUND_WITH_COMPLETIONS = new String[]{ "%stry:%s%s%s%sexcept${cursor}:%s%s%sraise", "try..except", "%stry:%s%s%s%sexcept (${RuntimeError}, ), e:%s%s%s${raise}${cursor}", "try..except (RuntimeError, ), e", "%stry:%s%s%s%sfinally:%s%s%s${pass}", "try..finally", "%sif ${True}:%s%s%s%selse:%s%s%s${pass}", "if..else", "%swhile ${True}:%s%s%s%s%s", "while", "%sfor ${item} in ${collection}:%s%s%s%s%s${cursor}", "for", "%sif ${True}:%s%s%s%s%s${cursor}", "if", "%swith ${var}:%s%s%s%s%s${cursor}", "with", }; /** * @see org.python.pydev.editor.correctionassist.heuristics.IAssistProps#isValid(org.python.pydev.core.docutils.PySelection) */ public boolean isValid(PySelection ps, String sel, PyEdit edit, int offset) { return ps.getTextSelection().getLength() > 0; } public List<Object> getCodeCompletionProposals(ITextViewer viewer, CompletionRequest request) throws CoreException, BadLocationException { throw new RuntimeException("Not implemented: completions should be gotten from the IAssistProps interface."); } } |
Update of /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19782/src_completions/org/python/pydev/editor/codecompletion Modified Files: PyStringCodeCompletion.java AbstractPyCodeCompletion.java Added Files: AbstractTemplateCodeCompletion.java Log Message: Created more "surround with" options. Index: PyStringCodeCompletion.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/PyStringCodeCompletion.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyStringCodeCompletion.java 25 Jan 2008 01:53:39 -0000 1.2 --- PyStringCodeCompletion.java 1 May 2008 14:26:00 -0000 1.3 *************** *** 8,20 **** import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.text.BadLocationException; - import org.eclipse.jface.text.IDocument; - import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.ITextViewer; import org.eclipse.jface.text.Region; import org.eclipse.jface.text.contentassist.ICompletionProposal; - import org.eclipse.jface.text.templates.DocumentTemplateContext; import org.eclipse.jface.text.templates.Template; import org.eclipse.jface.text.templates.TemplateContext; - import org.eclipse.jface.text.templates.TemplateContextType; import org.eclipse.jface.text.templates.TemplateProposal; import org.eclipse.swt.graphics.Image; --- 8,16 ---- *************** *** 27,32 **** import org.python.pydev.editor.codecompletion.revisited.CompletionCache; import org.python.pydev.editor.codecompletion.revisited.CompletionStateFactory; - import org.python.pydev.editor.templates.PyContextType; - import org.python.pydev.plugin.PydevPlugin; /** --- 23,26 ---- *************** *** 35,39 **** * @author fabioz */ ! public class PyStringCodeCompletion extends AbstractPyCodeCompletion{ /** --- 29,33 ---- * @author fabioz */ ! public class PyStringCodeCompletion extends AbstractTemplateCodeCompletion{ /** *************** *** 194,231 **** - - /** - * Creates a concrete template context for the given region in the document. This involves finding out which - * context type is valid at the given location, and then creating a context of this type. The default implementation - * returns a <code>DocumentTemplateContext</code> for the context type at the given location. - * - * @param viewer the viewer for which the context is created - * @param region the region into <code>document</code> for which the context is created - * @return a template context that can handle template insertion at the given location, or <code>null</code> - */ - private TemplateContext createContext(ITextViewer viewer, IRegion region, IDocument document) { - TemplateContextType contextType= getContextType(viewer, region); - if (contextType != null) { - return new DocumentTemplateContext(contextType, document, region.getOffset(), region.getLength()); - } - return null; - } - - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.text.templates.TemplateCompletionProcessor#getContextType(org.eclipse.jface.text.ITextViewer, - * org.eclipse.jface.text.IRegion) - */ - private TemplateContextType getContextType(ITextViewer viewer, IRegion region) { - PydevPlugin plugin = PydevPlugin.getDefault(); - if(plugin == null){ - //just for tests - return new TemplateContextType(); - } - return plugin.getContextTypeRegistry().getContextType(PyContextType.PY_CONTEXT_TYPE); - } - /** * @return completions added from contributors --- 188,191 ---- --- NEW FILE: AbstractTemplateCodeCompletion.java --- package org.python.pydev.editor.codecompletion; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.ITextViewer; import org.eclipse.jface.text.templates.DocumentTemplateContext; import org.eclipse.jface.text.templates.TemplateContext; import org.eclipse.jface.text.templates.TemplateContextType; import org.python.pydev.editor.templates.PyContextType; import org.python.pydev.plugin.PydevPlugin; public abstract class AbstractTemplateCodeCompletion extends AbstractPyCodeCompletion{ /** * Creates a concrete template context for the given region in the document. This involves finding out which * context type is valid at the given location, and then creating a context of this type. The default implementation * returns a <code>DocumentTemplateContext</code> for the context type at the given location. * * @param viewer the viewer for which the context is created * @param region the region into <code>document</code> for which the context is created * @return a template context that can handle template insertion at the given location, or <code>null</code> */ protected TemplateContext createContext(ITextViewer viewer, IRegion region, IDocument document) { TemplateContextType contextType= getContextType(viewer, region); if (contextType != null) { return new DocumentTemplateContext(contextType, document, region.getOffset(), region.getLength()); } return null; } /* * (non-Javadoc) * * @see org.eclipse.jface.text.templates.TemplateCompletionProcessor#getContextType(org.eclipse.jface.text.ITextViewer, * org.eclipse.jface.text.IRegion) */ protected TemplateContextType getContextType(ITextViewer viewer, IRegion region) { PydevPlugin plugin = PydevPlugin.getDefault(); if(plugin == null){ //just for tests return new TemplateContextType(); } return plugin.getContextTypeRegistry().getContextType(PyContextType.PY_CONTEXT_TYPE); } } Index: AbstractPyCodeCompletion.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/AbstractPyCodeCompletion.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** AbstractPyCodeCompletion.java 12 Apr 2008 15:40:09 -0000 1.9 --- AbstractPyCodeCompletion.java 1 May 2008 14:26:00 -0000 1.10 *************** *** 35,40 **** * @param lookingForInstance if looking for instance, we should not add the 'self' as parameter. */ ! protected void changeItokenToCompletionPropostal(ITextViewer viewer, CompletionRequest request, List<ICompletionProposal> convertedProposals, List iTokenList, boolean importsTip, ICompletionState state) { ! for (Iterator iter = iTokenList.iterator(); iter.hasNext();) { Object obj = iter.next(); --- 35,42 ---- * @param lookingForInstance if looking for instance, we should not add the 'self' as parameter. */ ! protected void changeItokenToCompletionPropostal(ITextViewer viewer, CompletionRequest request, ! List<ICompletionProposal> convertedProposals, List<Object> iTokenList, boolean importsTip, ICompletionState state) { ! ! for (Iterator<Object> iter = iTokenList.iterator(); iter.hasNext();) { Object obj = iter.next(); |
From: Fabio Z. <fa...@us...> - 2008-05-01 14:25:55
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/correctionassist In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19782/src/org/python/pydev/editor/correctionassist Modified Files: PythonCorrectionProcessor.java Log Message: Created more "surround with" options. Index: PythonCorrectionProcessor.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/correctionassist/PythonCorrectionProcessor.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** PythonCorrectionProcessor.java 9 Apr 2008 11:26:06 -0000 1.36 --- PythonCorrectionProcessor.java 1 May 2008 14:26:00 -0000 1.37 *************** *** 32,36 **** import org.python.pydev.editor.correctionassist.heuristics.AssistAssign; import org.python.pydev.editor.correctionassist.heuristics.AssistImport; ! import org.python.pydev.editor.correctionassist.heuristics.AssistTry; import org.python.pydev.editor.correctionassist.heuristics.IAssistProps; import org.python.pydev.plugin.PydevPlugin; --- 32,36 ---- import org.python.pydev.editor.correctionassist.heuristics.AssistAssign; import org.python.pydev.editor.correctionassist.heuristics.AssistImport; ! import org.python.pydev.editor.correctionassist.heuristics.AssistSurroundWith; import org.python.pydev.editor.correctionassist.heuristics.IAssistProps; import org.python.pydev.plugin.PydevPlugin; *************** *** 151,155 **** } ! assists.add(new AssistTry()); assists.add(new AssistImport()); assists.add(new AssistDocString()); --- 151,155 ---- } ! assists.add(new AssistSurroundWith()); assists.add(new AssistImport()); assists.add(new AssistDocString()); |
From: Fabio Z. <fa...@us...> - 2008-05-01 14:25:55
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19782 Modified Files: Changes.txt Log Message: Created more "surround with" options. Index: Changes.txt =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/Changes.txt,v retrieving revision 1.375 retrieving revision 1.376 diff -C2 -d -r1.375 -r1.376 *** Changes.txt 28 Apr 2008 23:03:41 -0000 1.375 --- Changes.txt 1 May 2008 14:26:00 -0000 1.376 *************** *** 12,15 **** --- 12,16 ---- <li>Project Explorer: fixed integration problems with CDT (and others)</li> <li>Launch: console encoding passed as environment variable (no longer written to the install location)</li> + <li>More templates for "surround with" (Ctrl+1 with selected code)</li> after 1.3.14 |
From: Fabio Z. <fa...@us...> - 2008-05-01 14:25:49
|
Update of /cvsroot/pydev/org.python.pydev.core/src/org/python/pydev/core/docutils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19772/src/org/python/pydev/core/docutils Modified Files: PySelection.java Log Message: Created more "surround with" options. Index: PySelection.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.core/src/org/python/pydev/core/docutils/PySelection.java,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** PySelection.java 24 Mar 2008 01:53:35 -0000 1.60 --- PySelection.java 1 May 2008 14:25:53 -0000 1.61 *************** *** 19,22 **** --- 19,23 ---- import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.ITextSelection; + import org.eclipse.jface.text.Region; import org.eclipse.jface.text.TextSelection; import org.eclipse.jface.text.TextUtilities; *************** *** 1685,1688 **** --- 1686,1694 ---- + public IRegion getRegion() { + return new Region(this.textSelection.getOffset(), this.textSelection.getLength()); + } + + |
From: Fabio Z. <fa...@us...> - 2008-04-28 23:04:45
|
Update of /cvsroot/pydev/org.python.pydev/PySrc/pydev_sitecustomize In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8103/PySrc/pydev_sitecustomize Modified Files: sitecustomize.py Log Message: Encoding passed with environment variable bug: http://sourceforge.net/tracker/index.php?func=detail&aid=1950217&group_id=85796&atid=577329 Index: sitecustomize.py =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/PySrc/pydev_sitecustomize/sitecustomize.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sitecustomize.py 7 Apr 2008 00:52:02 -0000 1.1 --- sitecustomize.py 28 Apr 2008 23:03:41 -0000 1.2 *************** *** 15,58 **** #----------------------------------------------------------------------------------------------------------------------- #check if the encoding has been specified for this launch... - config_file_str = os.path.dirname(__file__) - config_file_str = os.path.join(config_file_str, 'encoding_config') #set the encoding with the encoding_config file that should've been created #before launching the last application (it'll be removed after we get its contents) ! if os.path.exists(config_file_str): ! try: ! config_file = open(config_file_str, 'r') ! except: if DEBUG: ! import traceback;traceback.print_exc() #@Reimport ! ! else: ! #ok, file opened ! try: ! try: ! new_encoding = config_file.read() ! if new_encoding.strip(): ! encoding = new_encoding.strip() ! if DEBUG: ! print 'encoding read: ', encoding ! except: ! #ok, just ignore it if we couldn't get it ! if DEBUG: ! import traceback;traceback.print_exc() #@Reimport - finally: - try: - config_file.close() - except: - if DEBUG: - import traceback;traceback.print_exc() #@Reimport - - try: - #remove the file (it's valid only for a single launch) - os.remove(config_file_str) - except: - if DEBUG: - import traceback;traceback.print_exc() #@Reimport - --- 15,32 ---- #----------------------------------------------------------------------------------------------------------------------- #check if the encoding has been specified for this launch... #set the encoding with the encoding_config file that should've been created #before launching the last application (it'll be removed after we get its contents) ! try: ! new_encoding = os.environ.get('PYDEV_CONSOLE_ENCODING') ! if new_encoding and new_encoding.strip(): ! encoding = new_encoding.strip() if DEBUG: ! print 'encoding from env (PYDEV_CONSOLE_ENCODING): ', encoding ! except: ! #ok, just ignore it if we couldn't get it ! if DEBUG: ! import traceback;traceback.print_exc() #@Reimport *************** *** 67,70 **** --- 41,46 ---- #that's the way that the encoding is specified in WorkbenchEncoding.getWorkbenchDefaultEncoding encoding = System.getProperty("file.encoding", "") + if DEBUG: + print 'encoding from "file.encoding": ', encoding *************** *** 82,85 **** --- 58,63 ---- #ok, default locale is set (if the user didn't specify any encoding, the system default should be used) encoding = loc[1] + if DEBUG: + print 'encoding from "locale": ', encoding *************** *** 95,98 **** --- 73,78 ---- try: if encoding: + if DEBUG: + print 'Setting default encoding', encoding sys.setdefaultencoding(encoding) #@UndefinedVariable (it's deleted after the site.py is executed -- so, it's undefined for code-analysis) except: |
From: Fabio Z. <fa...@us...> - 2008-04-28 23:04:45
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8103 Modified Files: Changes.txt Log Message: Encoding passed with environment variable bug: http://sourceforge.net/tracker/index.php?func=detail&aid=1950217&group_id=85796&atid=577329 Index: Changes.txt =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/Changes.txt,v retrieving revision 1.374 retrieving revision 1.375 diff -C2 -d -r1.374 -r1.375 *** Changes.txt 27 Apr 2008 17:29:23 -0000 1.374 --- Changes.txt 28 Apr 2008 23:03:41 -0000 1.375 *************** *** 11,14 **** --- 11,15 ---- <li>Launching: The default launch with Ctrl+F11 will not ask again for the launch associated with a file (for new launches)</li> <li>Project Explorer: fixed integration problems with CDT (and others)</li> + <li>Launch: console encoding passed as environment variable (no longer written to the install location)</li> after 1.3.14 |
From: Fabio Z. <fa...@us...> - 2008-04-28 23:04:45
|
Update of /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8086/src/org/python/pydev/debug/ui/launching Modified Files: PythonRunner.java Log Message: Encoding passed with environment variable bug: http://sourceforge.net/tracker/index.php?func=detail&aid=1950217&group_id=85796&atid=577329 Index: PythonRunner.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching/PythonRunner.java,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** PythonRunner.java 9 Apr 2008 01:38:59 -0000 1.34 --- PythonRunner.java 28 Apr 2008 23:03:16 -0000 1.35 *************** *** 24,28 **** import org.python.copiedfromeclipsesrc.JDTNotAvailableException; import org.python.pydev.core.IInterpreterManager; - import org.python.pydev.core.REF; import org.python.pydev.core.docutils.StringUtils; import org.python.pydev.debug.core.Constants; --- 24,27 ---- *************** *** 211,215 **** */ private static Process createProcess(ILaunch launch, String[] envp, String[] cmdLine, File workingDirectory) throws CoreException { ! createEncodingFileForLaunch(launch); Process p = DebugPlugin.exec(cmdLine, workingDirectory, envp); return p; --- 210,220 ---- */ private static Process createProcess(ILaunch launch, String[] envp, String[] cmdLine, File workingDirectory) throws CoreException { ! String encoding = launch.getAttribute(DebugPlugin.ATTR_CONSOLE_ENCODING); ! if(encoding != null && encoding.trim().length() > 0){ ! String[] s = new String[envp.length+1]; ! System.arraycopy(envp, 0, s, 0, envp.length); ! s[s.length-1] = "PYDEV_CONSOLE_ENCODING="+encoding; ! envp = s; ! } Process p = DebugPlugin.exec(cmdLine, workingDirectory, envp); return p; *************** *** 244,272 **** * It'll then display the appropriate UI. */ ! private static IProcess registerWithDebugPluginForProcessType(String label, ILaunch launch, Process p, Map<Object, Object> processAttributes, String processType) { processAttributes.put(IProcess.ATTR_PROCESS_TYPE, processType); processAttributes.put(IProcess.ATTR_PROCESS_LABEL, label); processAttributes.put(DebugPlugin.ATTR_CAPTURE_OUTPUT, "true"); - createEncodingFileForLaunch(launch); return DebugPlugin.newProcess(launch,p, label, processAttributes); } - /** - * Creates a file the specification of the console encoding to be used by the pydev sitecustomize. - * - * @param launch the launch to which the encoding shoud be created. - */ - public static void createEncodingFileForLaunch(ILaunch launch) { - String encoding = launch.getAttribute(DebugPlugin.ATTR_CONSOLE_ENCODING); - if(encoding != null && encoding.trim().length() > 0){ - try { - File file = PydevPlugin.getScriptWithinPySrc("pydev_sitecustomize"); - file = new File(file, "encoding_config"); - REF.writeStrToFile(encoding.trim(), file); - } catch (Throwable e) { - PydevPlugin.log(e); - } - } - } } --- 249,260 ---- * It'll then display the appropriate UI. */ ! private static IProcess registerWithDebugPluginForProcessType(String label, ILaunch launch, Process p, ! Map<Object, Object> processAttributes, String processType) { processAttributes.put(IProcess.ATTR_PROCESS_TYPE, processType); processAttributes.put(IProcess.ATTR_PROCESS_LABEL, label); processAttributes.put(DebugPlugin.ATTR_CAPTURE_OUTPUT, "true"); return DebugPlugin.newProcess(launch,p, label, processAttributes); } } |
From: Fabio Z. <fa...@us...> - 2008-04-27 17:30:13
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15342 Modified Files: Changes.txt Log Message: Index: Changes.txt =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/Changes.txt,v retrieving revision 1.373 retrieving revision 1.374 diff -C2 -d -r1.373 -r1.374 *** Changes.txt 27 Apr 2008 17:28:46 -0000 1.373 --- Changes.txt 27 Apr 2008 17:29:23 -0000 1.374 *************** *** 9,13 **** <li>Debugger: Step over/Step return can now execute with untraced frames (much faster)</li> <li>Launching: F9 will reuse an existing launch instead of creating a new one every time</li> ! <li>Launching: The default launch with Ctrl+F11 will not ask again for the launch associated with a file</li> <li>Project Explorer: fixed integration problems with CDT (and others)</li> --- 9,13 ---- <li>Debugger: Step over/Step return can now execute with untraced frames (much faster)</li> <li>Launching: F9 will reuse an existing launch instead of creating a new one every time</li> ! <li>Launching: The default launch with Ctrl+F11 will not ask again for the launch associated with a file (for new launches)</li> <li>Project Explorer: fixed integration problems with CDT (and others)</li> |
From: Fabio Z. <fa...@us...> - 2008-04-27 17:28:41
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14976 Modified Files: Changes.txt Log Message: Index: Changes.txt =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/Changes.txt,v retrieving revision 1.372 retrieving revision 1.373 diff -C2 -d -r1.372 -r1.373 *** Changes.txt 12 Apr 2008 19:51:19 -0000 1.372 --- Changes.txt 27 Apr 2008 17:28:46 -0000 1.373 *************** *** 10,13 **** --- 10,14 ---- <li>Launching: F9 will reuse an existing launch instead of creating a new one every time</li> <li>Launching: The default launch with Ctrl+F11 will not ask again for the launch associated with a file</li> + <li>Project Explorer: fixed integration problems with CDT (and others)</li> after 1.3.14 |
From: Fabio Z. <fa...@us...> - 2008-04-27 17:28:19
|
Update of /cvsroot/pydev/org.python.pydev/tests_navigator/org/python/pydev/navigator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14736/tests_navigator/org/python/pydev/navigator Modified Files: PythonModelProviderTest.java Log Message: Fixes for integration problems in project explorer. Index: PythonModelProviderTest.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/tests_navigator/org/python/pydev/navigator/PythonModelProviderTest.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PythonModelProviderTest.java 22 Apr 2008 12:01:15 -0000 1.7 --- PythonModelProviderTest.java 27 Apr 2008 17:28:05 -0000 1.8 *************** *** 3,6 **** --- 3,7 ---- import java.io.File; import java.util.ArrayList; + import java.util.Arrays; import java.util.HashSet; import java.util.Set; *************** *** 26,34 **** PythonModelProviderTest test = new PythonModelProviderTest(); test.setUp(); ! test.testProjectIsRoot(); test.tearDown(); junit.textui.TestRunner.run(PythonModelProviderTest.class); ! } catch (Exception e) { e.printStackTrace(); } --- 27,35 ---- PythonModelProviderTest test = new PythonModelProviderTest(); test.setUp(); ! test.testDontRemoveOtherPluginElements(); test.tearDown(); junit.textui.TestRunner.run(PythonModelProviderTest.class); ! } catch (Throwable e) { e.printStackTrace(); } *************** *** 179,185 **** public void testDontRemoveOtherPluginElements() throws Exception { ! //TODO: see TODO's in those methods and make it work ! provider.getPipelinedChildren(null, null); ! provider.getPipelinedElements(null, null); } } --- 180,215 ---- public void testDontRemoveOtherPluginElements() throws Exception { ! final HashSet<String> pythonPathSet = new HashSet<String>(); ! pythonPathSet.add(TestDependent.TEST_PYSRC_NAVIGATOR_LOC+"projroot/source"); ! PythonNature nature = createNature(pythonPathSet); ! ! project = new ProjectStub(new File(TestDependent.TEST_PYSRC_NAVIGATOR_LOC+"projroot"), nature); ! provider = new PythonModelProvider(); ! ! HashSet<Object> currentChildren = new HashSet<Object>(); ! currentChildren.add("Test"); ! provider.getPipelinedChildren(project, currentChildren); ! ! assertEquals(1, currentChildren.size()); ! assertEquals("Test", currentChildren.iterator().next()); ! ! Object[] children = provider.getChildren(project); ! currentChildren.addAll(Arrays.asList(children)); ! provider.getPipelinedChildren(project, currentChildren); ! ! assertEquals(2, currentChildren.size()); //Test + source folder ! boolean found = false; ! for(Object o:currentChildren){ ! if("Test".equals(o)){ ! found = true; ! }else{ ! assertTrue(o instanceof PythonSourceFolder); ! } ! } ! if(!found){ ! fail("Could not find generated child"); ! } ! ! } } |
From: Fabio Z. <fa...@us...> - 2008-04-27 17:28:19
|
Update of /cvsroot/pydev/org.python.pydev/src_navigator/org/python/pydev/navigator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14736/src_navigator/org/python/pydev/navigator Modified Files: PythonModelProvider.java PythonBaseModelProvider.java Log Message: Fixes for integration problems in project explorer. Index: PythonModelProvider.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_navigator/org/python/pydev/navigator/PythonModelProvider.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PythonModelProvider.java 22 Apr 2008 12:01:15 -0000 1.10 --- PythonModelProvider.java 27 Apr 2008 17:28:05 -0000 1.11 *************** *** 5,9 **** package org.python.pydev.navigator; - import java.util.Arrays; import java.util.HashSet; import java.util.Iterator; --- 5,8 ---- *************** *** 48,51 **** --- 47,51 ---- private static final boolean DEBUG = false; + /** *************** *** 60,71 **** System.out.println("getPipelinedChildren"); } ! Object[] children = getChildren(parent); ! //TODO: We cannot clear and re-add things unless we actually have something related to pydev here ! //otherwise we may end up messing with elements from other plugins -- e.g.: CDT ! //to reproduce: create CDT project and source folder for it: when it's expanded, if pydev is enabled, ! //it won't show the source folder with the CDT icon (because we've just removed it and added a ! //regular folder element) ! currentElements.clear(); ! currentElements.addAll(Arrays.asList(children)); } --- 60,65 ---- System.out.println("getPipelinedChildren"); } ! PipelinedShapeModification modification = new PipelinedShapeModification(parent, currentElements); ! convertToPythonElementsAddOrRemove(modification, true); } *************** *** 81,92 **** System.out.println("getPipelinedElements"); } ! Object[] children = getElements(input); ! //TODO: We cannot clear and re-add things unless we actually have something related to pydev here ! //otherwise we may end up messing with elements from other plugins -- e.g.: CDT ! //to reproduce: create CDT project and source folder for it: when it's expanded, if pydev is enabled, ! //it won't show the source folder with the CDT icon (because we've just removed it and added a ! //regular folder element) ! currentElements.clear(); ! currentElements.addAll(Arrays.asList(children)); } --- 75,79 ---- System.out.println("getPipelinedElements"); } ! getPipelinedChildren(input, currentElements); } *************** *** 101,105 **** System.out.println("getPipelinedParent"); } ! return getParent(object); } --- 88,97 ---- System.out.println("getPipelinedParent"); } ! if (object instanceof IWrappedResource){ ! return getParent(object); ! }else{ ! return aSuggestedParent; ! } ! } Index: PythonBaseModelProvider.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_navigator/org/python/pydev/navigator/PythonBaseModelProvider.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PythonBaseModelProvider.java 10 Mar 2008 02:07:38 -0000 1.10 --- PythonBaseModelProvider.java 27 Apr 2008 17:28:05 -0000 1.11 *************** *** 68,72 **** * @author Fabio */ ! public class PythonBaseModelProvider extends BaseWorkbenchContentProvider implements IResourceChangeListener, IPythonNatureListener { /** --- 68,72 ---- * @author Fabio */ ! public abstract class PythonBaseModelProvider extends BaseWorkbenchContentProvider implements IResourceChangeListener, IPythonNatureListener { /** *************** *** 268,278 **** */ public Object[] getChildren(Object parentElement) { - - //------------------------------------------- for the working set, just return the children directly - // if(parentElement instanceof IWorkingSet){ - // IWorkingSet set = (IWorkingSet) parentElement; - // return set.getElements(); - // } - Object[] childrenToReturn = null; --- 268,271 ---- |
From: Fabio Z. <fa...@us...> - 2008-04-25 00:49:07
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1417 Modified Files: TODO.txt Log Message: Index: TODO.txt =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/TODO.txt,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** TODO.txt 11 Apr 2008 19:49:29 -0000 1.64 --- TODO.txt 25 Apr 2008 00:49:11 -0000 1.65 *************** *** 33,36 **** --- 33,38 ---- - Remote debugging: use module name is possible? (not filesystem dependent) - better warning when user does not have psyco (while debugging) + - PyGlobalsBrowser.getFromWorkspace() should work with jython and python if both are available + - occurrences case: |
From: Fabio Z. <fa...@us...> - 2008-04-22 12:02:31
|
Update of /cvsroot/pydev/org.python.pydev/tests_navigator/org/python/pydev/navigator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23448/tests_navigator/org/python/pydev/navigator Modified Files: PythonModelProviderTest.java Log Message: Index: PythonModelProviderTest.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/tests_navigator/org/python/pydev/navigator/PythonModelProviderTest.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PythonModelProviderTest.java 12 Apr 2008 11:44:23 -0000 1.6 --- PythonModelProviderTest.java 22 Apr 2008 12:01:15 -0000 1.7 *************** *** 177,179 **** --- 177,185 ---- } + + public void testDontRemoveOtherPluginElements() throws Exception { + //TODO: see TODO's in those methods and make it work + provider.getPipelinedChildren(null, null); + provider.getPipelinedElements(null, null); + } } |
From: Fabio Z. <fa...@us...> - 2008-04-22 12:02:27
|
Update of /cvsroot/pydev/org.python.pydev/src_navigator/org/python/pydev/navigator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23448/src_navigator/org/python/pydev/navigator Modified Files: PythonModelProvider.java Log Message: Index: PythonModelProvider.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_navigator/org/python/pydev/navigator/PythonModelProvider.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PythonModelProvider.java 12 Apr 2008 11:44:23 -0000 1.9 --- PythonModelProvider.java 22 Apr 2008 12:01:15 -0000 1.10 *************** *** 61,64 **** --- 61,69 ---- } Object[] children = getChildren(parent); + //TODO: We cannot clear and re-add things unless we actually have something related to pydev here + //otherwise we may end up messing with elements from other plugins -- e.g.: CDT + //to reproduce: create CDT project and source folder for it: when it's expanded, if pydev is enabled, + //it won't show the source folder with the CDT icon (because we've just removed it and added a + //regular folder element) currentElements.clear(); currentElements.addAll(Arrays.asList(children)); *************** *** 77,80 **** --- 82,90 ---- } Object[] children = getElements(input); + //TODO: We cannot clear and re-add things unless we actually have something related to pydev here + //otherwise we may end up messing with elements from other plugins -- e.g.: CDT + //to reproduce: create CDT project and source folder for it: when it's expanded, if pydev is enabled, + //it won't show the source folder with the CDT icon (because we've just removed it and added a + //regular folder element) currentElements.clear(); currentElements.addAll(Arrays.asList(children)); |
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){ |
From: Fabio Z. <fa...@us...> - 2008-04-13 16:55:18
|
Update of /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13489/src_completions/org/python/pydev/editor/codecompletion/revisited Modified Files: ProjectModulesManager.java PythonPathHelper.java Log Message: Better error message when launch config is not valid. Index: PythonPathHelper.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited/PythonPathHelper.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PythonPathHelper.java 13 Mar 2008 23:33:22 -0000 1.8 --- PythonPathHelper.java 13 Apr 2008 16:55:23 -0000 1.9 *************** *** 48,52 **** * @return a trimmed string with all the '\' converted to '/' */ ! public String getDefaultPathStr(String str) { //this check is no longer done... could result in other problems // if(acceptPoint == false && str.indexOf(".") == 0){ //cannot start with a dot --- 48,52 ---- * @return a trimmed string with all the '\' converted to '/' */ ! public static String getDefaultPathStr(String str) { //this check is no longer done... could result in other problems // if(acceptPoint == false && str.indexOf(".") == 0){ //cannot start with a dot *************** *** 419,423 **** * @param lPath OUT: this list is filled with the pythonpath. */ ! public void getPythonPathFromStr(String string, List<String> lPath) { String[] strings = string.split("\\|"); for (int i = 0; i < strings.length; i++) { --- 419,423 ---- * @param lPath OUT: this list is filled with the pythonpath. */ ! public static void getPythonPathFromStr(String string, List<String> lPath) { String[] strings = string.split("\\|"); for (int i = 0; i < strings.length; i++) { Index: ProjectModulesManager.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_completions/org/python/pydev/editor/codecompletion/revisited/ProjectModulesManager.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ProjectModulesManager.java 14 Jan 2008 15:00:25 -0000 1.13 --- ProjectModulesManager.java 13 Apr 2008 16:55:23 -0000 1.14 *************** *** 420,424 **** ! private void getProjectsRecursively(IProject project, boolean referenced, HashSet<IProject> memo) { IProject[] projects = null; try { --- 420,429 ---- ! /** ! * @param project the project for which we wante references. ! * @param referenced whether we want to get the referenced projects or the ones referencing this one. ! * @param memo (out) this is the place where all the projects will e available. ! */ ! public static void getProjectsRecursively(IProject project, boolean referenced, HashSet<IProject> memo) { IProject[] projects = null; try { |
From: Fabio Z. <fa...@us...> - 2008-04-13 16:55:13
|
Update of /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/blocks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13464/src/org/python/pydev/debug/ui/blocks Modified Files: PythonPathBlock.java Log Message: Better error message when launch config is not valid. Index: PythonPathBlock.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/blocks/PythonPathBlock.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PythonPathBlock.java 9 Mar 2008 14:27:59 -0000 1.2 --- PythonPathBlock.java 13 Apr 2008 16:55:18 -0000 1.3 *************** *** 1,5 **** package org.python.pydev.debug.ui.blocks; - import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; --- 1,4 ---- *************** *** 56,60 **** fPythonPathList.add(p); } ! } catch (CoreException e) { // Exceptions here may have several reasons // - The interpreter is incorrectly configured --- 55,59 ---- fPythonPathList.add(p); } ! } catch (Exception e) { // Exceptions here may have several reasons // - The interpreter is incorrectly configured |
From: Fabio Z. <fa...@us...> - 2008-04-13 16:55:13
|
Update of /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13464/src/org/python/pydev/debug/ui/launching Modified Files: PythonRunnerConfig.java AbstractLaunchConfigurationDelegate.java Added Files: InvalidRunException.java Log Message: Better error message when launch config is not valid. --- NEW FILE: InvalidRunException.java --- package org.python.pydev.debug.ui.launching; public class InvalidRunException extends Exception { public InvalidRunException(String message) { super(message); } } Index: PythonRunnerConfig.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching/PythonRunnerConfig.java,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** PythonRunnerConfig.java 18 Mar 2008 02:55:02 -0000 1.64 --- PythonRunnerConfig.java 13 Apr 2008 16:55:17 -0000 1.65 *************** *** 31,34 **** --- 31,35 ---- import org.python.pydev.core.IPythonNature; import org.python.pydev.core.REF; + import org.python.pydev.core.docutils.StringUtils; import org.python.pydev.debug.codecoverage.PyCoverage; import org.python.pydev.debug.core.Constants; *************** *** 51,59 **** public class PythonRunnerConfig { ! public static final String RUN_COVERAGE = "RUN_COVERAGE"; ! public static final String RUN_REGULAR = "RUN_REGULAR"; ! public static final String RUN_UNITTEST = "RUN_UNITTEST"; ! public static final String RUN_JYTHON_UNITTEST = "RUN_JYTHON_UNITTEST"; ! public static final String RUN_JYTHON = "RUN_JYTHON"; public IProject project; --- 52,60 ---- public class PythonRunnerConfig { ! public static final String RUN_COVERAGE = "python code coverage run"; ! public static final String RUN_REGULAR = "python regular run"; ! public static final String RUN_UNITTEST = "pyton unittest run"; ! public static final String RUN_JYTHON_UNITTEST = "jython unittest run"; ! public static final String RUN_JYTHON = "jython regular run"; public IProject project; *************** *** 196,200 **** * resolve the default interpreter. */ ! public static String getInterpreterLocation(ILaunchConfiguration conf, IPythonNature nature) throws CoreException { IInterpreterManager interpreterManager = PydevPlugin.getInterpreterManager(nature); String location = conf.getAttribute(Constants.ATTR_INTERPRETER, Constants.ATTR_INTERPRETER_DEFAULT); --- 197,201 ---- * resolve the default interpreter. */ ! public static String getInterpreterLocation(ILaunchConfiguration conf, IPythonNature nature) throws InvalidRunException, CoreException { IInterpreterManager interpreterManager = PydevPlugin.getInterpreterManager(nature); String location = conf.getAttribute(Constants.ATTR_INTERPRETER, Constants.ATTR_INTERPRETER_DEFAULT); *************** *** 204,208 **** }else if(interpreterManager.hasInfoOnInterpreter(location) == false){ ! throw new CoreException(PydevPlugin.makeStatus(IStatus.ERROR, "Error. The interprer: "+location+" is not configured in the pydev preferences as a '"+nature.getVersion()+"' interpreter (as required by the project:"+nature.getProject().getName()+").", null)); } return location; --- 205,215 ---- }else if(interpreterManager.hasInfoOnInterpreter(location) == false){ ! File file = new File(location); ! if(!file.exists()){ ! throw new InvalidRunException("Error. The interprer: "+location+" does not exist"); ! ! }else{ ! throw new InvalidRunException("Error. The interprer: "+location+" is not configured in the pydev preferences as a valid '"+nature.getVersion()+"' interpreter."); ! } } return location; *************** *** 221,226 **** * resolved location does not point to an existing directory in the local * file system */ ! public static IPath getInterpreter(ILaunchConfiguration configuration, IPythonNature nature) throws CoreException { String location = getInterpreterLocation(configuration, nature); if (location == null) { --- 228,234 ---- * resolved location does not point to an existing directory in the local * file system + * @throws InvalidRunException */ ! public static IPath getInterpreter(ILaunchConfiguration configuration, IPythonNature nature) throws CoreException, InvalidRunException { String location = getInterpreterLocation(configuration, nature); if (location == null) { *************** *** 262,267 **** * @return a string with the pythonpath used (with | as a separator) * @throws CoreException */ ! public static String getPythonpathFromConfiguration(ILaunchConfiguration conf) throws CoreException{ IProject p = getProjectFromConfiguration(conf); PythonNature pythonNature = PythonNature.getPythonNature(p); --- 270,276 ---- * @return a string with the pythonpath used (with | as a separator) * @throws CoreException + * @throws InvalidRunException */ ! public static String getPythonpathFromConfiguration(ILaunchConfiguration conf) throws CoreException, InvalidRunException{ IProject p = getProjectFromConfiguration(conf); PythonNature pythonNature = PythonNature.getPythonNature(p); *************** *** 270,277 **** } String l = getInterpreterLocation(conf, pythonNature); ! return SimpleRunner.makePythonPathEnvString(p, l); } ! public PythonRunnerConfig(ILaunchConfiguration conf, String mode, String run) throws CoreException { this(conf, mode, run, true); } --- 279,286 ---- } String l = getInterpreterLocation(conf, pythonNature); ! return SimpleRunner.makePythonPathEnvString(pythonNature, l); } ! public PythonRunnerConfig(ILaunchConfiguration conf, String mode, String run) throws CoreException, InvalidRunException { this(conf, mode, run, true); } *************** *** 279,296 **** /** * Sets defaults. */ @SuppressWarnings("unchecked") ! public PythonRunnerConfig(ILaunchConfiguration conf, String mode, String run, boolean makeArgumentsVariableSubstitution) throws CoreException { ! this.configuration = conf; ! this.run = run; ! isDebug = mode.equals(ILaunchManager.DEBUG_MODE); ! isInteractive = mode.equals("interactive"); ! ! resource = getLocation(conf); ! arguments = getArguments(conf, makeArgumentsVariableSubstitution); ! IPath workingPath = getWorkingDirectory(conf); ! workingDirectory = workingPath == null ? null : workingPath.toFile(); ! acceptTimeout = PydevPrefs.getPreferences().getInt(PydevPrefs.CONNECT_TIMEOUT); ! project = getProjectFromConfiguration(conf); --- 288,296 ---- /** * Sets defaults. + * @throws InvalidRunException */ @SuppressWarnings("unchecked") ! public PythonRunnerConfig(ILaunchConfiguration conf, String mode, String run, boolean makeArgumentsVariableSubstitution) throws CoreException, InvalidRunException { ! //1st thing, see if this is a valid run. project = getProjectFromConfiguration(conf); *************** *** 307,310 **** --- 307,342 ---- } + + + if(pythonNature.isJython()){ + if(!run.equals(RUN_JYTHON) && !run.equals(RUN_JYTHON_UNITTEST)){ + throw new InvalidRunException(StringUtils.format( + "Cannot make a '%s' for the project '%s' because the project is configured as %s\n\n" + + "To fix this, configure '%s' as python or run it as jython", + run, project.getName(), pythonNature.getVersion(), project.getName())); + } + }else if(pythonNature.isPython()){ + if(!run.equals(RUN_REGULAR) && !run.equals(RUN_COVERAGE) && !run.equals(RUN_UNITTEST)){ + throw new InvalidRunException(StringUtils.format( + "Cannot make a '%s' for the project '%s' because the project is configured as %s\n\n" + + "To fix this, configure '%s' as jython or run it as python", + run, project.getName(), pythonNature.getVersion(), project.getName())); + } + } + + + + //now, go on configuring other things + this.configuration = conf; + this.run = run; + isDebug = mode.equals(ILaunchManager.DEBUG_MODE); + isInteractive = mode.equals("interactive"); + + resource = getLocation(conf); + arguments = getArguments(conf, makeArgumentsVariableSubstitution); + IPath workingPath = getWorkingDirectory(conf); + workingDirectory = workingPath == null ? null : workingPath.toFile(); + acceptTimeout = PydevPrefs.getPreferences().getInt(PydevPrefs.CONNECT_TIMEOUT); + interpreterLocation = getInterpreterLocation(conf, pythonNature); interpreter = getInterpreter(conf, pythonNature); *************** *** 317,322 **** //ok, the user has done nothing to the environment, just get all the default environment and //put the pythonpath in it ! envp = new SimplePythonRunner().getEnvironment(project, interpreterLocation); ! pythonpathUsed = SimpleRunner.makePythonPathEnvString(project, interpreterLocation); }else{ boolean win32= Platform.getOS().equals(org.eclipse.osgi.service.environment.Constants.OS_WIN32); --- 349,354 ---- //ok, the user has done nothing to the environment, just get all the default environment and //put the pythonpath in it ! envp = new SimplePythonRunner().getEnvironment(pythonNature, interpreterLocation); ! pythonpathUsed = SimpleRunner.makePythonPathEnvString(pythonNature, interpreterLocation); }else{ boolean win32= Platform.getOS().equals(org.eclipse.osgi.service.environment.Constants.OS_WIN32); *************** *** 328,332 **** if(!specifiedPythonpath(envMap)){ ! String pythonpath = SimpleRunner.makePythonPathEnvString(project, interpreterLocation); pythonpathUsed = pythonpath; //override it if it was the ambient pythonpath --- 360,364 ---- if(!specifiedPythonpath(envMap)){ ! String pythonpath = SimpleRunner.makePythonPathEnvString(pythonNature, interpreterLocation); pythonpathUsed = pythonpath; //override it if it was the ambient pythonpath Index: AbstractLaunchConfigurationDelegate.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching/AbstractLaunchConfigurationDelegate.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** AbstractLaunchConfigurationDelegate.java 11 Dec 2007 21:18:25 -0000 1.6 --- AbstractLaunchConfigurationDelegate.java 13 Apr 2008 16:55:18 -0000 1.7 *************** *** 14,24 **** --- 14,33 ---- import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; + import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.ILaunchConfiguration; + import org.eclipse.debug.core.ILaunchManager; import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; import org.eclipse.debug.core.model.LaunchConfigurationDelegate; + import org.eclipse.debug.internal.core.LaunchConfiguration; + import org.eclipse.debug.internal.core.LaunchManager; + import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager; + import org.eclipse.jface.dialogs.ErrorDialog; + import org.eclipse.swt.widgets.Display; import org.python.pydev.core.log.Log; import org.python.pydev.debug.core.Constants; import org.python.pydev.debug.core.PydevDebugPlugin; + import org.python.pydev.editor.actions.PyAction; + import org.python.pydev.plugin.PydevPlugin; /** *************** *** 85,96 **** monitor.beginTask("Preparing configuration", 3); - PythonRunnerConfig runConfig = new PythonRunnerConfig(conf, mode, getRunnerConfigRun()); - - monitor.worked(1); try { ! PythonRunner.run(runConfig, launch, monitor); ! } catch (IOException e) { ! Log.log(e); ! throw new CoreException(PydevDebugPlugin.makeStatus(IStatus.ERROR, "Unexpected IO Exception in Pydev debugger", null)); } } --- 94,129 ---- monitor.beginTask("Preparing configuration", 3); try { ! PythonRunnerConfig runConfig = new PythonRunnerConfig(conf, mode, getRunnerConfigRun()); ! ! monitor.worked(1); ! try { ! PythonRunner.run(runConfig, launch, monitor); ! } catch (IOException e) { ! Log.log(e); ! finishLaunchWithError(launch); ! throw new CoreException(PydevDebugPlugin.makeStatus(IStatus.ERROR, "Unexpected IO Exception in Pydev debugger", null)); ! } ! }catch(final InvalidRunException e){ ! Display.getDefault().asyncExec(new Runnable(){ ! ! public void run() { ! ErrorDialog.openError(PyAction.getShell(), "Invalid launch configuration", ! "Unable to make launch because launch configuration is not valid", ! PydevPlugin.makeStatus(IStatus.ERROR, e.getMessage(), e)); ! } ! }); ! finishLaunchWithError(launch); ! } ! } ! ! private void finishLaunchWithError(ILaunch launch) { ! try{ ! launch.terminate(); ! ! ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); ! launchManager.removeLaunch(launch); ! }catch(Throwable x){ ! PydevPlugin.log(x); } } |