pydev-cvs Mailing List for PyDev for Eclipse (Page 309)
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...> - 2004-07-22 14:09:00
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17800 Modified Files: plugin.xml Log Message: Collapse / un collapse all. Index: plugin.xml =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/plugin.xml,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** plugin.xml 22 Jul 2004 13:26:54 -0000 1.24 --- plugin.xml 22 Jul 2004 14:08:51 -0000 1.25 *************** *** 204,207 **** --- 204,221 ---- </action> <action + definitionId="org.python.pydev.editor.actions.navigation.pyCollapseAll" + label="Collapse code (All)" + class="org.python.pydev.editor.actions.codefolding.PyCollapseAll" + menubarPath="org.python.pydev.editor.actions.sourceMenu/addGroup" + id="org.python.pydev.editor.actions.navigation.pyCollapseAll"> + </action> + <action + definitionId="org.python.pydev.editor.actions.navigation.pyUnCollapseAll" + label="Un Collapse code (All)" + class="org.python.pydev.editor.actions.codefolding.PyUnCollapseAll" + menubarPath="org.python.pydev.editor.actions.sourceMenu/addGroup" + id="org.python.pydev.editor.actions.navigation.pyUnCollapseAll"> + </action> + <action definitionId="org.python.pydev.editor.actions.pyShowOutline" label="Show Quick Outline" *************** *** 497,500 **** --- 511,540 ---- configuration="org.eclipse.ui.defaultAcceleratorConfiguration"> </keyBinding> + <!-- command: Collapse All--> + <command + name="Python Collapse All" + description="Collapse all blocks of code" + category="org.python.pydev.ui.category.source" + id="org.python.pydev.editor.actions.navigation.pyCollapseAll"> + </command> + <keyBinding + string="Ctrl+9" + scope="org.python.pydev.ui.editor.scope" + command="org.python.pydev.editor.actions.navigation.pyCollapseAll" + configuration="org.eclipse.ui.defaultAcceleratorConfiguration"> + </keyBinding> + <!-- command: Un Collapse--> + <command + name="Python Un Collapse All" + description="Un Collapse all blocks of code" + category="org.python.pydev.ui.category.source" + id="org.python.pydev.editor.actions.navigation.pyUnCollapseAll"> + </command> + <keyBinding + string="Ctrl+0" + scope="org.python.pydev.ui.editor.scope" + command="org.python.pydev.editor.actions.navigation.pyUnCollapseAll" + configuration="org.eclipse.ui.defaultAcceleratorConfiguration"> + </keyBinding> <!-- command: Show outline--> <command |
From: Fabio Z. <fa...@us...> - 2004-07-22 14:08:37
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/codefolding In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17736/src/org/python/pydev/editor/actions/codefolding Added Files: PyCollapseAll.java PyUnCollapseAll.java Log Message: Collapse / un collapse all/ --- NEW FILE: PyUnCollapseAll.java --- /* * Created on Jul 22, 2004 * * @author Fabio Zadrozny */ package org.python.pydev.editor.actions.codefolding; import java.util.ArrayList; import java.util.Iterator; import org.eclipse.jface.action.IAction; import org.eclipse.jface.text.Position; import org.eclipse.jface.text.source.IAnnotationModel; import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel; import org.python.pydev.editor.actions.PyAction; import org.python.pydev.editor.actions.PySelection; import org.python.pydev.editor.codefolding.PyProjectionAnnotation; /** * @author Fabio Zadrozny */ public class PyUnCollapseAll extends PyAction { /* (non-Javadoc) * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) */ public void run(IAction action) { PySelection ps = new PySelection ( getTextEditor ( ), false ); IAnnotationModel model = (IAnnotationModel) getTextEditor ( ) .getAdapter(ProjectionAnnotationModel.class); if (model != null) { ArrayList collapsed = new ArrayList(); //put annotations in array list. Iterator iter = model.getAnnotationIterator(); while (iter != null && iter.hasNext()) { PyProjectionAnnotation element = (PyProjectionAnnotation) iter.next(); Position position = model.getPosition(element); model.removeAnnotation(element); element.markExpanded(); model.addAnnotation(element, position); } } } } --- NEW FILE: PyCollapseAll.java --- /* * Created on Jul 22, 2004 * * @author Fabio Zadrozny */ package org.python.pydev.editor.actions.codefolding; import java.util.ArrayList; import java.util.Iterator; import org.eclipse.jface.action.IAction; import org.eclipse.jface.text.Position; import org.eclipse.jface.text.source.IAnnotationModel; import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel; import org.python.pydev.editor.actions.PyAction; import org.python.pydev.editor.actions.PySelection; import org.python.pydev.editor.codefolding.PyProjectionAnnotation; /** * @author Fabio Zadrozny */ public class PyCollapseAll extends PyAction { /* * (non-Javadoc) * * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) */ public void run(IAction action) { PySelection ps = new PySelection ( getTextEditor ( ), false ); IAnnotationModel model = (IAnnotationModel) getTextEditor ( ) .getAdapter(ProjectionAnnotationModel.class); if (model != null) { ArrayList collapsed = new ArrayList(); //put annotations in array list. Iterator iter = model.getAnnotationIterator(); while (iter != null && iter.hasNext()) { PyProjectionAnnotation element = (PyProjectionAnnotation) iter.next(); Position position = model.getPosition(element); model.removeAnnotation(element); element.markCollapsed(); model.addAnnotation(element, position); } } } } |
From: Fabio Z. <fa...@us...> - 2004-07-22 13:27:56
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10940/src/org/python/pydev/editor Modified Files: PyEdit.java Log Message: Changed code folding package. Index: PyEdit.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/PyEdit.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** PyEdit.java 19 Jul 2004 18:06:17 -0000 1.18 --- PyEdit.java 22 Jul 2004 13:27:43 -0000 1.19 *************** *** 89,93 **** Hyperlink fMouseListener; /** listeners that get notified of model changes */ ! ArrayList modelListeners; public PyEdit() { --- 89,93 ---- Hyperlink fMouseListener; /** listeners that get notified of model changes */ ! ArrayList modelListeners; public PyEdit() { *************** *** 106,109 **** --- 106,110 ---- CodeFoldingSetter codeFoldingSetter = new CodeFoldingSetter(this); this.addModelListener(codeFoldingSetter); + this.addPropertyListener(codeFoldingSetter); } *************** *** 185,188 **** --- 186,190 ---- resetForceTabs(); PydevPrefs.getPreferences().addPropertyChangeListener(prefListener); + } *************** *** 434,438 **** */ protected void fireModelChanged(AbstractNode root) { ! if (modelListeners.size() > 0) { ArrayList list= new ArrayList(modelListeners); Iterator e= list.iterator(); --- 436,440 ---- */ protected void fireModelChanged(AbstractNode root) { ! if (modelListeners.size() > 0) { ArrayList list= new ArrayList(modelListeners); Iterator e= list.iterator(); |
From: Fabio Z. <fa...@us...> - 2004-07-22 13:27:41
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/codefolding In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10911/src/org/python/pydev/editor/codefolding Modified Files: PyEditProjection.java CodeFoldingSetter.java Log Message: Had to do some "hack" to get the marks after loading the editor the first time. Index: PyEditProjection.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/codefolding/PyEditProjection.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyEditProjection.java 19 Jul 2004 19:50:56 -0000 1.3 --- PyEditProjection.java 22 Jul 2004 13:27:31 -0000 1.4 *************** *** 31,35 **** private ProjectionSupport fProjectionSupport; ! /* --- 31,36 ---- private ProjectionSupport fProjectionSupport; ! public static final int PROP_FOLDING_CHANGED = -999; ! /* Index: CodeFoldingSetter.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/codefolding/CodeFoldingSetter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CodeFoldingSetter.java 19 Jul 2004 17:59:42 -0000 1.1 --- CodeFoldingSetter.java 22 Jul 2004 13:27:31 -0000 1.2 *************** *** 15,19 **** import org.eclipse.jface.text.source.projection.ProjectionAnnotation; import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel; ! import org.eclipse.ui.editors.text.TextEditor; import org.python.pydev.editor.model.AbstractNode; import org.python.pydev.editor.model.ClassNode; --- 15,20 ---- import org.eclipse.jface.text.source.projection.ProjectionAnnotation; import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel; ! import org.eclipse.ui.IPropertyListener; ! import org.python.pydev.editor.PyEdit; import org.python.pydev.editor.model.AbstractNode; import org.python.pydev.editor.model.ClassNode; *************** *** 27,35 **** * This class is used to set the code folding markers. */ ! public class CodeFoldingSetter implements IModelListener { ! private TextEditor editor; ! public CodeFoldingSetter(TextEditor editor) { this.editor = editor; } --- 28,36 ---- * This class is used to set the code folding markers. */ ! public class CodeFoldingSetter implements IModelListener, IPropertyListener { ! private PyEdit editor; ! public CodeFoldingSetter(PyEdit editor) { this.editor = editor; } *************** *** 40,48 **** * @see org.python.pydev.editor.model.IModelListener#modelChanged(org.python.pydev.editor.model.AbstractNode) */ ! public void modelChanged(AbstractNode root) { IAnnotationModel model = (IAnnotationModel) editor .getAdapter(ProjectionAnnotationModel.class); ! try{ if (model != null) { --- 41,81 ---- * @see org.python.pydev.editor.model.IModelListener#modelChanged(org.python.pydev.editor.model.AbstractNode) */ ! public synchronized void modelChanged(AbstractNode root) { IAnnotationModel model = (IAnnotationModel) editor .getAdapter(ProjectionAnnotationModel.class); ! if (model == null){ ! //we have to get the model to do it... so, start a thread and try until get it... ! //this had to be done because sometime we get here and we still are unable to get the ! //projection annotation model. (there should be a better way, but this solves it... ! //even if it looks like a hack...) ! new Thread(){ ! public void run(){ ! IAnnotationModel modelT = null; ! for(int i=0 ; i < 10 && modelT == null; i++){ ! modelT = (IAnnotationModel) editor ! .getAdapter(ProjectionAnnotationModel.class); ! try { ! sleep(50); ! } catch (InterruptedException e) { ! e.printStackTrace(); ! } ! } ! if (modelT != null){ ! addMarksToModel(editor.getPythonModel(), modelT); ! } ! } ! }.start(); ! }else{ ! addMarksToModel(root, model); ! } ! ! } ! ! /** ! * @param root ! * @param model ! */ ! private void addMarksToModel(AbstractNode root, IAnnotationModel model) { try{ if (model != null) { *************** *** 75,79 **** e.printStackTrace(); } - } --- 108,111 ---- *************** *** 130,132 **** --- 162,174 ---- } + /* (non-Javadoc) + * @see org.eclipse.ui.IPropertyListener#propertyChanged(java.lang.Object, int) + */ + public void propertyChanged(Object source, int propId) { + if(propId == PyEditProjection.PROP_FOLDING_CHANGED){ + System.out.println("PyEditProjection.PROP_FOLDING_CHANGED"); + modelChanged(editor.getPythonModel()); + } + } + } \ No newline at end of file |
From: Fabio Z. <fa...@us...> - 2004-07-22 13:27:05
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10672 Modified Files: plugin.xml Log Message: Changed code folding package. Index: plugin.xml =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/plugin.xml,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** plugin.xml 20 Jul 2004 16:11:48 -0000 1.23 --- plugin.xml 22 Jul 2004 13:26:54 -0000 1.24 *************** *** 4,8 **** id="org.python.pydev" name="Pydev - Python Development Environment" ! version="0.5.1" provider-name="AleksTotic" class="org.python.pydev.plugin.PydevPlugin"> --- 4,8 ---- id="org.python.pydev" name="Pydev - Python Development Environment" ! version="0.5.3" provider-name="AleksTotic" class="org.python.pydev.plugin.PydevPlugin"> *************** *** 192,196 **** definitionId="org.python.pydev.editor.actions.navigation.pyCollapse" label="Collapse code" ! class="org.python.pydev.editor.actions.PyCollapse" menubarPath="org.python.pydev.editor.actions.sourceMenu/addGroup" id="org.python.pydev.editor.actions.navigation.pyCollapse"> --- 192,196 ---- definitionId="org.python.pydev.editor.actions.navigation.pyCollapse" label="Collapse code" ! class="org.python.pydev.editor.actions.codefolding.PyCollapse" menubarPath="org.python.pydev.editor.actions.sourceMenu/addGroup" id="org.python.pydev.editor.actions.navigation.pyCollapse"> *************** *** 199,203 **** definitionId="org.python.pydev.editor.actions.navigation.pyUnCollapse" label="Un Collapse code" ! class="org.python.pydev.editor.actions.PyUnCollapse" menubarPath="org.python.pydev.editor.actions.sourceMenu/addGroup" id="org.python.pydev.editor.actions.navigation.pyUnCollapse"> --- 199,203 ---- definitionId="org.python.pydev.editor.actions.navigation.pyUnCollapse" label="Un Collapse code" ! class="org.python.pydev.editor.actions.codefolding.PyUnCollapse" menubarPath="org.python.pydev.editor.actions.sourceMenu/addGroup" id="org.python.pydev.editor.actions.navigation.pyUnCollapse"> |
From: Fabio Z. <fa...@us...> - 2004-07-22 13:26:43
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/codefolding In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10600/src/org/python/pydev/editor/actions/codefolding Added Files: PyUnCollapse.java PyCollapse.java Log Message: Changed package. --- NEW FILE: PyCollapse.java --- /* * Created on Jul 19, 2004 * * @author Fabio Zadrozny */ package org.python.pydev.editor.actions.codefolding; import java.util.ArrayList; import java.util.Iterator; import org.eclipse.jface.action.IAction; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.Position; import org.eclipse.jface.text.source.IAnnotationModel; import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel; import org.python.pydev.editor.actions.PyAction; import org.python.pydev.editor.actions.PySelection; import org.python.pydev.editor.codefolding.PyProjectionAnnotation; /** * @author Fabio Zadrozny */ public class PyCollapse extends PyAction { /* * (non-Javadoc) * * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) */ public void run(IAction action) { PySelection ps = new PySelection ( getTextEditor ( ), false ); IAnnotationModel model = (IAnnotationModel) getTextEditor ( ) .getAdapter(ProjectionAnnotationModel.class); try { if (model != null) { ArrayList collapsed = new ArrayList(); //put annotations in array list. Iterator iter = model.getAnnotationIterator(); while (iter != null && iter.hasNext()) { PyProjectionAnnotation element = (PyProjectionAnnotation) iter.next(); Position position = model.getPosition(element); int line = ps.doc.getLineOfOffset(position.offset); if(ps.startLineIndex == line){ model.removeAnnotation(element); element.markCollapsed(); model.addAnnotation(element, position); break; } } } } catch (BadLocationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } --- NEW FILE: PyUnCollapse.java --- /* * Created on Jul 19, 2004 * * @author Fabio Zadrozny */ package org.python.pydev.editor.actions.codefolding; import java.util.ArrayList; import java.util.Iterator; import org.eclipse.jface.action.IAction; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.Position; import org.eclipse.jface.text.source.IAnnotationModel; import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel; import org.python.pydev.editor.actions.PyAction; import org.python.pydev.editor.actions.PySelection; import org.python.pydev.editor.codefolding.PyProjectionAnnotation; /** * This could be also called expand... * * @author Fabio Zadrozny */ public class PyUnCollapse extends PyAction{ /* (non-Javadoc) * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) */ public void run(IAction action) { PySelection ps = new PySelection ( getTextEditor ( ), false ); IAnnotationModel model = (IAnnotationModel) getTextEditor ( ) .getAdapter(ProjectionAnnotationModel.class); try { if (model != null) { ArrayList collapsed = new ArrayList(); //put annotations in array list. Iterator iter = model.getAnnotationIterator(); while (iter != null && iter.hasNext()) { PyProjectionAnnotation element = (PyProjectionAnnotation) iter.next(); Position position = model.getPosition(element); int line = ps.doc.getLineOfOffset(position.offset); if(ps.startLineIndex == line){ model.removeAnnotation(element); element.markExpanded(); model.addAnnotation(element, position); break; } } } } catch (BadLocationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } |
From: Fabio Z. <fa...@us...> - 2004-07-22 13:26:37
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/codefolding In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10567/src/org/python/pydev/editor/actions/codefolding Log Message: Directory /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/codefolding added to the repository |
From: Fabio Z. <fa...@us...> - 2004-07-22 13:26:17
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10530/src/org/python/pydev/editor/actions Removed Files: PyCollapse.java PyUnCollapse.java Log Message: Changed package. --- PyCollapse.java DELETED --- --- PyUnCollapse.java DELETED --- |
From: Fabio Z. <fa...@us...> - 2004-07-22 13:26:04
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10437/src/org/python/pydev/editor/actions Modified Files: PyAddBlockComment.java Log Message: Changed line to the default print margin. Index: PyAddBlockComment.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions/PyAddBlockComment.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PyAddBlockComment.java 21 Jun 2004 21:36:29 -0000 1.7 --- PyAddBlockComment.java 22 Jul 2004 13:25:55 -0000 1.8 *************** *** 118,122 **** catch ( Exception e ) { ! return "========================="; } } --- 118,123 ---- catch ( Exception e ) { ! //return the default print margin... ! return "================================================================================"; } } |
From: Aleksandar T. <at...@us...> - 2004-07-21 18:09:44
|
Update of /cvsroot/pydev/org.python.pydev.help/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18641/html Modified Files: ed_prefs.html Log Message: Add code folding preference to documentation Index: ed_prefs.html =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.help/html/ed_prefs.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ed_prefs.html 11 May 2004 11:02:02 -0000 1.3 --- ed_prefs.html 21 Jul 2004 18:09:34 -0000 1.4 *************** *** 1,6 **** <h2>Pydev editor preferences</h2> ! <p><img src="images/ed_prefs.gif" width="599" height="326"></p> <p><strong>Substitute spaces for tabs</strong>: whether editor should insert spaces when you hit a tab. </p> <p><strong>Assume tab spacing when files contain tabs?</strong>: you'll like this preference if you swing both ways, and mix & match tabs and spaces, When this pref is on, if the file is tab-indented editor will do the right thing and leave your tabs alone. </p> <p><strong>Tab length</strong>: in inches </p> <p><strong>Colors</strong>: are self-explanatary. The default colors have been borrowed from IDLE. </p> --- 1,7 ---- <h2>Pydev editor preferences</h2> ! <p><img src="images/ed_prefs.gif" width="590" height="371"></p> <p><strong>Substitute spaces for tabs</strong>: whether editor should insert spaces when you hit a tab. </p> <p><strong>Assume tab spacing when files contain tabs?</strong>: you'll like this preference if you swing both ways, and mix & match tabs and spaces, When this pref is on, if the file is tab-indented editor will do the right thing and leave your tabs alone. </p> + <p><strong>Code folding</strong>: turn this off if you'd like to get back the screen real estate </p> <p><strong>Tab length</strong>: in inches </p> <p><strong>Colors</strong>: are self-explanatary. The default colors have been borrowed from IDLE. </p> |
From: Aleksandar T. <at...@us...> - 2004-07-21 18:09:44
|
Update of /cvsroot/pydev/org.python.pydev.help/html/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18641/html/images Modified Files: ed_prefs.gif Log Message: Add code folding preference to documentation Index: ed_prefs.gif =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.help/html/images/ed_prefs.gif,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvs4u4j4L and /tmp/cvsww9TSn differ |
From: Aleksandar T. <at...@us...> - 2004-07-21 18:08:18
|
Update of /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18301/src/org/python/pydev/debug/ui/launching Modified Files: PythonRunner.java Log Message: Pass the environment variables defined in debug box Index: PythonRunner.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/ui/launching/PythonRunner.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PythonRunner.java 7 May 2004 21:50:59 -0000 1.7 --- PythonRunner.java 21 Jul 2004 18:08:10 -0000 1.8 *************** *** 50,54 **** String[] cmdLine = config.getCommandLine(); ! Process p = DebugPlugin.exec(cmdLine, config.workingDirectory); if (p == null) throw new CoreException(PydevDebugPlugin.makeStatus(IStatus.ERROR,"Could not execute python process. Was it cancelled?", null)); --- 50,54 ---- String[] cmdLine = config.getCommandLine(); ! Process p = DebugPlugin.exec(cmdLine, config.workingDirectory, config.envp); if (p == null) throw new CoreException(PydevDebugPlugin.makeStatus(IStatus.ERROR,"Could not execute python process. Was it cancelled?", null)); *************** *** 101,105 **** subMonitor.subTask("Exec..."); ! Process p = DebugPlugin.exec(cmdLine, config.workingDirectory); if (p == null) throw new CoreException(PydevDebugPlugin.makeStatus(IStatus.ERROR, "Could not execute python process. Was it cancelled?", null)); --- 101,105 ---- subMonitor.subTask("Exec..."); ! Process p = DebugPlugin.exec(cmdLine, config.workingDirectory, config.envp); if (p == null) throw new CoreException(PydevDebugPlugin.makeStatus(IStatus.ERROR, "Could not execute python process. Was it cancelled?", null)); |
From: Aleksandar T. <at...@us...> - 2004-07-21 18:06:34
|
Update of /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17857/src/org/python/pydev/debug/model Modified Files: PySourceLocator.java Log Message: When clicking on a source file, do not try to open those whose names start with "<". This fixes an assert when stack frame returns <string> as the file location Index: PySourceLocator.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/model/PySourceLocator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PySourceLocator.java 7 May 2004 21:50:59 -0000 1.3 --- PySourceLocator.java 21 Jul 2004 18:06:24 -0000 1.4 *************** *** 28,32 **** if (element instanceof PyStackFrame) { IPath path = ((PyStackFrame)element).getPath(); ! if (path != null) { IEditorPart part = PydevPlugin.doOpenEditor(path, false); if (part != null) { --- 28,32 ---- if (element instanceof PyStackFrame) { IPath path = ((PyStackFrame)element).getPath(); ! if (path != null && !path.toString().startsWith("<")) { IEditorPart part = PydevPlugin.doOpenEditor(path, false); if (part != null) { |
From: Aleksandar T. <at...@us...> - 2004-07-21 18:04:52
|
Update of /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17292/src/org/python/pydev/debug/model Modified Files: PyDebugTarget.java PyStackFrame.java Log Message: Cosmetic: removed "missing adapter" messages Index: PyStackFrame.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/model/PyStackFrame.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PyStackFrame.java 2 Jul 2004 02:26:00 -0000 1.4 --- PyStackFrame.java 21 Jul 2004 18:04:43 -0000 1.5 *************** *** 209,213 **** return super.getAdapter(adapter); // ongoing, I do not fully understand all the interfaces they'd like me to support ! System.err.println("PyStackFrame Need adapter " + adapter.toString()); return super.getAdapter(adapter); } --- 209,213 ---- return super.getAdapter(adapter); // ongoing, I do not fully understand all the interfaces they'd like me to support ! // System.err.println("PyStackFrame Need adapter " + adapter.toString()); return super.getAdapter(adapter); } Index: PyDebugTarget.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/src/org/python/pydev/debug/model/PyDebugTarget.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PyDebugTarget.java 2 Jul 2004 02:26:00 -0000 1.7 --- PyDebugTarget.java 21 Jul 2004 18:04:43 -0000 1.8 *************** *** 287,291 **** ) return super.getAdapter(adapter); ! System.err.println("Need adapter " + adapter.toString()); return super.getAdapter(adapter); } --- 287,291 ---- ) return super.getAdapter(adapter); ! // System.err.println("Need adapter " + adapter.toString()); return super.getAdapter(adapter); } |
From: Aleksandar T. <at...@us...> - 2004-07-21 18:04:12
|
Update of /cvsroot/pydev/org.python.pydev.debug/pysrc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17109/pysrc Modified Files: pydevd_vars.py pydevd.py Log Message: Trapping the missing attribute exception. Fixes the bug where wxWindows programs could not be stopped Index: pydevd.py =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/pysrc/pydevd.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pydevd.py 26 May 2004 18:56:58 -0000 1.7 --- pydevd.py 21 Jul 2004 18:04:03 -0000 1.8 *************** *** 550,554 **** elif (thread.pydev_step_cmd == CMD_STEP_OVER): if (event is 'return'): # if we are returning from the function, stop in parent ! print "Stepping back one" thread.pydev_step_stop = frame.f_back else: --- 550,554 ---- elif (thread.pydev_step_cmd == CMD_STEP_OVER): if (event is 'return'): # if we are returning from the function, stop in parent ! # print "Stepping back one" thread.pydev_step_stop = frame.f_back else: Index: pydevd_vars.py =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.debug/pysrc/pydevd_vars.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pydevd_vars.py 7 May 2004 21:51:00 -0000 1.2 --- pydevd_vars.py 21 Jul 2004 18:04:03 -0000 1.3 *************** *** 118,123 **** keys.sort() for k in keys: ! v = frame.f_locals[k] ! xml += varToXML(v, str(k)) return xml --- 118,126 ---- keys.sort() for k in keys: ! try: ! v = frame.f_locals[k] ! xml += varToXML(v, str(k)) ! except Exception, e: ! print >>sys.stderr,"unexpected error, recovered safely", str(e) return xml |
From: Fabio Z. <fa...@us...> - 2004-07-20 16:12:20
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30982/src/org/python/pydev/editor/actions Added Files: PyShowOutline.java Log Message: Added action for Quick Outline. (not functional) --- NEW FILE: PyShowOutline.java --- /* * Created on Jul 20, 2004 * * @author Fabio Zadrozny */ package org.python.pydev.editor.actions; import org.eclipse.jface.action.IAction; import org.eclipse.jface.text.DefaultInformationControl; import org.eclipse.jface.text.IInformationControl; import org.eclipse.jface.text.IInformationControlCreator; import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.ITextViewer; import org.eclipse.jface.text.information.IInformationProvider; import org.eclipse.jface.text.information.InformationPresenter; import org.eclipse.swt.widgets.Shell; /** * @author Fabio Zadrozny */ public class PyShowOutline extends PyAction{ /* (non-Javadoc) * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) */ public void run(IAction action) { //TODO: Still trying to find out how to do this... //As I couldn't find a good way to do it, I added a bug to see //if the interface provided by Java can be generalized... // //The bug can be found at: // //https://bugs.eclipse.org/bugs/show_bug.cgi?id=70419 // System.out.println("Show outline information..."); // InformationPresenter informationPresenter = getInformationPresenter(); // informationPresenter.setInformationProvider(getInformationProvider(), "Python Outline Content"); // informationPresenter.showInformation(); // System.out.println("Show outline information...OK"); } /** * @return */ private IInformationProvider getInformationProvider() { return new IInformationProvider(){ public IRegion getSubject(ITextViewer textViewer, int offset) { return new IRegion(){ public int getLength() { return 20; } public int getOffset() { return 20; }}; } public String getInformation(ITextViewer textViewer, IRegion subject) { return "Python Outline Content"; }}; } /** * * @return */ private InformationPresenter getInformationPresenter() { return new InformationPresenter(getInformationControlCreator()); } /** * @return */ private IInformationControlCreator getInformationControlCreator() { return new IInformationControlCreator (){ public IInformationControl createInformationControl(Shell parent) { return new PyInformationControl(parent); }}; } class PyInformationControl extends DefaultInformationControl{ /** * @param parent */ public PyInformationControl(Shell parent) { super(parent); setInformation("Python Outline Content"); } } } |
From: Fabio Z. <fa...@us...> - 2004-07-20 16:11:57
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30875 Modified Files: plugin.xml Log Message: Added action for Quick Outline. Index: plugin.xml =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/plugin.xml,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** plugin.xml 19 Jul 2004 19:57:18 -0000 1.22 --- plugin.xml 20 Jul 2004 16:11:48 -0000 1.23 *************** *** 203,206 **** --- 203,213 ---- id="org.python.pydev.editor.actions.navigation.pyUnCollapse"> </action> + <action + definitionId="org.python.pydev.editor.actions.pyShowOutline" + label="Show Quick Outline" + class="org.python.pydev.editor.actions.PyShowOutline" + menubarPath="org.python.pydev.editor.actions.sourceMenu/addGroup" + id="org.python.pydev.editor.actions.navigation.pyShowOutline"> + </action> </editorContribution> </extension> *************** *** 490,493 **** --- 497,513 ---- configuration="org.eclipse.ui.defaultAcceleratorConfiguration"> </keyBinding> + <!-- command: Show outline--> + <command + name="Python Show Outline" + description="Show Outline" + category="org.python.pydev.ui.category.source" + id="org.python.pydev.editor.actions.pyShowOutline"> + </command> + <keyBinding + string="Ctrl+O" + scope="org.python.pydev.ui.editor.scope" + command="org.python.pydev.editor.actions.pyShowOutline" + configuration="org.eclipse.ui.defaultAcceleratorConfiguration"> + </keyBinding> </extension> <!-- file type extensions for the team (CVS) --> |
From: Fabio Z. <fa...@us...> - 2004-07-19 19:57:28
|
Update of /cvsroot/pydev/org.python.pydev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8743 Modified Files: plugin.xml Log Message: Code folding finished. Index: plugin.xml =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/plugin.xml,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** plugin.xml 16 Jul 2004 15:38:11 -0000 1.21 --- plugin.xml 19 Jul 2004 19:57:18 -0000 1.22 *************** *** 4,8 **** id="org.python.pydev" name="Pydev - Python Development Environment" ! version="0.5" provider-name="AleksTotic" class="org.python.pydev.plugin.PydevPlugin"> --- 4,8 ---- id="org.python.pydev" name="Pydev - Python Development Environment" ! version="0.5.1" provider-name="AleksTotic" class="org.python.pydev.plugin.PydevPlugin"> *************** *** 189,192 **** --- 189,206 ---- id="org.python.pydev.editor.actions.navigation.pyGoToDefinition"> </action> + <action + definitionId="org.python.pydev.editor.actions.navigation.pyCollapse" + label="Collapse code" + class="org.python.pydev.editor.actions.PyCollapse" + menubarPath="org.python.pydev.editor.actions.sourceMenu/addGroup" + id="org.python.pydev.editor.actions.navigation.pyCollapse"> + </action> + <action + definitionId="org.python.pydev.editor.actions.navigation.pyUnCollapse" + label="Un Collapse code" + class="org.python.pydev.editor.actions.PyUnCollapse" + menubarPath="org.python.pydev.editor.actions.sourceMenu/addGroup" + id="org.python.pydev.editor.actions.navigation.pyUnCollapse"> + </action> </editorContribution> </extension> *************** *** 450,453 **** --- 464,493 ---- configuration="org.eclipse.ui.defaultAcceleratorConfiguration"> </keyBinding> + <!-- command: Collapse--> + <command + name="Python Collapse" + description="Collapse block of code" + category="org.python.pydev.ui.category.source" + id="org.python.pydev.editor.actions.navigation.pyCollapse"> + </command> + <keyBinding + string="Ctrl+-" + scope="org.python.pydev.ui.editor.scope" + command="org.python.pydev.editor.actions.navigation.pyCollapse" + configuration="org.eclipse.ui.defaultAcceleratorConfiguration"> + </keyBinding> + <!-- command: Un Collapse--> + <command + name="Python Un Collapse" + description="Un Collapse block of code" + category="org.python.pydev.ui.category.source" + id="org.python.pydev.editor.actions.navigation.pyUnCollapse"> + </command> + <keyBinding + string="Ctrl+=" + scope="org.python.pydev.ui.editor.scope" + command="org.python.pydev.editor.actions.navigation.pyUnCollapse" + configuration="org.eclipse.ui.defaultAcceleratorConfiguration"> + </keyBinding> </extension> <!-- file type extensions for the team (CVS) --> |
From: Fabio Z. <fa...@us...> - 2004-07-19 19:51:08
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7451/src/org/python/pydev/plugin Modified Files: PydevPrefs.java Log Message: Code folding finished. Index: PydevPrefs.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/plugin/PydevPrefs.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PydevPrefs.java 2 Jul 2004 02:50:38 -0000 1.9 --- PydevPrefs.java 19 Jul 2004 19:50:57 -0000 1.10 *************** *** 35,56 **** public static final String SUBSTITUTE_TABS = "SUBSTITUTE_TABS"; public static final boolean DEFAULT_SUBSTITUTE_TABS = true; public static final String GUESS_TAB_SUBSTITUTION = "GUESS_TAB_SUBSTITUTION"; public static final boolean DEFAULT_GUESS_TAB_SUBSTITUTION = true; public static final String TAB_WIDTH = "TAB_WIDTH"; public static final int DEFAULT_TAB_WIDTH = 4; public static final String CODE_COLOR = "CODE_COLOR"; private static final RGB DEFAULT_CODE_COLOR = new RGB(0, 0, 0); public static final String KEYWORD_COLOR = "KEYWORD_COLOR"; private static final RGB DEFAULT_KEYWORD_COLOR = new RGB(255, 119, 0); public static final String STRING_COLOR = "STRING_COLOR"; private static final RGB DEFAULT_STRING_COLOR = new RGB(0, 170, 0); public static final String COMMENT_COLOR = "COMMENT_COLOR"; private static final RGB DEFAULT_COMMENT_COLOR = new RGB(221, 0, 0); public static final String INTERPRETER_PATH = "INTERPRETER_PATH"; protected static final String DEFAULT_INTERPRETER_PATH = "python"; public static final String HYPERLINK_COLOR = "HYPERLINK_COLOR"; private static final RGB DEFAULT_HYPERLINK_COLOR = new RGB(0, 0, 238); public static final String BLOCK_COMMENT = "BLOCK_COMMENT"; ! public static final String DEFAULT_BLOCK_COMMENT_STRING = "======================================="; public static final boolean DEFAULT_BLOCK_COMMENT = true; --- 35,68 ---- public static final String SUBSTITUTE_TABS = "SUBSTITUTE_TABS"; public static final boolean DEFAULT_SUBSTITUTE_TABS = true; + + public static final String USE_CODE_FOLDING = "USE_CODE_FOLDING"; + public static final boolean DEFAULT_USE_CODE_FOLDING = true; + public static final String GUESS_TAB_SUBSTITUTION = "GUESS_TAB_SUBSTITUTION"; public static final boolean DEFAULT_GUESS_TAB_SUBSTITUTION = true; + public static final String TAB_WIDTH = "TAB_WIDTH"; public static final int DEFAULT_TAB_WIDTH = 4; + public static final String CODE_COLOR = "CODE_COLOR"; private static final RGB DEFAULT_CODE_COLOR = new RGB(0, 0, 0); + public static final String KEYWORD_COLOR = "KEYWORD_COLOR"; private static final RGB DEFAULT_KEYWORD_COLOR = new RGB(255, 119, 0); + public static final String STRING_COLOR = "STRING_COLOR"; private static final RGB DEFAULT_STRING_COLOR = new RGB(0, 170, 0); + public static final String COMMENT_COLOR = "COMMENT_COLOR"; private static final RGB DEFAULT_COMMENT_COLOR = new RGB(221, 0, 0); + public static final String INTERPRETER_PATH = "INTERPRETER_PATH"; protected static final String DEFAULT_INTERPRETER_PATH = "python"; + public static final String HYPERLINK_COLOR = "HYPERLINK_COLOR"; private static final RGB DEFAULT_HYPERLINK_COLOR = new RGB(0, 0, 238); + public static final String BLOCK_COMMENT = "BLOCK_COMMENT"; ! public static final String DEFAULT_BLOCK_COMMENT_STRING = "================================================================================"; public static final boolean DEFAULT_BLOCK_COMMENT = true; *************** *** 82,87 **** --- 94,104 ---- addField(new BooleanFieldEditor( SUBSTITUTE_TABS, "Substitute spaces for tabs?", p)); + addField(new BooleanFieldEditor( GUESS_TAB_SUBSTITUTION, "Assume tab spacing when files contain tabs?", p)); + + addField(new BooleanFieldEditor( + USE_CODE_FOLDING, "Use code folding?", p)); + IntegerFieldEditor ife = new IntegerFieldEditor(TAB_WIDTH, "Tab length", p, 1); ife.setValidRange(1, 8); *************** *** 92,99 **** --- 109,119 ---- addField(new ColorFieldEditor( CODE_COLOR, "Code", p)); + addField(new ColorFieldEditor( KEYWORD_COLOR, "Keywords", p)); + addField(new ColorFieldEditor( STRING_COLOR, "Strings", p)); + addField(new ColorFieldEditor( COMMENT_COLOR, "Comments", p)); *************** *** 109,112 **** --- 129,133 ---- protected static void initializeDefaultPreferences(Preferences prefs) { prefs.setDefault(SUBSTITUTE_TABS, DEFAULT_SUBSTITUTE_TABS); + prefs.setDefault(USE_CODE_FOLDING, DEFAULT_USE_CODE_FOLDING); prefs.setDefault(GUESS_TAB_SUBSTITUTION, DEFAULT_GUESS_TAB_SUBSTITUTION); prefs.setDefault(TAB_WIDTH, DEFAULT_TAB_WIDTH); |
From: Fabio Z. <fa...@us...> - 2004-07-19 19:51:08
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/codefolding In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7451/src/org/python/pydev/editor/codefolding Modified Files: PyEditProjection.java Log Message: Code folding finished. Index: PyEditProjection.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/codefolding/PyEditProjection.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyEditProjection.java 19 Jul 2004 19:18:44 -0000 1.2 --- PyEditProjection.java 19 Jul 2004 19:50:56 -0000 1.3 *************** *** 17,20 **** --- 17,21 ---- import org.eclipse.ui.editors.text.TextEditor; import org.python.pydev.parser.IParserListener; + import org.python.pydev.plugin.PydevPrefs; /** *************** *** 78,84 **** * @return */ ! private boolean isFoldingEnabled() { ! // TODO Auto-generated method stub ! return true; } --- 79,84 ---- * @return */ ! public static boolean isFoldingEnabled() { ! return PydevPrefs.getPreferences().getBoolean(PydevPrefs.USE_CODE_FOLDING); } |
From: Fabio Z. <fa...@us...> - 2004-07-19 19:29:33
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2472/src/org/python/pydev/editor/model Modified Files: StrNode.java PassNode.java Log Message: Minors Index: PassNode.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/model/PassNode.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PassNode.java 19 Jul 2004 18:05:54 -0000 1.1 --- PassNode.java 19 Jul 2004 19:29:23 -0000 1.2 *************** *** 24,28 **** this.astNode = astNode; this.setStart(new Location(astNode.beginLine-1, astNode.beginColumn-1)); ! this.setEnd(new Location(astNode.beginLine-1, astNode.beginColumn + 22)); } --- 24,28 ---- this.astNode = astNode; this.setStart(new Location(astNode.beginLine-1, astNode.beginColumn-1)); ! this.setEnd(new Location(astNode.beginLine-1, astNode.beginColumn + 4)); } Index: StrNode.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/model/StrNode.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StrNode.java 19 Jul 2004 18:05:54 -0000 1.1 --- StrNode.java 19 Jul 2004 19:29:23 -0000 1.2 *************** *** 24,28 **** this.astNode = astNode; this.setStart(new Location(astNode.beginLine-1, astNode.beginColumn-1)); ! this.setEnd(new Location(astNode.beginLine-1, astNode.beginColumn + 22)); } --- 24,28 ---- this.astNode = astNode; this.setStart(new Location(astNode.beginLine-1, astNode.beginColumn-1)); ! this.setEnd(new Location(astNode.beginLine-1, astNode.beginColumn + astNode.s.length())); } |
From: Fabio Z. <fa...@us...> - 2004-07-19 19:18:53
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv369/src/org/python/pydev/editor/model Modified Files: ModelMaker.java Log Message: Added Actions for collapse Ctrl+- and Ctrl+= Index: ModelMaker.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/model/ModelMaker.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ModelMaker.java 19 Jul 2004 18:05:54 -0000 1.4 --- ModelMaker.java 19 Jul 2004 19:18:44 -0000 1.5 *************** *** 152,156 **** protected Object unhandled_node(SimpleNode node) throws Exception { ! System.err.println("Unhandled: " + node.getClass().toString() + " L:" + Integer.toString(node.beginLine)); return null; } --- 152,156 ---- protected Object unhandled_node(SimpleNode node) throws Exception { ! //System.err.println("Unhandled: " + node.getClass().toString() + " L:" + Integer.toString(node.beginLine)); return null; } |
From: Fabio Z. <fa...@us...> - 2004-07-19 19:18:52
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/codefolding In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv369/src/org/python/pydev/editor/codefolding Modified Files: PyEditProjection.java Log Message: Added Actions for collapse Ctrl+- and Ctrl+= Index: PyEditProjection.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/codefolding/PyEditProjection.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyEditProjection.java 19 Jul 2004 17:59:42 -0000 1.1 --- PyEditProjection.java 19 Jul 2004 19:18:44 -0000 1.2 *************** *** 67,72 **** fProjectionSupport.install(); ! if (isFoldingEnabled()) projectionViewer.doOperation(ProjectionViewer.TOGGLE); } catch (Exception e) { e.printStackTrace(); --- 67,73 ---- fProjectionSupport.install(); ! if (isFoldingEnabled()){ projectionViewer.doOperation(ProjectionViewer.TOGGLE); + } } catch (Exception e) { e.printStackTrace(); |
From: Fabio Z. <fa...@us...> - 2004-07-19 19:18:52
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv369/src/org/python/pydev/editor/actions Added Files: PyCollapse.java PyUnCollapse.java Log Message: Added Actions for collapse Ctrl+- and Ctrl+= --- NEW FILE: PyCollapse.java --- /* * Created on Jul 19, 2004 * * @author Fabio Zadrozny */ package org.python.pydev.editor.actions; import java.util.ArrayList; import java.util.Iterator; import org.eclipse.jface.action.IAction; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.Position; import org.eclipse.jface.text.source.IAnnotationModel; import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel; import org.python.pydev.editor.codefolding.PyProjectionAnnotation; /** * @author Fabio Zadrozny */ public class PyCollapse extends PyAction { /* * (non-Javadoc) * * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) */ public void run(IAction action) { PySelection ps = new PySelection ( getTextEditor ( ), false ); IAnnotationModel model = (IAnnotationModel) getTextEditor ( ) .getAdapter(ProjectionAnnotationModel.class); try { if (model != null) { ArrayList collapsed = new ArrayList(); //put annotations in array list. Iterator iter = model.getAnnotationIterator(); while (iter != null && iter.hasNext()) { PyProjectionAnnotation element = (PyProjectionAnnotation) iter.next(); Position position = model.getPosition(element); int line = ps.doc.getLineOfOffset(position.offset); if(ps.startLineIndex == line){ model.removeAnnotation(element); element.markCollapsed(); model.addAnnotation(element, position); break; } } } } catch (BadLocationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } --- NEW FILE: PyUnCollapse.java --- /* * Created on Jul 19, 2004 * * @author Fabio Zadrozny */ package org.python.pydev.editor.actions; import java.util.ArrayList; import java.util.Iterator; import org.eclipse.jface.action.IAction; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.Position; import org.eclipse.jface.text.source.IAnnotationModel; import org.eclipse.jface.text.source.projection.ProjectionAnnotationModel; import org.python.pydev.editor.codefolding.PyProjectionAnnotation; /** * @author Fabio Zadrozny */ public class PyUnCollapse extends PyAction{ /* (non-Javadoc) * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) */ public void run(IAction action) { PySelection ps = new PySelection ( getTextEditor ( ), false ); IAnnotationModel model = (IAnnotationModel) getTextEditor ( ) .getAdapter(ProjectionAnnotationModel.class); try { if (model != null) { ArrayList collapsed = new ArrayList(); //put annotations in array list. Iterator iter = model.getAnnotationIterator(); while (iter != null && iter.hasNext()) { PyProjectionAnnotation element = (PyProjectionAnnotation) iter.next(); Position position = model.getPosition(element); int line = ps.doc.getLineOfOffset(position.offset); if(ps.startLineIndex == line){ model.removeAnnotation(element); element.markExpanded(); model.addAnnotation(element, position); break; } } } } catch (BadLocationException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } |
From: Fabio Z. <fa...@us...> - 2004-07-19 18:06:26
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14608/src/org/python/pydev/editor Modified Files: PythonCompletionProcessor.java PyEdit.java Log Message: Code folding capabilities added. Index: PyEdit.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/PyEdit.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** PyEdit.java 2 Jul 2004 02:50:38 -0000 1.17 --- PyEdit.java 19 Jul 2004 18:06:17 -0000 1.18 *************** *** 31,35 **** import org.eclipse.ui.PartInitException; import org.eclipse.ui.editors.text.ILocationProvider; - import org.eclipse.ui.editors.text.TextEditor; import org.eclipse.ui.texteditor.DefaultRangeIndicator; import org.eclipse.ui.texteditor.IEditorStatusLine; --- 31,34 ---- *************** *** 42,45 **** --- 41,46 ---- import org.python.parser.TokenMgrError; import org.python.pydev.editor.actions.PyOpenAction; + import org.python.pydev.editor.codefolding.CodeFoldingSetter; + import org.python.pydev.editor.codefolding.PyEditProjection; import org.python.pydev.editor.model.AbstractNode; import org.python.pydev.editor.model.IModelListener; *************** *** 47,51 **** import org.python.pydev.editor.model.ModelMaker; import org.python.pydev.outline.PyOutlinePage; - import org.python.pydev.parser.IParserListener; import org.python.pydev.parser.PyParser; import org.python.pydev.plugin.PydevPlugin; --- 48,51 ---- *************** *** 69,73 **** * */ ! public class PyEdit extends TextEditor implements IParserListener { static public String EDITOR_ID = "org.python.pydev.editor.PythonEditor"; --- 69,73 ---- * */ ! public class PyEdit extends PyEditProjection { static public String EDITOR_ID = "org.python.pydev.editor.PythonEditor"; *************** *** 102,106 **** indentStrategy = (PyAutoIndentStrategy)editConfiguration.getAutoIndentStrategy(null, IDocument.DEFAULT_CONTENT_TYPE); setRangeIndicator(new DefaultRangeIndicator()); // enables standard vertical ruler ! } --- 102,109 ---- indentStrategy = (PyAutoIndentStrategy)editConfiguration.getAutoIndentStrategy(null, IDocument.DEFAULT_CONTENT_TYPE); setRangeIndicator(new DefaultRangeIndicator()); // enables standard vertical ruler ! ! //Added to set the code folding. ! CodeFoldingSetter codeFoldingSetter = new CodeFoldingSetter(this); ! this.addModelListener(codeFoldingSetter); } *************** *** 248,251 **** --- 251,255 ---- sourceViewer.revealRange(offset, length); } + /** Index: PythonCompletionProcessor.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/pydev/editor/PythonCompletionProcessor.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PythonCompletionProcessor.java 14 Jun 2004 18:52:38 -0000 1.6 --- PythonCompletionProcessor.java 19 Jul 2004 18:06:17 -0000 1.7 *************** *** 7,234 **** package org.python.pydev.editor; - import java.io.IOException; - import java.net.MalformedURLException; - import java.net.URL; - import java.util.ArrayList; - import java.util.List; - import java.util.Properties; - - import org.eclipse.core.runtime.Platform; - import org.eclipse.core.runtime.Plugin; - import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.ITextViewer; - import org.eclipse.jface.text.contentassist.CompletionProposal; import org.eclipse.jface.text.contentassist.ICompletionProposal; import org.eclipse.jface.text.contentassist.IContentAssistProcessor; import org.eclipse.jface.text.contentassist.IContextInformation; import org.eclipse.jface.text.contentassist.IContextInformationValidator; - import org.eclipse.swt.graphics.Point; - import org.python.core.PyException; - import org.python.core.PyList; - import org.python.core.PyObject; - import org.python.core.PyString; - import org.python.core.PySystemState; - import org.python.util.PythonInterpreter; - - /** - * @author Dmoore - * - * To change the template for this generated type comment go to - * Window>Preferences>Java>Code Generation>Code and Comments - */ - public class PythonCompletionProcessor implements IContentAssistProcessor { - - /* (non-Javadoc) - * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(org.eclipse.jface.text.ITextViewer, int) - */ - int docBoundary = -1; // the document prior to the activation token - int docBoundary2 = 0; - public ICompletionProposal[] computeCompletionProposals( - ITextViewer viewer, - int documentOffset) { - List propList = new ArrayList(); - IDocument doc = viewer.getDocument(); - // System.out.println("The document:"+doc.get()); - Point selectedRange = viewer.getSelectedRange(); - // there may not be a selected range - java.lang.String theDoc = doc.get(); - calcDocBoundary(theDoc, documentOffset); - String activationToken = this.getActivationToken(theDoc, documentOffset); - // System.out.println("DBG:theActivationToken: "+activationToken); - theDoc = partialDocument(theDoc, documentOffset); - // System.out.println("DBG:theDoc: "+theDoc); - PythonInterpreter interp = initInterpreter(null); - java.lang.String qualifier = getQualifier(doc, documentOffset); - int qlen = qualifier.length(); - try { - System.out.println("Interpreted doc: "+theDoc); - PyList theList = autoComplete(interp, theDoc, activationToken); - PyObject o = new PyObject(); - for (int i = 0; i < theList.__len__(); i++) { - String p = theList.__getitem__(i).toString(); - // System.out.println("Item:" + p); - CompletionProposal proposal = - new CompletionProposal( - p, - documentOffset - qlen, - qlen, - p.length()); - propList.add(proposal); - } - - } catch (PyException e) { - e.printStackTrace(); - } - - PyObject theCode = null; - - ICompletionProposal[] proposals = - new ICompletionProposal[propList.size()]; - // and fill with list elements - propList.toArray(proposals); - // Return the proposals - return proposals; - - } - private PyList autoComplete( - PythonInterpreter interp, - java.lang.String theCode, - java.lang.String theActivationToken) - throws PyException { - StringBuffer example = new StringBuffer(); - interp.exec("from PyDev import jintrospect"); - // System.out.println("DBG:from PyDev import jintrospect:done"); - interp.exec("class object:pass"); //TODO: REMOVE AFTER JYTHON ADDS SUPPORT TO NEW STYLE CLASSES. - interp.exec(theCode); - String xCommand = "theList = jintrospect.getAutoCompleteList(command='"+theActivationToken+"', locals=locals())"; - // System.out.println("DBG:xCommand:"+xCommand); - interp.exec(xCommand); - PyList theList = (PyList) interp.get("theList"); - return theList; - } - - /** - * @param qualifier - * @param documentOffset - * @param proposals - */ - public void calcDocBoundary(String theDoc, int documentOffset){ - this.docBoundary = theDoc.substring(0, documentOffset).lastIndexOf('\n'); - } - public String getActivationToken(String theDoc, int documentOffset) { - if (this.docBoundary < 0){ - calcDocBoundary(theDoc,documentOffset); - } - return theDoc.substring(this.docBoundary+1, documentOffset); - } - - /** - * @param theDoc - */ - private String partialDocument(String theDoc, int documentOffset) { - if (this.docBoundary < 0){ - calcDocBoundary(theDoc,documentOffset); - } - - String before = theDoc.substring(0, this.docBoundary); - return before; - } - /** - * @param doc - * @param documentOffset - */ - private java.lang.String getQualifier(IDocument doc, int documentOffset) { - // this routine should return any partial entry after the activation character - return ""; - } ! /* (non-Javadoc) ! * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeContextInformation(org.eclipse.jface.text.ITextViewer, int) ! */ ! public IContextInformation[] computeContextInformation( ! ITextViewer viewer, ! int documentOffset) { ! // TODO Auto-generated method stub ! return null; ! } ! /* (non-Javadoc) ! * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getCompletionProposalAutoActivationCharacters() ! */ ! public char[] getCompletionProposalAutoActivationCharacters() { ! return new char[] { '.', '(' , '['}; ! } ! /* (non-Javadoc) ! * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationAutoActivationCharacters() ! */ ! public char[] getContextInformationAutoActivationCharacters() { ! // is this _really_ what we want to use?? ! return new char[] { '.' }; ! } ! /* (non-Javadoc) ! * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getErrorMessage() ! */ ! public java.lang.String getErrorMessage() { ! // TODO Auto-generated method stub ! return null; ! } ! /* (non-Javadoc) ! * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationValidator() ! */ ! public IContextInformationValidator getContextInformationValidator() { ! // TODO Auto-generated method stub ! return null; ! } ! // 1. create the PythonSystemState with the embedded $py.class files inserted into its path ! // 2. ! protected PythonInterpreter initInterpreter(java.lang.String[] argv) { ! Properties p = System.getProperties(); ! // p.setProperty("python.path", "c:\\Jython\\Lib"); ! PySystemState.initialize(); ! PythonInterpreter.initialize(System.getProperties(), p, null); ! return new PythonInterpreter(null, createPySystemState()); ! } ! /** ! * Create a new Python interpreter system state object aware for standard ! * Jython library. ! * ! * @return Python interpreter system state. ! * ! * @throws JythonRuntimeException if it fails to locate the Jython ! * libraries. The exception message will contain an explanation of the ! * reason to fail. ! */ ! private String _jythonLib = null; ! public PySystemState createPySystemState() { ! if (_jythonLib == null) { ! // Locate org.jython plugin and grab the jar location ! Plugin jythonPlugin = Platform.getPlugin("org.pydev.jython"); ! String jythonPath = ! jythonPlugin.getDescriptor().getInstallURL().toString() + "jythonlib.jar"; ! try { ! _jythonLib = Platform.asLocalURL(new URL(jythonPath)).getFile(); ! // System.out.println("_jythonLib:"+_jythonLib); ! } catch (MalformedURLException e) { ! System.out.println( ! "Failed to located Python System library because of invalid URL."+ ! e); ! } catch (IOException e) { ! System.out.println( ! "Failed to located Python System library because of IO Error."+ ! e); ! } ! } ! PySystemState result = new PySystemState(); ! result.path.insert(0, new PyString(_jythonLib + "/Lib")); ! // System.out.println("result.path: "+result.path); ! // Location of the jython/python modules ! return result; ! } } --- 7,268 ---- package org.python.pydev.editor; import org.eclipse.jface.text.ITextViewer; import org.eclipse.jface.text.contentassist.ICompletionProposal; import org.eclipse.jface.text.contentassist.IContentAssistProcessor; import org.eclipse.jface.text.contentassist.IContextInformation; import org.eclipse.jface.text.contentassist.IContextInformationValidator; ! public class PythonCompletionProcessor implements IContentAssistProcessor { ! /* (non-Javadoc) ! * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(org.eclipse.jface.text.ITextViewer, int) ! */ ! public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) { ! // TODO Auto-generated method stub ! return null; ! } ! /* (non-Javadoc) ! * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeContextInformation(org.eclipse.jface.text.ITextViewer, int) ! */ ! public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) { ! // TODO Auto-generated method stub ! return null; ! } ! /* (non-Javadoc) ! * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getCompletionProposalAutoActivationCharacters() ! */ ! public char[] getCompletionProposalAutoActivationCharacters() { ! // TODO Auto-generated method stub ! return null; ! } ! /* (non-Javadoc) ! * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationAutoActivationCharacters() ! */ ! public char[] getContextInformationAutoActivationCharacters() { ! // TODO Auto-generated method stub ! return null; ! } ! /* (non-Javadoc) ! * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getErrorMessage() ! */ ! public String getErrorMessage() { ! // TODO Auto-generated method stub ! return null; ! } + /* (non-Javadoc) + * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationValidator() + */ + public IContextInformationValidator getContextInformationValidator() { + // TODO Auto-generated method stub + return null; + } } + ///** + // * @author Dmoore + // * + // * To change the template for this generated type comment go to + // * Window>Preferences>Java>Code Generation>Code and Comments + // */ + //public class PythonCompletionProcessor implements IContentAssistProcessor { + // + // /* (non-Javadoc) + // * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(org.eclipse.jface.text.ITextViewer, int) + // */ + // int docBoundary = -1; // the document prior to the activation token + // int docBoundary2 = 0; + // public ICompletionProposal[] computeCompletionProposals( + // ITextViewer viewer, + // int documentOffset) { + // List propList = new ArrayList(); + // IDocument doc = viewer.getDocument(); + // // System.out.println("The document:"+doc.get()); + // Point selectedRange = viewer.getSelectedRange(); + // // there may not be a selected range + // java.lang.String theDoc = doc.get(); + // calcDocBoundary(theDoc, documentOffset); + // String activationToken = this.getActivationToken(theDoc, documentOffset); + //// System.out.println("DBG:theActivationToken: "+activationToken); + // theDoc = partialDocument(theDoc, documentOffset); + //// System.out.println("DBG:theDoc: "+theDoc); + // PythonInterpreter interp = initInterpreter(null); + // java.lang.String qualifier = getQualifier(doc, documentOffset); + // int qlen = qualifier.length(); + // try { + // System.out.println("Interpreted doc: "+theDoc); + // PyList theList = autoComplete(interp, theDoc, activationToken); + // PyObject o = new PyObject(); + // for (int i = 0; i < theList.__len__(); i++) { + // String p = theList.__getitem__(i).toString(); + //// System.out.println("Item:" + p); + // CompletionProposal proposal = + // new CompletionProposal( + // p, + // documentOffset - qlen, + // qlen, + // p.length()); + // propList.add(proposal); + // } + // + // } catch (PyException e) { + // e.printStackTrace(); + // } + // + // PyObject theCode = null; + // + // ICompletionProposal[] proposals = + // new ICompletionProposal[propList.size()]; + // // and fill with list elements + // propList.toArray(proposals); + // // Return the proposals + // return proposals; + // + // } + // private PyList autoComplete( + // PythonInterpreter interp, + // java.lang.String theCode, + // java.lang.String theActivationToken) + // throws PyException { + // StringBuffer example = new StringBuffer(); + // interp.exec("from PyDev import jintrospect"); + //// System.out.println("DBG:from PyDev import jintrospect:done"); + // interp.exec("class object:pass"); //TODO: REMOVE AFTER JYTHON ADDS SUPPORT TO NEW STYLE CLASSES. + // interp.exec(theCode); + // String xCommand = "theList = jintrospect.getAutoCompleteList(command='"+theActivationToken+"', locals=locals())"; + //// System.out.println("DBG:xCommand:"+xCommand); + // interp.exec(xCommand); + // PyList theList = (PyList) interp.get("theList"); + // return theList; + // } + // + // /** + // * @param qualifier + // * @param documentOffset + // * @param proposals + // */ + // public void calcDocBoundary(String theDoc, int documentOffset){ + // this.docBoundary = theDoc.substring(0, documentOffset).lastIndexOf('\n'); + // } + // public String getActivationToken(String theDoc, int documentOffset) { + // if (this.docBoundary < 0){ + // calcDocBoundary(theDoc,documentOffset); + // } + // return theDoc.substring(this.docBoundary+1, documentOffset); + // } + // + // /** + // * @param theDoc + // */ + // private String partialDocument(String theDoc, int documentOffset) { + // if (this.docBoundary < 0){ + // calcDocBoundary(theDoc,documentOffset); + // } + // + // String before = theDoc.substring(0, this.docBoundary); + // return before; + // + // } + // + // /** + // * @param doc + // * @param documentOffset + // */ + // private java.lang.String getQualifier(IDocument doc, int documentOffset) { + // // this routine should return any partial entry after the activation character + // return ""; + // } + // + // /* (non-Javadoc) + // * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeContextInformation(org.eclipse.jface.text.ITextViewer, int) + // */ + // public IContextInformation[] computeContextInformation( + // ITextViewer viewer, + // int documentOffset) { + // // TODO Auto-generated method stub + // return null; + // } + // + // /* (non-Javadoc) + // * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getCompletionProposalAutoActivationCharacters() + // */ + // public char[] getCompletionProposalAutoActivationCharacters() { + // return new char[] { '.', '(' , '['}; + // } + // + // /* (non-Javadoc) + // * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationAutoActivationCharacters() + // */ + // public char[] getContextInformationAutoActivationCharacters() { + // // is this _really_ what we want to use?? + // return new char[] { '.' }; + // } + // + // /* (non-Javadoc) + // * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getErrorMessage() + // */ + // public java.lang.String getErrorMessage() { + // // TODO Auto-generated method stub + // return null; + // } + // + // /* (non-Javadoc) + // * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationValidator() + // */ + // public IContextInformationValidator getContextInformationValidator() { + // // TODO Auto-generated method stub + // return null; + // } + //// 1. create the PythonSystemState with the embedded $py.class files inserted into its path + //// 2. + // protected PythonInterpreter initInterpreter(java.lang.String[] argv) { + // Properties p = System.getProperties(); + //// p.setProperty("python.path", "c:\\Jython\\Lib"); + // PySystemState.initialize(); + // PythonInterpreter.initialize(System.getProperties(), p, null); + // return new PythonInterpreter(null, createPySystemState()); + // } + // /** + // * Create a new Python interpreter system state object aware for standard + // * Jython library. + // * + // * @return Python interpreter system state. + // * + // * @throws JythonRuntimeException if it fails to locate the Jython + // * libraries. The exception message will contain an explanation of the + // * reason to fail. + // */ + // private String _jythonLib = null; + // public PySystemState createPySystemState() { + // if (_jythonLib == null) { + // // Locate org.jython plugin and grab the jar location + // Plugin jythonPlugin = Platform.getPlugin("org.pydev.jython"); + // + // String jythonPath = + // jythonPlugin.getDescriptor().getInstallURL().toString() + "jythonlib.jar"; + // try { + // _jythonLib = Platform.asLocalURL(new URL(jythonPath)).getFile(); + //// System.out.println("_jythonLib:"+_jythonLib); + // } catch (MalformedURLException e) { + // System.out.println( + // "Failed to located Python System library because of invalid URL."+ + // e); + // } catch (IOException e) { + // System.out.println( + // "Failed to located Python System library because of IO Error."+ + // e); + // } + // } + // PySystemState result = new PySystemState(); + // result.path.insert(0, new PyString(_jythonLib + "/Lib")); + //// System.out.println("result.path: "+result.path); + // // Location of the jython/python modules + // return result; + // } + // + //} |