pydev-cvs Mailing List for PyDev for Eclipse (Page 12)
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-07-02 20:38:31
|
Update of /cvsroot/pydev/org.python.pydev.parser/src/org/python/pydev/parser/fastparser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27516/src/org/python/pydev/parser/fastparser Modified Files: FastDefinitionsParser.java Log Message: Checking line and column on definitions parser Index: FastDefinitionsParser.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.parser/src/org/python/pydev/parser/fastparser/FastDefinitionsParser.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FastDefinitionsParser.java 2 Jul 2008 20:18:53 -0000 1.2 --- FastDefinitionsParser.java 2 Jul 2008 20:38:39 -0000 1.3 *************** *** 56,60 **** * The current column */ ! private int col = 1; /** --- 56,60 ---- * The current column */ ! private int col; /** *************** *** 90,93 **** --- 90,99 ---- /** + * Should we debug? + */ + private final static boolean DEBUG = false; + + + /** * Constructor * *************** *** 115,118 **** --- 121,127 ---- case '\'': case '"': + if(DEBUG){ + System.out.println("literal"); + } //go to the end of the literal currIndex = ParsingUtils.getLiteralEnd(cs, currIndex, c); *************** *** 122,125 **** --- 131,137 ---- case '#': + if(DEBUG){ + System.out.println("comment"); + } //go to the end of the comment currIndex++; *************** *** 171,174 **** --- 183,189 ---- + /** + * Called when a new line is found. Tries to make the match of function and class definitions. + */ private void handleNewLine() { if(currIndex >= length-1){ *************** *** 176,181 **** } ! col = 0; row ++; lineBuffer.clear(); char c = cs[currIndex]; --- 191,200 ---- } ! col = 1; row ++; + if(DEBUG){ + System.out.println("Handling new line:"+row); + } + lineBuffer.clear(); char c = cs[currIndex]; *************** *** 202,205 **** --- 221,225 ---- startMethod(getNextIdentifier(c), row, startMethodCol); } + currIndex --; } |
From: Fabio Z. <fa...@us...> - 2008-07-02 20:38:31
|
Update of /cvsroot/pydev/org.python.pydev.parser/tests/org/python/pydev/parser/fastparser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27516/tests/org/python/pydev/parser/fastparser Modified Files: FastDefinitionsParserTest.java Log Message: Checking line and column on definitions parser Index: FastDefinitionsParserTest.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.parser/tests/org/python/pydev/parser/fastparser/FastDefinitionsParserTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FastDefinitionsParserTest.java 2 Jul 2008 20:18:53 -0000 1.2 --- FastDefinitionsParserTest.java 2 Jul 2008 20:38:39 -0000 1.3 *************** *** 27,31 **** FastDefinitionsParserTest test = new FastDefinitionsParserTest(); test.setUp(); ! test.testDefinitionsParser9(); // Timer timer = new Timer(); // test.parseFilesInDir(new File("D:/bin/Python251/Lib/site-packages/wx-2.8-msw-unicode"), true); --- 27,31 ---- FastDefinitionsParserTest test = new FastDefinitionsParserTest(); test.setUp(); ! test.testDefinitionsParser11(); // Timer timer = new Timer(); // test.parseFilesInDir(new File("D:/bin/Python251/Lib/site-packages/wx-2.8-msw-unicode"), true); *************** *** 105,108 **** --- 105,109 ---- assertEquals(2, m.body.length); ClassDef classDef = (ClassDef)m.body[0]; + assertEquals("Bar", ((NameTok)classDef.name).id); *************** *** 123,126 **** --- 124,130 ---- assertEquals(2, m.body.length); ClassDef classDefBar = (ClassDef)m.body[0]; + assertEquals(1, classDefBar.beginColumn); + assertEquals(1, classDefBar.beginLine); + assertEquals("Bar", ((NameTok)classDefBar.name).id); *************** *** 146,149 **** --- 150,156 ---- ClassDef classDefBar = (ClassDef)m.body[0]; + assertEquals(1, classDefBar.beginColumn); + assertEquals(1, classDefBar.beginLine); + assertEquals("Bar", ((NameTok)classDefBar.name).id); ClassDef classDefZoo = (ClassDef)classDefBar.body[0]; *************** *** 172,175 **** --- 179,185 ---- assertEquals(2, m.body.length); ClassDef classDefBar = (ClassDef)m.body[0]; + assertEquals(1, classDefBar.beginColumn); + assertEquals(1, classDefBar.beginLine); + assertEquals("Bar", ((NameTok)classDefBar.name).id); assertEquals("mGlobal", ((NameTok)((FunctionDef)m.body[1]).name).id); *************** *** 195,198 **** --- 205,211 ---- assertEquals(2, m.body.length); ClassDef classDefBar = (ClassDef)m.body[0]; + assertEquals(1, classDefBar.beginColumn); + assertEquals(1, classDefBar.beginLine); + assertEquals("Bar", ((NameTok)classDefBar.name).id); assertEquals("mGlobal", ((NameTok)((FunctionDef)m.body[1]).name).id); *************** *** 207,210 **** --- 220,258 ---- + public void testDefinitionsParser11() { + Module m = (Module) FastDefinitionsParser.parse( + "class Bar(object):\n" + + " class \tZoo\t(object):\n" + + " def m1(self):pass\n"+ + " def m2(self):pass\n"+ + " #def m3(self):pass\n"+ + " 'string'\n"+ + "def mGlobal(self):pass\n" + ); + assertEquals(2, m.body.length); + ClassDef classDefBar = (ClassDef)m.body[0]; + assertEquals(1, classDefBar.beginColumn); + assertEquals(1, classDefBar.beginLine); + + assertEquals("Bar", ((NameTok)classDefBar.name).id); + FunctionDef defGlobal = (FunctionDef)m.body[1]; + assertEquals("mGlobal", ((NameTok)(defGlobal).name).id); + assertEquals(1, defGlobal.beginColumn); + assertEquals(7, defGlobal.beginLine); + + ClassDef classDefZoo = (ClassDef)classDefBar.body[0]; + assertEquals("Zoo", ((NameTok)classDefZoo.name).id); + assertEquals(5, classDefZoo.beginColumn); + assertEquals(2, classDefZoo.beginLine); + + assertEquals(2, classDefZoo.body.length); + FunctionDef defM1 = (FunctionDef)classDefZoo.body[0]; + assertEquals("m1", ((NameTok)(defM1).name).id); + assertEquals(9, defM1.beginColumn); + assertEquals(3, defM1.beginLine); + + } + + public void testDefinitionsParser10() { Module m = (Module) FastDefinitionsParser.parse( |
From: Fabio Z. <fa...@us...> - 2008-07-02 20:18:45
|
Update of /cvsroot/pydev/org.python.pydev.parser/src/org/python/pydev/parser/fastparser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20236/src/org/python/pydev/parser/fastparser Modified Files: FastDefinitionsParser.java Log Message: Creating a way to make a fast parse of a file to get classes, methods and attributes. Index: FastDefinitionsParser.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.parser/src/org/python/pydev/parser/fastparser/FastDefinitionsParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FastDefinitionsParser.java 23 Jun 2008 01:20:53 -0000 1.1 --- FastDefinitionsParser.java 2 Jul 2008 20:18:53 -0000 1.2 *************** *** 1,5 **** --- 1,16 ---- package org.python.pydev.parser.fastparser; + import java.util.ArrayList; + import java.util.List; + import org.python.pydev.core.docutils.ParsingUtils; + import org.python.pydev.core.structure.FastStack; + import org.python.pydev.core.structure.FastStringBuffer; + import org.python.pydev.parser.jython.SimpleNode; + import org.python.pydev.parser.jython.ast.ClassDef; + import org.python.pydev.parser.jython.ast.FunctionDef; + import org.python.pydev.parser.jython.ast.Module; + import org.python.pydev.parser.jython.ast.NameTok; + import org.python.pydev.parser.jython.ast.stmtType; /** *************** *** 8,12 **** * This class should be able to gather the definitions found in a module in a very fast way. * ! * The target is having a performance around 10x faster than doing a regular parse, focusing on getting * the name tokens for: * --- 19,23 ---- * This class should be able to gather the definitions found in a module in a very fast way. * ! * The target is having a performance around 5x faster than doing a regular parse, focusing on getting * the name tokens for: * *************** *** 17,48 **** */ public class FastDefinitionsParser { ! public static void parse(String cs) { ! char lastChar = '\0'; ! int length = cs.length(); ! for (int i = 0; i < length; i++) { ! char c = cs.charAt(i); - if (c == '\'' || c == '"') { - //go to the end of the literal - i = ParsingUtils.getLiteralEnd(cs, i, c); ! } else if (c == '#') { ! //go to the end of the comment ! while(i < length && (c = cs.charAt(i)) != '\n' && c != '\r'){ ! i++; ! } ! } else { ! //skip the line ! if (c == '\r' || c == '\n') { ! while(i < length && (c = cs.charAt(i)) == '\n' || c == '\r'){ ! i++; } } } - lastChar = c; } } --- 28,362 ---- */ public class FastDefinitionsParser { + + /** + * Set and kept in the constructor + */ + + /** + * The chars we should iterate through. + */ + final private char[] cs; + + /** + * The length of the buffer we're iterating. + */ + final private int length; + + /** + * Last char we found + */ + private char lastChar = '\n'; + + /** + * Current iteration index + */ + private int currIndex = 0; + + /** + * The current column + */ + private int col = 1; + + /** + * The current row + */ + private int row = 0; + + /** + * The column where the 1st char was found + */ + private int firstCharCol = 1; + + /** + * Holds things added to the 'global' module + */ + private final ArrayList<stmtType> body = new ArrayList<stmtType>(); + + /** + * Holds a stack of classes so that we create a new one in each new scope to be filled and when the scope is ended, + * it should have its body filled with the stackBody contents related to each + */ + private final FastStack<ClassDef> stack = new FastStack<ClassDef>(); + + /** + * For each item in the stack, there's a stackBody that has the contents to be added later to that class. + */ + private final FastStack<List<stmtType>> stackBody = new FastStack<List<stmtType>>(); ! /** ! * Buffer with the contents of a line. ! */ ! private final FastStringBuffer lineBuffer = new FastStringBuffer(); ! ! /** ! * Constructor ! * ! * @param cs array of chars that should be filled. ! */ ! private FastDefinitionsParser(char[] cs){ ! this.cs = cs; ! this.length = cs.length; ! } ! ! ! /** ! * This is the method that actually extracts things from the passed buffer. ! */ ! private void extractBody() { ! if(currIndex < length){ ! handleNewLine(); ! } ! for (;currIndex < length; currIndex++, col++) { ! char c = cs[currIndex]; ! ! switch (c){ ! ! case '\'': ! case '"': ! //go to the end of the literal ! currIndex = ParsingUtils.getLiteralEnd(cs, currIndex, c); ! break; ! ! ! ! case '#': ! //go to the end of the comment ! currIndex++; ! OUT: ! while(currIndex < length){ ! c = cs[currIndex]; ! currIndex++; ! switch(c){ ! case '\r': ! if(currIndex < length-1 && cs[currIndex+1] == '\n'){ ! currIndex++; ! } ! /*FALLTHROUGH**/ ! case '\n': ! break OUT; ! } ! } ! ! //after a comment, we'll always be in a new line ! currIndex++; ! handleNewLine(); ! ! break; ! ! ! ! case '\r': ! if(currIndex < length-1 && cs[currIndex+1] == '\n'){ ! currIndex++; ! } ! /*FALLTHROUGH**/ ! case '\n': ! currIndex++; ! handleNewLine(); ! ! break; ! ! //No default ! ! } ! lineBuffer.append(c); ! lastChar = c; ! } ! ! while(stack.size() > 0){ ! endScope(); ! } ! } ! ! ! private void handleNewLine() { ! if(currIndex >= length-1){ ! return; ! } ! ! col = 0; ! row ++; ! lineBuffer.clear(); ! char c = cs[currIndex]; ! ! while(currIndex < length-1 && Character.isWhitespace(c) && c != '\r' && c != '\n'){ ! currIndex ++; ! col++; ! c = cs[currIndex]; ! } ! ! ! if (c == 'c' && matchClass()){ ! int startClassCol = col; ! currIndex += 6; ! col += 6; ! ! startClass(getNextIdentifier(c), row, startClassCol); ! ! }else if (c == 'd' && matchFunction()){ ! int startMethodCol = col; ! currIndex += 4; ! col += 4; ! ! startMethod(getNextIdentifier(c), row, startMethodCol); ! } ! } ! /** ! * Get the next identifier available. ! * @param c the current char ! * @return the identifier found ! */ ! private String getNextIdentifier(char c) { ! c = this.cs[currIndex]; ! ! while(currIndex < length && Character.isWhitespace(c)){ ! currIndex ++; ! c = this.cs[currIndex]; ! } ! ! int currClassNameCol = currIndex; ! while(Character.isJavaIdentifierPart(c)){ ! currIndex++; ! if(currIndex >= length){ ! break; ! } ! c = this.cs[currIndex]; ! } ! return new String(this.cs, currClassNameCol, currIndex-currClassNameCol); ! } ! ! ! ! ! /** ! * Start a new method scope with the given row and column. ! * @param startMethodRow the row where the scope should start ! * @param startMethodCol the column where the scope should start ! */ ! private void startMethod(String name, int startMethodRow, int startMethodCol) { ! NameTok nameTok = new NameTok(name, NameTok.ClassName); ! FunctionDef functionDef = new FunctionDef(nameTok, null, null, null); ! functionDef.beginLine = startMethodRow; ! functionDef.beginColumn = startMethodCol; ! ! addToPertinentScope(functionDef); ! } ! ! ! ! /** ! * Start a new class scope with the given row and column. ! * @param startClassRow the row where the scope should start ! * @param startClassCol the column where the scope should start ! */ ! private void startClass(String name, int startClassRow, int startClassCol) { ! NameTok nameTok = new NameTok(name, NameTok.ClassName); ! ClassDef classDef = new ClassDef(nameTok, null, null); ! ! classDef.beginLine = startClassRow; ! classDef.beginColumn = startClassCol; ! ! stack.push(classDef); ! stackBody.push(new ArrayList<stmtType>()); ! } ! ! ! /** ! * Finish the current scope in the stack. ! * ! * May close many scopes in a single call depending on where the class should be added to. ! */ ! private void endScope(){ ! ClassDef def = stack.pop(); ! List<stmtType> body = stackBody.pop(); ! def.body = body.toArray(new stmtType[body.size()]); ! addToPertinentScope(def); ! } ! ! ! /** ! * This is the definition to be added to a given scope. ! * ! * It'll find a correct scope based on the column it has to be added to. ! * ! * @param def the definition to be added ! */ ! private void addToPertinentScope(stmtType def) { ! //see where it should be added (global or class scope) ! while(stack.size() > 0){ ! ClassDef parent = stack.peek(); ! if(parent.beginColumn < def.beginColumn){ ! List<stmtType> peek = stackBody.peek(); ! ! if(def instanceof FunctionDef){ ! int size = peek.size(); ! if(size > 0){ ! stmtType existing = peek.get(size-1); ! if(existing.beginColumn < def.beginColumn){ ! //we don't want to add a method inside a method at this point. ! //all the items added should have the same column. ! return; ! } } } + peek.add(def); + return; + }else{ + endScope(); } } + //if it still hasn't returned, add it to the global + this.body.add(def); + } + + + + /** + * @return true if we have a match for 'class' in the current index (the 'c' must be already matched at this point) + */ + private boolean matchClass(){ + if(currIndex + 5 > this.length){ + return false; + } + return (this.cs[currIndex+1] == 'l' && this.cs[currIndex+2] == 'a' && + this.cs[currIndex+3] == 's' && this.cs[currIndex+4] == 's' && Character.isWhitespace(this.cs[currIndex+5])); + } + + + /** + * @return true if we have a match for 'def' in the current index (the 'd' must be already matched at this point) + */ + private boolean matchFunction(){ + if(currIndex + 3 > this.length){ + return false; + } + return (this.cs[currIndex+1] == 'e' && this.cs[currIndex+2] == 'f' && Character.isWhitespace(this.cs[currIndex+3])); + } + + + /** + * Convenience method for parse(s.toCharArray()) + * @param s the string to be parsed + * @return a Module node with the structure found + */ + public static SimpleNode parse(String s) { + return parse(s.toCharArray()); + } + + + /** + * This method will parse the char array passed and will build a structure with the contents of the file. + * @param cs the char array to be parsed + * @return a Module node with the structure found + */ + public static SimpleNode parse(char[] cs) { + FastDefinitionsParser parser = new FastDefinitionsParser(cs); + parser.extractBody(); + List<stmtType> body = parser.body; + return new Module(body.toArray(new stmtType[body.size()])); } |
From: Fabio Z. <fa...@us...> - 2008-07-02 20:18:45
|
Update of /cvsroot/pydev/org.python.pydev.parser/tests/org/python/pydev/parser/fastparser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20236/tests/org/python/pydev/parser/fastparser Modified Files: FastDefinitionsParserTest.java Log Message: Creating a way to make a fast parse of a file to get classes, methods and attributes. Index: FastDefinitionsParserTest.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.parser/tests/org/python/pydev/parser/fastparser/FastDefinitionsParserTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FastDefinitionsParserTest.java 23 Jun 2008 01:20:53 -0000 1.1 --- FastDefinitionsParserTest.java 2 Jul 2008 20:18:53 -0000 1.2 *************** *** 1,6 **** --- 1,15 ---- package org.python.pydev.parser.fastparser; + import java.io.File; + import junit.framework.TestCase; + import org.python.pydev.core.REF; + import org.python.pydev.core.performanceeval.Timer; + import org.python.pydev.parser.jython.ast.ClassDef; + import org.python.pydev.parser.jython.ast.FunctionDef; + import org.python.pydev.parser.jython.ast.Module; + import org.python.pydev.parser.jython.ast.NameTok; + public class FastDefinitionsParserTest extends TestCase { *************** *** 18,23 **** FastDefinitionsParserTest test = new FastDefinitionsParserTest(); test.setUp(); ! test.testDefinitionsParser(); test.tearDown(); junit.textui.TestRunner.run(FastDefinitionsParserTest.class); --- 27,39 ---- FastDefinitionsParserTest test = new FastDefinitionsParserTest(); test.setUp(); ! test.testDefinitionsParser9(); ! // Timer timer = new Timer(); ! // test.parseFilesInDir(new File("D:/bin/Python251/Lib/site-packages/wx-2.8-msw-unicode"), true); ! // test.parseFilesInDir(new File("D:/bin/Python251/Lib/"), false); ! // timer.printDiff(); ! test.tearDown(); + + junit.textui.TestRunner.run(FastDefinitionsParserTest.class); *************** *** 28,34 **** public void testDefinitionsParser() { ! FastDefinitionsParser.parse("class Bar:pass"); } } --- 44,219 ---- + + /** + * @param file + */ + private void parseFilesInDir(File file, boolean recursive) { + assertTrue("Directory "+file+" does not exist", file.exists()); + assertTrue(file.isDirectory()); + + File[] files = file.listFiles(); + for (int i = 0; i < files.length; i++) { + File f = files[i]; + if(f.getAbsolutePath().toLowerCase().endsWith(".py")){ + String fileContents = REF.getFileContents(f); + FastDefinitionsParser.parse(fileContents); + + }else if(recursive && f.isDirectory()){ + parseFilesInDir(f, recursive); + } + } + } + + public void testDefinitionsParser() { ! Module m = (Module) FastDefinitionsParser.parse("class Bar:pass"); ! assertEquals(1, m.body.length); ! assertEquals("Bar", ((NameTok)((ClassDef)m.body[0]).name).id); } + + public void testDefinitionsParser2() { + Module m = (Module) FastDefinitionsParser.parse("class Bar"); + assertEquals(1, m.body.length); + assertEquals("Bar", ((NameTok)((ClassDef)m.body[0]).name).id); + } + + public void testDefinitionsParser3() { + Module m = (Module) FastDefinitionsParser.parse("class Bar(object):pass"); + assertEquals(1, m.body.length); + assertEquals("Bar", ((NameTok)((ClassDef)m.body[0]).name).id); + } + + public void testDefinitionsParser4() { + Module m = (Module) FastDefinitionsParser.parse( + "class Bar(object):\n" + + " def m1(self):pass" + ); + assertEquals(1, m.body.length); + ClassDef classDef = (ClassDef)m.body[0]; + assertEquals("Bar", ((NameTok)classDef.name).id); + + FunctionDef funcDef = (FunctionDef)classDef.body[0]; + assertEquals("m1", ((NameTok)funcDef.name).id); + } + + public void testDefinitionsParser5() { + Module m = (Module) FastDefinitionsParser.parse( + "class Bar(object):\n" + + " def m1(self):pass\n"+ + "def m2(self):pass\n" + ); + assertEquals(2, m.body.length); + ClassDef classDef = (ClassDef)m.body[0]; + assertEquals("Bar", ((NameTok)classDef.name).id); + + FunctionDef funcDef = (FunctionDef)classDef.body[0]; + assertEquals("m1", ((NameTok)funcDef.name).id); + + funcDef = (FunctionDef)m.body[1]; + assertEquals("m2", ((NameTok)funcDef.name).id); + } + + public void testDefinitionsParser6() { + Module m = (Module) FastDefinitionsParser.parse( + "class Bar(object):\n" + + " class Zoo(object):\n" + + " def m1(self):pass\n"+ + "def m2(self):pass\n" + ); + assertEquals(2, m.body.length); + ClassDef classDefBar = (ClassDef)m.body[0]; + assertEquals("Bar", ((NameTok)classDefBar.name).id); + + ClassDef classDefZoo = (ClassDef)classDefBar.body[0]; + assertEquals("Zoo", ((NameTok)classDefZoo.name).id); + + assertEquals("m1", ((NameTok)((FunctionDef)classDefZoo.body[0]).name).id); + + assertEquals("m2", ((NameTok)((FunctionDef)m.body[1]).name).id); + } + + public void testDefinitionsParser7() { + Module m = (Module) FastDefinitionsParser.parse( + "class Bar(object):\n" + + " class Zoo(object):\n" + + " class PPP(self):pass\n"+ + + "class Bar2(object):\n" + + " class Zoo2(object):\n" + + " class PPP2(self):pass\n" + ); + assertEquals(2, m.body.length); + + ClassDef classDefBar = (ClassDef)m.body[0]; + assertEquals("Bar", ((NameTok)classDefBar.name).id); + ClassDef classDefZoo = (ClassDef)classDefBar.body[0]; + assertEquals("Zoo", ((NameTok)classDefZoo.name).id); + assertEquals("PPP", ((NameTok)((ClassDef)classDefZoo.body[0]).name).id); + + //check the 2nd leaf + classDefBar = (ClassDef)m.body[1]; + assertEquals("Bar2", ((NameTok)classDefBar.name).id); + classDefZoo = (ClassDef)classDefBar.body[0]; + assertEquals("Zoo2", ((NameTok)classDefZoo.name).id); + assertEquals("PPP2", ((NameTok)((ClassDef)classDefZoo.body[0]).name).id); + } + + + + public void testDefinitionsParser8() { + Module m = (Module) FastDefinitionsParser.parse( + "class Bar(object):\n" + + " class Zoo(object):\n" + + " def m1(self):pass\n"+ + " def m2(self):pass\n"+ + " def m3(self):pass\n"+ + "def mGlobal(self):pass\n" + ); + assertEquals(2, m.body.length); + ClassDef classDefBar = (ClassDef)m.body[0]; + assertEquals("Bar", ((NameTok)classDefBar.name).id); + assertEquals("mGlobal", ((NameTok)((FunctionDef)m.body[1]).name).id); + + ClassDef classDefZoo = (ClassDef)classDefBar.body[0]; + assertEquals("Zoo", ((NameTok)classDefZoo.name).id); + + assertEquals(2, classDefZoo.body.length); + assertEquals("m1", ((NameTok)((FunctionDef)classDefZoo.body[0]).name).id); + + } + + + public void testDefinitionsParser9() { + Module m = (Module) FastDefinitionsParser.parse( + "class Bar(object):\n" + + " class \tZoo\t(object):\n" + + " def m1(self):pass\n"+ + " def m2(self):pass\n"+ + " def m3(self):pass\n"+ + "def mGlobal(self):pass\n" + ); + assertEquals(2, m.body.length); + ClassDef classDefBar = (ClassDef)m.body[0]; + assertEquals("Bar", ((NameTok)classDefBar.name).id); + assertEquals("mGlobal", ((NameTok)((FunctionDef)m.body[1]).name).id); + + ClassDef classDefZoo = (ClassDef)classDefBar.body[0]; + assertEquals("Zoo", ((NameTok)classDefZoo.name).id); + + assertEquals(2, classDefZoo.body.length); + assertEquals("m1", ((NameTok)((FunctionDef)classDefZoo.body[0]).name).id); + + } + + + public void testDefinitionsParser10() { + Module m = (Module) FastDefinitionsParser.parse( + "" //empty + ); + assertEquals(0, m.body.length); + } + + + } |
From: Fabio Z. <fa...@us...> - 2008-07-02 20:18:45
|
Update of /cvsroot/pydev/org.python.pydev.parser/src/org/python/pydev/parser/jython In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20236/src/org/python/pydev/parser/jython Modified Files: FastCharStream.java Log Message: Creating a way to make a fast parse of a file to get classes, methods and attributes. Index: FastCharStream.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.parser/src/org/python/pydev/parser/jython/FastCharStream.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** FastCharStream.java 7 Sep 2006 13:16:04 -0000 1.7 --- FastCharStream.java 2 Jul 2008 20:18:52 -0000 1.8 *************** *** 5,9 **** /** * An implementation of interface CharStream, where the data is read from a Reader. Completely recreated so that we can read data directly from a String, as the ! * initial implementation was highly inneficient when working only with a string (actually, if it was small, there would be no noticeable * delays, but if it became big, then the improvement would be HUGE). * --- 5,9 ---- /** * An implementation of interface CharStream, where the data is read from a Reader. Completely recreated so that we can read data directly from a String, as the ! * initial implementation was highly inefficient when working only with a string (actually, if it was small, there would be no noticeable * delays, but if it became big, then the improvement would be HUGE). * |
From: Fabio Z. <fa...@us...> - 2008-06-30 00:28:59
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5832 Modified Files: Changes.txt plugin.xml Log Message: Linking working in the compare editor bug: https://sourceforge.net/tracker/index.php?func=detail&aid=2002654&group_id=85796&atid=577329 Index: Changes.txt =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/Changes.txt,v retrieving revision 1.402 retrieving revision 1.403 diff -C2 -d -r1.402 -r1.403 *** Changes.txt 29 Jun 2008 23:11:22 -0000 1.402 --- Changes.txt 30 Jun 2008 00:29:06 -0000 1.403 *************** *** 13,16 **** --- 13,17 ---- <li><strong>Eclipse 3.4</strong>: Hyperlinks working</li> <li><strong>raw_input() and input()</strong>: functions are now changed when a program is launched from eclipse to consider a trailing '\r'</li> + <li><strong>Pydev package explorer</strong>: Link working with compare editor</li> </ul> Index: plugin.xml =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/plugin.xml,v retrieving revision 1.207 retrieving revision 1.208 diff -C2 -d -r1.207 -r1.208 *** plugin.xml 21 Jun 2008 14:31:22 -0000 1.207 --- plugin.xml 30 Jun 2008 00:29:06 -0000 1.208 *************** *** 1360,1364 **** </selectionEnablement> <editorInputEnablement> ! <instanceof value="org.eclipse.ui.IFileEditorInput"/> </editorInputEnablement> </linkHelper> --- 1360,1365 ---- </selectionEnablement> <editorInputEnablement> ! <!-- Not using org.eclipse.ui.IFileEditorInput so that we can match the CompareEditorInput --> ! <instanceof value="org.eclipse.ui.IEditorInput"/> </editorInputEnablement> </linkHelper> |
From: Fabio Z. <fa...@us...> - 2008-06-30 00:28:59
|
Update of /cvsroot/pydev/org.python.pydev/src_navigator/org/python/pydev/navigator/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5832/src_navigator/org/python/pydev/navigator/actions Modified Files: PythonLinkHelper.java Log Message: Linking working in the compare editor bug: https://sourceforge.net/tracker/index.php?func=detail&aid=2002654&group_id=85796&atid=577329 Index: PythonLinkHelper.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src_navigator/org/python/pydev/navigator/actions/PythonLinkHelper.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PythonLinkHelper.java 7 Jul 2007 12:06:02 -0000 1.2 --- PythonLinkHelper.java 30 Jun 2008 00:29:06 -0000 1.3 *************** *** 6,9 **** --- 6,10 ---- import org.eclipse.core.resources.IFile; + import org.eclipse.core.runtime.IAdaptable; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.StructuredSelection; *************** *** 27,30 **** --- 28,39 ---- return new StructuredSelection(((IFileEditorInput) anInput).getFile()); } + if(anInput instanceof IAdaptable){ + //handles org.eclipse.compare.CompareEditorInput without a specific reference to it + Object adapter = anInput.getAdapter(IFile.class); + if(adapter != null){ + return new StructuredSelection(adapter); + } + } + return StructuredSelection.EMPTY; } |
From: Fabio Z. <fa...@us...> - 2008-06-29 23:11:15
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9078 Modified Files: Changes.txt Log Message: <li><strong>raw_input() and input()</strong>: functions are now changed when a program is launched from eclipse to consider a trailing '\r'</li> Index: Changes.txt =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/Changes.txt,v retrieving revision 1.401 retrieving revision 1.402 diff -C2 -d -r1.401 -r1.402 *** Changes.txt 29 Jun 2008 22:48:18 -0000 1.401 --- Changes.txt 29 Jun 2008 23:11:22 -0000 1.402 *************** *** 12,15 **** --- 12,16 ---- <li><strong>Eclipse 3.2</strong>: Interactive console working / fixed some incompatibilities</li> <li><strong>Eclipse 3.4</strong>: Hyperlinks working</li> + <li><strong>raw_input() and input()</strong>: functions are now changed when a program is launched from eclipse to consider a trailing '\r'</li> </ul> |
From: Fabio Z. <fa...@us...> - 2008-06-29 23:11:15
|
Update of /cvsroot/pydev/org.python.pydev/PySrc/pydev_sitecustomize In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9078/PySrc/pydev_sitecustomize Modified Files: sitecustomize.py Log Message: <li><strong>raw_input() and input()</strong>: functions are now changed when a program is launched from eclipse to consider a trailing '\r'</li> Index: sitecustomize.py =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/PySrc/pydev_sitecustomize/sitecustomize.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sitecustomize.py 28 Apr 2008 23:03:41 -0000 1.2 --- sitecustomize.py 29 Jun 2008 23:11:22 -0000 1.3 *************** *** 1,5 **** ''' ! This module will set the default encoding for python so that it'll print things correctly to the console. ! (and then will execute the user site customize -- if available) ''' --- 1,8 ---- ''' ! This module will: ! - set the default encoding for python so that it'll print things correctly to the console. ! - change the input() and raw_input() commands to change \r\n or \r into \n ! - execute the user site customize -- if available ! - change raw_input() and input() to also remove any trailing \r ''' *************** *** 11,16 **** - - #----------------------------------------------------------------------------------------------------------------------- #check if the encoding has been specified for this launch... --- 14,17 ---- *************** *** 105,106 **** --- 106,144 ---- pass + + + + + try: + #Redefine input and raw_input only after the original sitecustomize was executed + #(because otherwise, the original raw_input and input would still not be defined) + import __builtin__ + original_raw_input = __builtin__.raw_input + original_input = __builtin__.input + + + def raw_input(prompt=''): + #the original raw_input would only remove a trailing \n, so, at + #this point if we had a \r\n the \r would remain (which is valid for eclipse) + #so, let's remove the remaining \r which python didn't expect. + ret = original_raw_input(prompt) + + if ret.endswith('\r'): + return ret[:-1] + + return ret + raw_input.__doc__ = original_raw_input.__doc__ + + def input(prompt=''): + #input must also be rebinded for using the new raw_input defined + return eval(raw_input(prompt)) + input.__doc__ = original_input.__doc__ + + + __builtin__.raw_input = raw_input + __builtin__.input = input + except: + #Don't report errors at this stage + if DEBUG: + import traceback;traceback.print_exc() #@Reimport + |
From: Fabio Z. <fa...@us...> - 2008-06-29 22:48:10
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2212 Modified Files: Changes.txt Log Message: Index: Changes.txt =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/Changes.txt,v retrieving revision 1.400 retrieving revision 1.401 diff -C2 -d -r1.400 -r1.401 *** Changes.txt 29 Jun 2008 22:45:28 -0000 1.400 --- Changes.txt 29 Jun 2008 22:48:18 -0000 1.401 *************** *** 4,7 **** --- 4,8 ---- <ul> <li><strong>Code Analysis</strong>: Not all unused imports are shown in the message anymore (could give problems saving workspace).</li> + <li><strong>Code Analysis</strong>: Fixed problem on double cycle in list comprehension.</li> </ul> *************** *** 9,13 **** <ul> <li><strong>Ctr+/</strong>: Changed to toggle comment (instead of only comment) -- patch from Christoph Pickl</li> ! <li><strong>Eclipse 3.2</strong>: Readded support for Eclipse 3.2 (mostly for Aptana support)</li> <li><strong>Eclipse 3.4</strong>: Hyperlinks working</li> </ul> --- 10,14 ---- <ul> <li><strong>Ctr+/</strong>: Changed to toggle comment (instead of only comment) -- patch from Christoph Pickl</li> ! <li><strong>Eclipse 3.2</strong>: Interactive console working / fixed some incompatibilities</li> <li><strong>Eclipse 3.4</strong>: Hyperlinks working</li> </ul> |
From: Fabio Z. <fa...@us...> - 2008-06-29 22:45:22
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/hyperlink In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1099/src/org/python/pydev/editor/hyperlink Modified Files: PythonElementHyperlinkDetector.java Log Message: Hyperlinks working for eclipse 3.4 Index: PythonElementHyperlinkDetector.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/hyperlink/PythonElementHyperlinkDetector.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PythonElementHyperlinkDetector.java 4 Feb 2008 02:01:35 -0000 1.1 --- PythonElementHyperlinkDetector.java 29 Jun 2008 22:45:28 -0000 1.2 *************** *** 24,28 **** public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) { ITextEditor textEditor = (ITextEditor) getAdapter(ITextEditor.class); ! if (region == null || canShowMultipleHyperlinks || !(textEditor instanceof PyEdit)) { return null; } --- 24,28 ---- public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) { ITextEditor textEditor = (ITextEditor) getAdapter(ITextEditor.class); ! if (region == null || !(textEditor instanceof PyEdit)) { return null; } |
From: Fabio Z. <fa...@us...> - 2008-06-29 22:45:21
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1099 Modified Files: Changes.txt Log Message: Hyperlinks working for eclipse 3.4 Index: Changes.txt =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/Changes.txt,v retrieving revision 1.399 retrieving revision 1.400 diff -C2 -d -r1.399 -r1.400 *** Changes.txt 28 Jun 2008 12:35:38 -0000 1.399 --- Changes.txt 29 Jun 2008 22:45:28 -0000 1.400 *************** *** 1,8 **** --- 1,14 ---- after 1.3.18 + Pydev Extensions + <ul> + <li><strong>Code Analysis</strong>: Not all unused imports are shown in the message anymore (could give problems saving workspace).</li> + </ul> + Pydev <ul> <li><strong>Ctr+/</strong>: Changed to toggle comment (instead of only comment) -- patch from Christoph Pickl</li> <li><strong>Eclipse 3.2</strong>: Readded support for Eclipse 3.2 (mostly for Aptana support)</li> + <li><strong>Eclipse 3.4</strong>: Hyperlinks working</li> </ul> |
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/ui/wizards/project In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16654/src/org/python/pydev/ui/wizards/project Modified Files: PythonProjectWizard.java CopiedWizardNewProjectNameAndLocationPage.java Added Files: IWizardNewProjectNameAndLocationPage.java Log Message: Applied patch: Make PythonProjectWizard more suitable as a base https://sourceforge.net/tracker/index.php?func=detail&aid=2005178&group_id=85796&atid=577329 Index: CopiedWizardNewProjectNameAndLocationPage.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/ui/wizards/project/CopiedWizardNewProjectNameAndLocationPage.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CopiedWizardNewProjectNameAndLocationPage.java 24 Sep 2007 23:14:21 -0000 1.4 --- CopiedWizardNewProjectNameAndLocationPage.java 29 Jun 2008 14:48:25 -0000 1.5 *************** *** 58,62 **** */ ! public class CopiedWizardNewProjectNameAndLocationPage extends WizardPage implements SelectionListener { // Whether to use default or custom project location private boolean useDefaults = true; --- 58,64 ---- */ ! public class CopiedWizardNewProjectNameAndLocationPage extends WizardPage implements SelectionListener, ! IWizardNewProjectNameAndLocationPage ! { // Whether to use default or custom project location private boolean useDefaults = true; *************** *** 112,115 **** --- 114,119 ---- public CopiedWizardNewProjectNameAndLocationPage(String pageName) { super(pageName); + setTitle("Pydev Project"); + setDescription("Create a new Pydev Project."); setPageComplete(false); initialLocationFieldValue = Platform.getLocation(); *************** *** 305,309 **** * if no project location path is known */ ! /* package */IPath getLocationPath() { if (useDefaults) return initialLocationFieldValue; --- 309,313 ---- * if no project location path is known */ ! public IPath getLocationPath() { if (useDefaults) return initialLocationFieldValue; *************** *** 321,325 **** * @return the new project resource handle */ ! /* package */IProject getProjectHandle() { return ResourcesPlugin.getWorkspace().getRoot().getProject( getProjectName()); --- 325,329 ---- * @return the new project resource handle */ ! public IProject getProjectHandle() { return ResourcesPlugin.getWorkspace().getRoot().getProject( getProjectName()); Index: PythonProjectWizard.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/ui/wizards/project/PythonProjectWizard.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PythonProjectWizard.java 19 Mar 2007 01:21:01 -0000 1.6 --- PythonProjectWizard.java 29 Jun 2008 14:48:25 -0000 1.7 *************** *** 62,66 **** WelcomePage welcomePage = new WelcomePage("Creating a new modelled Python Project"); ! CopiedWizardNewProjectNameAndLocationPage projectPage = new CopiedWizardNewProjectNameAndLocationPage("Setting project properties"); WizardNewProjectReferencePage referencePage; --- 62,66 ---- WelcomePage welcomePage = new WelcomePage("Creating a new modelled Python Project"); ! IWizardNewProjectNameAndLocationPage projectPage; WizardNewProjectReferencePage referencePage; *************** *** 78,81 **** --- 78,89 ---- this.selection = currentSelection; initializeDefaultPageImageDescriptor(); + projectPage = createProjectPage(); + } + + /** + * Creates the project page. + */ + protected IWizardNewProjectNameAndLocationPage createProjectPage(){ + return new CopiedWizardNewProjectNameAndLocationPage("Setting project properties"); } *************** *** 91,94 **** --- 99,109 ---- } addPage(projectPage); + addProjectReferencePage(); + } + + /** + * Adds the project references page to the wizard. + */ + protected void addProjectReferencePage(){ // only add page if there are already projects in the workspace if (ResourcesPlugin.getWorkspace().getRoot().getProjects().length > 0) { *************** *** 98,102 **** this.addPage(referencePage); } - } --- 113,116 ---- *************** *** 149,153 **** * @return the created project resource, or <code>null</code> if the project was not created */ ! private IProject createNewProject() { // get a project handle final IProject newProjectHandle = projectPage.getProjectHandle(); --- 163,167 ---- * @return the created project resource, or <code>null</code> if the project was not created */ ! protected IProject createNewProject() { // get a project handle final IProject newProjectHandle = projectPage.getProjectHandle(); --- NEW FILE: IWizardNewProjectNameAndLocationPage.java --- /** * */ package org.python.pydev.ui.wizards.project; import org.eclipse.core.resources.IProject; import org.eclipse.core.runtime.IPath; import org.eclipse.jface.wizard.IWizardPage; /** * The first page in the New Project wizard must implement this interface. */ public interface IWizardNewProjectNameAndLocationPage extends IWizardPage { /** * Returns a flag indicating whether the default python src folder * should be created. */ public boolean shouldCreatSourceFolder(); /** * Returns the project type. */ public String getProjectType(); /** * Returns a handle to the new project. */ public IProject getProjectHandle(); /** * Gets the location path for the new project. */ public IPath getLocationPath(); } |
From: Fabio Z. <fa...@us...> - 2008-06-28 13:29:12
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/copiedfromeclipsesrc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32280/src/org/python/copiedfromeclipsesrc Modified Files: CopiedWorkbenchLabelProvider.java Log Message: Removing some compile errors in eclipse 3.4 Index: CopiedWorkbenchLabelProvider.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/copiedfromeclipsesrc/CopiedWorkbenchLabelProvider.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CopiedWorkbenchLabelProvider.java 21 Jan 2006 14:06:26 -0000 1.2 --- CopiedWorkbenchLabelProvider.java 28 Jun 2008 13:29:19 -0000 1.3 *************** *** 2,6 **** /******************************************************************************* ! * Copyright (c) 2000, 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 --- 2,6 ---- /******************************************************************************* ! * Copyright (c) 2000, 2008 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 *************** *** 12,17 **** *******************************************************************************/ ! import org.eclipse.core.runtime.IAdaptable; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.viewers.DecoratingLabelProvider; import org.eclipse.jface.viewers.IColorProvider; --- 12,21 ---- *******************************************************************************/ ! import org.eclipse.jface.resource.ColorDescriptor; ! import org.eclipse.jface.resource.FontDescriptor; import org.eclipse.jface.resource.ImageDescriptor; + import org.eclipse.jface.resource.JFaceResources; + import org.eclipse.jface.resource.LocalResourceManager; + import org.eclipse.jface.resource.ResourceManager; import org.eclipse.jface.viewers.DecoratingLabelProvider; import org.eclipse.jface.viewers.IColorProvider; *************** *** 25,33 **** import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.RGB; - import org.eclipse.swt.widgets.Display; import org.eclipse.ui.IEditorRegistry; import org.eclipse.ui.IPropertyListener; import org.eclipse.ui.PlatformUI; ! import org.eclipse.ui.internal.util.SWTResourceUtil; import org.eclipse.ui.model.IWorkbenchAdapter; import org.eclipse.ui.model.IWorkbenchAdapter2; --- 29,36 ---- import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.RGB; import org.eclipse.ui.IEditorRegistry; import org.eclipse.ui.IPropertyListener; import org.eclipse.ui.PlatformUI; ! import org.eclipse.ui.internal.util.Util; import org.eclipse.ui.model.IWorkbenchAdapter; import org.eclipse.ui.model.IWorkbenchAdapter2; *************** *** 40,44 **** * on the labels and icons of adaptable objects. * ! * NOTE: I JUST HATE WHEN THE SINGLE METHOD I WANT TO OVERRIDE IS DECLARED AS FINAL!!! (getText in this case) */ public class CopiedWorkbenchLabelProvider extends LabelProvider implements --- 43,47 ---- * on the labels and icons of adaptable objects. * ! * Copied just so that we can have getText and getImage overridden. */ public class CopiedWorkbenchLabelProvider extends LabelProvider implements *************** *** 50,56 **** * * @return a new <code>DecoratingLabelProvider</code> which wraps a <code> ! * new <code>WorkbenchLabelProvider</code> */ ! public static ILabelProvider getDecoratingWorkbenchLabelProvider() { return new DecoratingLabelProvider(new CopiedWorkbenchLabelProvider(), PlatformUI.getWorkbench().getDecoratorManager() --- 53,59 ---- * * @return a new <code>DecoratingLabelProvider</code> which wraps a <code> ! * new <code>CopiedWorkbenchLabelProvider</code> */ ! public static ILabelProvider getDecoratingCopiedWorkbenchLabelProvider() { return new DecoratingLabelProvider(new CopiedWorkbenchLabelProvider(), PlatformUI.getWorkbench().getDecoratorManager() *************** *** 64,73 **** */ private IPropertyListener editorRegistryListener = new IPropertyListener() { ! public void propertyChanged(Object source, int propId) { ! if (propId == IEditorRegistry.PROP_CONTENTS) { ! fireLabelProviderChanged(new LabelProviderChangedEvent(CopiedWorkbenchLabelProvider.this)); ! } ! } ! }; /** --- 67,77 ---- */ private IPropertyListener editorRegistryListener = new IPropertyListener() { ! public void propertyChanged(Object source, int propId) { ! if (propId == IEditorRegistry.PROP_CONTENTS) { ! fireLabelProviderChanged(new LabelProviderChangedEvent(CopiedWorkbenchLabelProvider.this)); ! } ! } ! }; ! private ResourceManager resourceManager; /** *************** *** 75,79 **** */ public CopiedWorkbenchLabelProvider() { ! PlatformUI.getWorkbench().getEditorRegistry().addPropertyListener(editorRegistryListener); } --- 79,84 ---- */ public CopiedWorkbenchLabelProvider() { ! PlatformUI.getWorkbench().getEditorRegistry().addPropertyListener(editorRegistryListener); ! this.resourceManager = new LocalResourceManager(JFaceResources.getResources()); } *************** *** 115,120 **** */ public void dispose() { ! PlatformUI.getWorkbench().getEditorRegistry().removePropertyListener(editorRegistryListener); ! super.dispose(); } --- 120,127 ---- */ public void dispose() { ! PlatformUI.getWorkbench().getEditorRegistry().removePropertyListener(editorRegistryListener); ! resourceManager.dispose(); ! resourceManager = null; ! super.dispose(); } *************** *** 127,135 **** */ protected final IWorkbenchAdapter getAdapter(Object o) { ! if (!(o instanceof IAdaptable)) { ! return null; ! } ! return (IWorkbenchAdapter) ((IAdaptable) o) ! .getAdapter(IWorkbenchAdapter.class); } --- 134,138 ---- */ protected final IWorkbenchAdapter getAdapter(Object o) { ! return (IWorkbenchAdapter)Util.getAdapter(o, IWorkbenchAdapter.class); } *************** *** 142,150 **** */ protected final IWorkbenchAdapter2 getAdapter2(Object o) { ! if (!(o instanceof IAdaptable)) { ! return null; ! } ! return (IWorkbenchAdapter2) ((IAdaptable) o) ! .getAdapter(IWorkbenchAdapter2.class); } --- 145,149 ---- */ protected final IWorkbenchAdapter2 getAdapter2(Object o) { ! return (IWorkbenchAdapter2)Util.getAdapter(o, IWorkbenchAdapter2.class); } *************** *** 166,175 **** descriptor = decorateImage(descriptor, element); ! Image image = (Image) SWTResourceUtil.getImageTable().get(descriptor); ! if (image == null) { ! image = descriptor.createImage(); ! SWTResourceUtil.getImageTable().put(descriptor, image); ! } ! return image; } --- 165,169 ---- descriptor = decorateImage(descriptor, element); ! return resourceManager.createImage(descriptor); } *************** *** 217,226 **** } ! Font font = (Font) SWTResourceUtil.getFontTable().get(descriptor); ! if (font == null) { ! font = new Font(Display.getCurrent(), descriptor); ! SWTResourceUtil.getFontTable().put(descriptor, font); ! } ! return font; } --- 211,215 ---- } ! return resourceManager.createFont(FontDescriptor.createFrom(descriptor)); } *************** *** 236,245 **** } ! Color color = (Color) SWTResourceUtil.getColorTable().get(descriptor); ! if (color == null) { ! color = new Color(Display.getCurrent(), descriptor); ! SWTResourceUtil.getColorTable().put(descriptor, color); ! } ! return color; } } --- 225,229 ---- } ! return resourceManager.createColor(ColorDescriptor.createFrom(descriptor)); } } |
From: Fabio Z. <fa...@us...> - 2008-06-28 13:29:12
|
Update of /cvsroot/pydev/org.python.pydev/tests/org/python/pydev/eclipseresourcestubs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32280/tests/org/python/pydev/eclipseresourcestubs Modified Files: FileResourceStub.java Log Message: Removing some compile errors in eclipse 3.4 Index: FileResourceStub.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/tests/org/python/pydev/eclipseresourcestubs/FileResourceStub.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FileResourceStub.java 27 May 2007 22:27:41 -0000 1.4 --- FileResourceStub.java 28 Jun 2008 13:29:20 -0000 1.5 *************** *** 9,12 **** --- 9,13 ---- import java.io.Reader; import java.net.URI; + import java.util.Map; import org.eclipse.core.resources.IContainer; *************** *** 411,414 **** --- 412,440 ---- } + public Map getPersistentProperties() throws CoreException { + // TODO Auto-generated method stub + return null; + } + + public Map getSessionProperties() throws CoreException { + // TODO Auto-generated method stub + return null; + } + + public boolean isDerived(int options) { + // TODO Auto-generated method stub + return false; + } + + public boolean isHidden() { + // TODO Auto-generated method stub + return false; + } + + public void setHidden(boolean isHidden) throws CoreException { + // TODO Auto-generated method stub + + } + } |
From: Fabio Z. <fa...@us...> - 2008-06-28 13:29:12
|
Update of /cvsroot/pydev/org.python.pydev/tests_navigator/org/python/pydev/navigator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32280/tests_navigator/org/python/pydev/navigator Modified Files: FolderStub.java ProjectStub.java FileStub.java WorkspaceRootStub.java Log Message: Removing some compile errors in eclipse 3.4 Index: FolderStub.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/tests_navigator/org/python/pydev/navigator/FolderStub.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FolderStub.java 8 Jul 2007 13:21:09 -0000 1.4 --- FolderStub.java 28 Jun 2008 13:29:19 -0000 1.5 *************** *** 3,6 **** --- 3,7 ---- import java.io.File; import java.net.URI; + import java.util.Map; import org.eclipse.core.resources.IContainer; *************** *** 493,495 **** --- 494,521 ---- } + public Map getPersistentProperties() throws CoreException { + // TODO Auto-generated method stub + return null; + } + + public Map getSessionProperties() throws CoreException { + // TODO Auto-generated method stub + return null; + } + + public boolean isDerived(int options) { + // TODO Auto-generated method stub + return false; + } + + public boolean isHidden() { + // TODO Auto-generated method stub + return false; + } + + public void setHidden(boolean isHidden) throws CoreException { + // TODO Auto-generated method stub + + } + } Index: ProjectStub.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/tests_navigator/org/python/pydev/navigator/ProjectStub.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ProjectStub.java 10 May 2008 16:29:24 -0000 1.5 --- ProjectStub.java 28 Jun 2008 13:29:19 -0000 1.6 *************** *** 650,653 **** --- 650,684 ---- } + public void create(IProjectDescription description, int updateFlags, + IProgressMonitor monitor) throws CoreException { + // TODO Auto-generated method stub + + } + + public Map getPersistentProperties() throws CoreException { + // TODO Auto-generated method stub + return null; + } + + public Map getSessionProperties() throws CoreException { + // TODO Auto-generated method stub + return null; + } + + public boolean isDerived(int options) { + // TODO Auto-generated method stub + return false; + } + + public boolean isHidden() { + // TODO Auto-generated method stub + return false; + } + + public void setHidden(boolean isHidden) throws CoreException { + // TODO Auto-generated method stub + + } + } Index: WorkspaceRootStub.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/tests_navigator/org/python/pydev/navigator/WorkspaceRootStub.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WorkspaceRootStub.java 9 May 2008 01:10:13 -0000 1.2 --- WorkspaceRootStub.java 28 Jun 2008 13:29:19 -0000 1.3 *************** *** 4,7 **** --- 4,8 ---- import java.util.ArrayList; import java.util.List; + import java.util.Map; import org.eclipse.core.resources.IContainer; *************** *** 402,404 **** --- 403,435 ---- } + public IProject[] getProjects(int memberFlags) { + // TODO Auto-generated method stub + return null; + } + + public Map getPersistentProperties() throws CoreException { + // TODO Auto-generated method stub + return null; + } + + public Map getSessionProperties() throws CoreException { + // TODO Auto-generated method stub + return null; + } + + public boolean isDerived(int options) { + // TODO Auto-generated method stub + return false; + } + + public boolean isHidden() { + // TODO Auto-generated method stub + return false; + } + + public void setHidden(boolean isHidden) throws CoreException { + // TODO Auto-generated method stub + + } + } Index: FileStub.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/tests_navigator/org/python/pydev/navigator/FileStub.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FileStub.java 6 Jul 2007 17:45:23 -0000 1.3 --- FileStub.java 28 Jun 2008 13:29:19 -0000 1.4 *************** *** 5,8 **** --- 5,9 ---- import java.io.Reader; import java.net.URI; + import java.util.Map; import org.eclipse.core.resources.IContainer; *************** *** 487,489 **** --- 488,515 ---- } + public Map getPersistentProperties() throws CoreException { + // TODO Auto-generated method stub + return null; + } + + public Map getSessionProperties() throws CoreException { + // TODO Auto-generated method stub + return null; + } + + public boolean isDerived(int options) { + // TODO Auto-generated method stub + return false; + } + + public boolean isHidden() { + // TODO Auto-generated method stub + return false; + } + + public void setHidden(boolean isHidden) throws CoreException { + // TODO Auto-generated method stub + + } + } |
From: Fabio Z. <fa...@us...> - 2008-06-28 13:29:12
|
Update of /cvsroot/pydev/org.python.pydev/tests_completions/org/python/pydev/editor/codecompletion/revisited In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32280/tests_completions/org/python/pydev/editor/codecompletion/revisited Modified Files: ProjectStub.java Log Message: Removing some compile errors in eclipse 3.4 Index: ProjectStub.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/tests_completions/org/python/pydev/editor/codecompletion/revisited/ProjectStub.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ProjectStub.java 27 May 2007 22:27:41 -0000 1.2 --- ProjectStub.java 28 Jun 2008 13:29:19 -0000 1.3 *************** *** 458,460 **** --- 458,491 ---- } + public void create(IProjectDescription description, int updateFlags, + IProgressMonitor monitor) throws CoreException { + // TODO Auto-generated method stub + + } + + public Map getPersistentProperties() throws CoreException { + // TODO Auto-generated method stub + return null; + } + + public Map getSessionProperties() throws CoreException { + // TODO Auto-generated method stub + return null; + } + + public boolean isDerived(int options) { + // TODO Auto-generated method stub + return false; + } + + public boolean isHidden() { + // TODO Auto-generated method stub + return false; + } + + public void setHidden(boolean isHidden) throws CoreException { + // TODO Auto-generated method stub + + } + } |
From: Fabio Z. <fa...@us...> - 2008-06-28 13:29:12
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32280/src/org/python/pydev/editor Modified Files: PyEdit.java Log Message: Removing some compile errors in eclipse 3.4 Index: PyEdit.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/PyEdit.java,v retrieving revision 1.130 retrieving revision 1.131 diff -C2 -d -r1.130 -r1.131 *** PyEdit.java 1 Jun 2008 20:44:41 -0000 1.130 --- PyEdit.java 28 Jun 2008 13:29:19 -0000 1.131 *************** *** 26,29 **** --- 26,32 ---- import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.jface.preference.IPreferenceStore; + import org.eclipse.jface.resource.FontDescriptor; + import org.eclipse.jface.resource.JFaceResources; + import org.eclipse.jface.resource.LocalResourceManager; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IDocument; *************** *** 41,45 **** import org.eclipse.swt.graphics.FontData; import org.eclipse.swt.widgets.Composite; - import org.eclipse.swt.widgets.Display; import org.eclipse.ui.IActionBars; import org.eclipse.ui.IEditorActionBarContributor; --- 44,47 ---- *************** *** 48,52 **** import org.eclipse.ui.PartInitException; import org.eclipse.ui.editors.text.TextFileDocumentProvider; - import org.eclipse.ui.internal.util.SWTResourceUtil; import org.eclipse.ui.part.EditorActionBarContributor; import org.eclipse.ui.part.FileEditorInput; --- 50,53 ---- *************** *** 735,738 **** --- 736,744 ---- cache.clear(); cache = null; + + if(this.resourceManager != null){ + this.resourceManager.dispose(); + this.resourceManager = null; + } }catch (Throwable e) { PydevPlugin.log(e); *************** *** 1176,1188 **** } ! /** * Used in the script pyedit_list_bindings.py */ public Font getFont(FontData descriptor) { ! Font font = (Font) SWTResourceUtil.getFontTable().get(descriptor); ! if (font == null) { ! font = new Font(Display.getCurrent(), descriptor); ! SWTResourceUtil.getFontTable().put(descriptor, font); ! } return font; } --- 1182,1206 ---- } ! private LocalResourceManager resourceManager; ! ! public LocalResourceManager getResourceManager() { ! if(resourceManager == null){ ! resourceManager = new LocalResourceManager(JFaceResources.getResources()); ! } ! return resourceManager; ! } ! ! /** * Used in the script pyedit_list_bindings.py */ public Font getFont(FontData descriptor) { ! Font font = getResourceManager().createFont(FontDescriptor.createFrom(descriptor)); ! ! // Old implementation (for Eclipse 3.3) ! // Font font = (Font) SWTResourceUtil.getFontTable().get(descriptor); ! // if (font == null) { ! // font = new Font(Display.getCurrent(), descriptor); ! // SWTResourceUtil.getFontTable().put(descriptor, font); ! // } return font; } |
From: Fabio Z. <fa...@us...> - 2008-06-28 13:29:12
|
Update of /cvsroot/pydev/org.python.pydev/tests/org/python/pydev/plugin/nature In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32280/tests/org/python/pydev/plugin/nature Modified Files: ProjectStub2.java FileStub2.java Log Message: Removing some compile errors in eclipse 3.4 Index: FileStub2.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/tests/org/python/pydev/plugin/nature/FileStub2.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FileStub2.java 27 May 2007 22:27:41 -0000 1.2 --- FileStub2.java 28 Jun 2008 13:29:19 -0000 1.3 *************** *** 9,12 **** --- 9,13 ---- import java.io.Reader; import java.net.URI; + import java.util.Map; import org.eclipse.core.resources.IContainer; *************** *** 360,363 **** --- 361,389 ---- } + public Map getPersistentProperties() throws CoreException { + // TODO Auto-generated method stub + return null; + } + + public Map getSessionProperties() throws CoreException { + // TODO Auto-generated method stub + return null; + } + + public boolean isDerived(int options) { + // TODO Auto-generated method stub + return false; + } + + public boolean isHidden() { + // TODO Auto-generated method stub + return false; + } + + public void setHidden(boolean isHidden) throws CoreException { + // TODO Auto-generated method stub + + } + } Index: ProjectStub2.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/tests/org/python/pydev/plugin/nature/ProjectStub2.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ProjectStub2.java 27 May 2007 22:27:41 -0000 1.3 --- ProjectStub2.java 28 Jun 2008 13:29:19 -0000 1.4 *************** *** 445,447 **** --- 445,478 ---- } + public void create(IProjectDescription description, int updateFlags, + IProgressMonitor monitor) throws CoreException { + // TODO Auto-generated method stub + + } + + public Map getPersistentProperties() throws CoreException { + // TODO Auto-generated method stub + return null; + } + + public Map getSessionProperties() throws CoreException { + // TODO Auto-generated method stub + return null; + } + + public boolean isDerived(int options) { + // TODO Auto-generated method stub + return false; + } + + public boolean isHidden() { + // TODO Auto-generated method stub + return false; + } + + public void setHidden(boolean isHidden) throws CoreException { + // TODO Auto-generated method stub + + } + } |
From: Fabio Z. <fa...@us...> - 2008-06-28 12:35:43
|
Update of /cvsroot/pydev/org.python.pydev.parser/META-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12218/META-INF Modified Files: MANIFEST.MF Log Message: Backwards support for Eclipse 3.2. Index: MANIFEST.MF =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.parser/META-INF/MANIFEST.MF,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** MANIFEST.MF 23 Feb 2008 18:58:16 -0000 1.20 --- MANIFEST.MF 28 Jun 2008 12:35:51 -0000 1.21 *************** *** 15,19 **** org.eclipse.jface.text, org.python.pydev.core, ! org.eclipse.ui.editors Eclipse-LazyStart: true Export-Package: org.python.pydev.parser, --- 15,20 ---- org.eclipse.jface.text, org.python.pydev.core, ! org.eclipse.ui.editors, ! org.eclipse.ui.workbench.texteditor Eclipse-LazyStart: true Export-Package: org.python.pydev.parser, |
From: Fabio Z. <fa...@us...> - 2008-06-28 12:35:39
|
Update of /cvsroot/pydev/org.python.pydev.core/src/org/python/pydev/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12206/src/org/python/pydev/core Modified Files: REF.java Log Message: Backwards support for Eclipse 3.2. Index: REF.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.core/src/org/python/pydev/core/REF.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** REF.java 5 Jan 2008 17:09:18 -0000 1.39 --- REF.java 28 Jun 2008 12:35:47 -0000 1.40 *************** *** 497,505 **** } /** ! * @return null if it was unable to get the document from the path (this may happen if it was not refreshed). ! * Or the document that represents the file */ ! public static IDocument getDocFromPath(IPath path) { //TODO: make this better for 3.3/ 3.2 (and check if behaviour is correct now) try{ --- 497,506 ---- } + /** ! * @param path tha path we're interested in ! * @return a file buffer to be used. */ ! public static ITextFileBuffer getBufferFromPath(IPath path) { //TODO: make this better for 3.3/ 3.2 (and check if behaviour is correct now) try{ *************** *** 512,521 **** if(textFileBuffer != null){ //we don't have it when it is not properly refreshed ! return textFileBuffer.getDocument(); } } ! }catch(Throwable e){//NoSuchMethod/NoClassDef exception ! if(e instanceof ClassNotFoundException || e instanceof LinkageError){ ITextFileBufferManager textFileBufferManager = FileBuffers.getTextFileBufferManager(); --- 513,524 ---- if(textFileBuffer != null){ //we don't have it when it is not properly refreshed ! return textFileBuffer; } } ! }catch(Throwable e){//NoSuchMethod/NoClassDef exception ! if(e instanceof ClassNotFoundException || e instanceof LinkageError || e instanceof NoSuchMethodException || ! e instanceof NoSuchMethodError || e instanceof NoClassDefFoundError){ ! ITextFileBufferManager textFileBufferManager = FileBuffers.getTextFileBufferManager(); *************** *** 524,528 **** if(textFileBuffer != null){ //we don't have it when it is not properly refreshed ! return textFileBuffer.getDocument(); } } --- 527,531 ---- if(textFileBuffer != null){ //we don't have it when it is not properly refreshed ! return textFileBuffer; } } *************** *** 542,546 **** } return null; ! } } --- 545,560 ---- } return null; ! } ! } ! /** ! * @return null if it was unable to get the document from the path (this may happen if it was not refreshed). ! * Or the document that represents the file ! */ ! public static IDocument getDocFromPath(IPath path) { ! ITextFileBuffer buffer = getBufferFromPath(path); ! if(buffer != null){ ! return buffer.getDocument(); ! } ! return null; } |
From: Fabio Z. <fa...@us...> - 2008-06-28 12:35:35
|
Update of /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12190/src/org/python/pydev/debug/ui/launching Modified Files: PythonRunner.java Log Message: Backwards support for Eclipse 3.2. Index: PythonRunner.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching/PythonRunner.java,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** PythonRunner.java 21 May 2008 01:38:15 -0000 1.36 --- PythonRunner.java 28 Jun 2008 12:35:43 -0000 1.37 *************** *** 20,23 **** --- 20,24 ---- import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.model.IProcess; + import org.eclipse.debug.ui.IDebugUIConstants; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.swt.widgets.Display; *************** *** 210,214 **** */ 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]; --- 211,216 ---- */ private static Process createProcess(ILaunch launch, String[] envp, String[] cmdLine, File workingDirectory) throws CoreException { ! //Not using DebugPlugin.ATTR_CONSOLE_ENCODING to provide backward compatibility for eclipse 3.2 ! String encoding = launch.getAttribute(IDebugUIConstants.ATTR_CONSOLE_ENCODING); if(encoding != null && encoding.trim().length() > 0){ String[] s = new String[envp.length+1]; |
From: Fabio Z. <fa...@us...> - 2008-06-28 12:35:35
|
Update of /cvsroot/pydev/org.python.pydev.debug/src_console/org/python/pydev/debug/newconsole In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12190/src_console/org/python/pydev/debug/newconsole Modified Files: PydevConsole.java Log Message: Backwards support for Eclipse 3.2. Index: PydevConsole.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src_console/org/python/pydev/debug/newconsole/PydevConsole.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PydevConsole.java 6 Apr 2008 19:51:23 -0000 1.7 --- PydevConsole.java 28 Jun 2008 12:35:43 -0000 1.8 *************** *** 48,52 **** public PydevConsole(PydevConsoleInterpreter interpreter) { super(CONSOLE_NAME + " [" + getNextId() + "]", PydevConsoleConstants.CONSOLE_TYPE, interpreter); ! setBackground(ColorManager.getPreferenceColor(PydevConsoleConstants.CONSOLE_BACKGROUND_COLOR)); } --- 48,54 ---- public PydevConsole(PydevConsoleInterpreter interpreter) { super(CONSOLE_NAME + " [" + getNextId() + "]", PydevConsoleConstants.CONSOLE_TYPE, interpreter); ! this.setPydevConsoleBackground(ColorManager.getPreferenceColor(PydevConsoleConstants.CONSOLE_BACKGROUND_COLOR)); ! //Cannot be called directly because Eclipse 3.2does not support it. ! //setBackground(ColorManager.getPreferenceColor(PydevConsoleConstants.CONSOLE_BACKGROUND_COLOR)); } |
From: Fabio Z. <fa...@us...> - 2008-06-28 12:35:31
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/correctionassist In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12157/src/org/python/pydev/editor/correctionassist Modified Files: PythonCorrectionProcessor.java Log Message: Backwards support for Eclipse 3.2. Index: PythonCorrectionProcessor.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/correctionassist/PythonCorrectionProcessor.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** PythonCorrectionProcessor.java 3 May 2008 13:37:35 -0000 1.38 --- PythonCorrectionProcessor.java 28 Jun 2008 12:35:38 -0000 1.39 *************** *** 171,209 **** ! ! //handling spelling... (we only want to show spelling fixes if a spell problem annotation is found at the current location). ! //we'll only show some spelling proposal if there's some spelling problem (so, we don't have to check the preferences at this place, ! //as no annotations on spelling will be here if the spelling is not enabled). ! ICompletionProposal[] spellProps = null; ! ! IAnnotationModel annotationModel = edit.getPySourceViewer().getAnnotationModel(); ! Iterator it = annotationModel.getAnnotationIterator(); ! while(it.hasNext()){ ! Object annotation = it.next(); ! if(annotation instanceof SpellingAnnotation){ ! SpellingAnnotation spellingAnnotation = (SpellingAnnotation) annotation; ! SpellingProblem spellingProblem = spellingAnnotation.getSpellingProblem(); ! ! int problemOffset = spellingProblem.getOffset(); ! int problemLen = spellingProblem.getLength(); ! if(problemOffset <= offset && problemOffset+problemLen >= offset){ ! SpellingCorrectionProcessor spellingCorrectionProcessor = new SpellingCorrectionProcessor(); ! spellProps = spellingCorrectionProcessor.computeQuickAssistProposals(invocationContext); ! break; ! } } } - - - if(spellProps == null || (spellProps.length == 1 && spellProps[0] instanceof NoCompletionsProposal)){ - //no proposals from the spelling - return (ICompletionProposal[]) results.toArray(new ICompletionProposal[results.size()]); - } - - //ok, add the spell problems and return... - ICompletionProposal[] ret = (ICompletionProposal[]) results.toArray(new ICompletionProposal[results.size()+spellProps.length]); - System.arraycopy(spellProps, 0, ret, results.size(), spellProps.length); - return ret; } --- 171,218 ---- ! try{ ! //handling spelling... (we only want to show spelling fixes if a spell problem annotation is found at the current location). ! //we'll only show some spelling proposal if there's some spelling problem (so, we don't have to check the preferences at this place, ! //as no annotations on spelling will be here if the spelling is not enabled). ! ICompletionProposal[] spellProps = null; ! ! IAnnotationModel annotationModel = edit.getPySourceViewer().getAnnotationModel(); ! Iterator it = annotationModel.getAnnotationIterator(); ! while(it.hasNext()){ ! Object annotation = it.next(); ! if(annotation instanceof SpellingAnnotation){ ! SpellingAnnotation spellingAnnotation = (SpellingAnnotation) annotation; ! SpellingProblem spellingProblem = spellingAnnotation.getSpellingProblem(); ! ! int problemOffset = spellingProblem.getOffset(); ! int problemLen = spellingProblem.getLength(); ! if(problemOffset <= offset && problemOffset+problemLen >= offset){ ! SpellingCorrectionProcessor spellingCorrectionProcessor = new SpellingCorrectionProcessor(); ! spellProps = spellingCorrectionProcessor.computeQuickAssistProposals(invocationContext); ! break; ! } ! } ! } ! ! ! ! if(spellProps == null || (spellProps.length == 1 && spellProps[0] instanceof NoCompletionsProposal)){ ! //no proposals from the spelling ! return (ICompletionProposal[]) results.toArray(new ICompletionProposal[results.size()]); ! } ! ! //ok, add the spell problems and return... ! ICompletionProposal[] ret = (ICompletionProposal[]) results.toArray(new ICompletionProposal[results.size()+spellProps.length]); ! System.arraycopy(spellProps, 0, ret, results.size(), spellProps.length); ! return ret; ! }catch(Throwable e){ ! if(e instanceof ClassNotFoundException || e instanceof LinkageError || e instanceof NoSuchMethodException || ! e instanceof NoSuchMethodError || e instanceof NoClassDefFoundError){ ! //Eclipse 3.2 support ! return (ICompletionProposal[]) results.toArray(new ICompletionProposal[results.size()]); } + throw new RuntimeException(e); } } |
From: Fabio Z. <fa...@us...> - 2008-06-28 12:35:31
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12157 Modified Files: Changes.txt Log Message: Backwards support for Eclipse 3.2. Index: Changes.txt =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/Changes.txt,v retrieving revision 1.398 retrieving revision 1.399 diff -C2 -d -r1.398 -r1.399 *** Changes.txt 21 Jun 2008 14:31:22 -0000 1.398 --- Changes.txt 28 Jun 2008 12:35:38 -0000 1.399 *************** *** 4,7 **** --- 4,8 ---- <ul> <li><strong>Ctr+/</strong>: Changed to toggle comment (instead of only comment) -- patch from Christoph Pickl</li> + <li><strong>Eclipse 3.2</strong>: Readded support for Eclipse 3.2 (mostly for Aptana support)</li> </ul> |