pydev-code Mailing List for PyDev for Eclipse (Page 36)
Brought to you by:
fabioz
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
(14) |
Apr
(18) |
May
(12) |
Jun
(34) |
Jul
(31) |
Aug
(37) |
Sep
(22) |
Oct
(2) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(1) |
Feb
(4) |
Mar
(9) |
Apr
(1) |
May
|
Jun
(2) |
Jul
(24) |
Aug
(3) |
Sep
(5) |
Oct
(3) |
Nov
(3) |
Dec
(5) |
2006 |
Jan
(5) |
Feb
(23) |
Mar
(5) |
Apr
(80) |
May
(26) |
Jun
(13) |
Jul
(13) |
Aug
(4) |
Sep
(31) |
Oct
(24) |
Nov
(6) |
Dec
(2) |
2007 |
Jan
(7) |
Feb
|
Mar
(26) |
Apr
(3) |
May
(8) |
Jun
(6) |
Jul
(11) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
(9) |
Dec
(3) |
2008 |
Jan
(7) |
Feb
(1) |
Mar
(6) |
Apr
(7) |
May
(9) |
Jun
(14) |
Jul
(9) |
Aug
(6) |
Sep
(10) |
Oct
(5) |
Nov
(8) |
Dec
(5) |
2009 |
Jan
(8) |
Feb
(10) |
Mar
(10) |
Apr
(1) |
May
(3) |
Jun
(5) |
Jul
(10) |
Aug
(3) |
Sep
(12) |
Oct
(6) |
Nov
(22) |
Dec
(12) |
2010 |
Jan
(10) |
Feb
(17) |
Mar
(5) |
Apr
(9) |
May
(8) |
Jun
(2) |
Jul
(4) |
Aug
(12) |
Sep
(1) |
Oct
(1) |
Nov
(8) |
Dec
|
2011 |
Jan
(14) |
Feb
(8) |
Mar
(3) |
Apr
(11) |
May
(6) |
Jun
(5) |
Jul
(10) |
Aug
(7) |
Sep
|
Oct
(4) |
Nov
(4) |
Dec
(8) |
2012 |
Jan
|
Feb
(8) |
Mar
(10) |
Apr
(5) |
May
(4) |
Jun
(10) |
Jul
|
Aug
(2) |
Sep
(2) |
Oct
(11) |
Nov
(1) |
Dec
|
2013 |
Jan
(1) |
Feb
(2) |
Mar
(11) |
Apr
(10) |
May
(7) |
Jun
(9) |
Jul
(13) |
Aug
(20) |
Sep
(4) |
Oct
(18) |
Nov
(5) |
Dec
(7) |
2014 |
Jan
(3) |
Feb
(5) |
Mar
(7) |
Apr
(5) |
May
(10) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(7) |
Oct
(1) |
Nov
(1) |
Dec
(1) |
2015 |
Jan
(1) |
Feb
(1) |
Mar
(8) |
Apr
(3) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
(2) |
Sep
(1) |
Oct
(3) |
Nov
(5) |
Dec
(1) |
2016 |
Jan
(26) |
Feb
(10) |
Mar
(4) |
Apr
|
May
(4) |
Jun
(3) |
Jul
|
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(4) |
Dec
(3) |
2017 |
Jan
(3) |
Feb
|
Mar
(9) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
(9) |
Sep
(1) |
Oct
|
Nov
(2) |
Dec
|
2018 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(4) |
Oct
(2) |
Nov
(1) |
Dec
(3) |
2019 |
Jan
(4) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
|
Sep
|
Oct
(3) |
Nov
|
Dec
|
2020 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(4) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(11) |
2021 |
Jan
(3) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2024 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
From: Fabio Z. <fa...@gm...> - 2006-06-03 09:53:47
|
I've answered you in the other msg in the forum (pointing to the getting started guide)... have you checked it? On 5/26/06, Timothy Reaves <tr...@si...> wrote: > > For PyDev - PYTHONPATH I have my project (root folder) in the > Project Source Folder, and in the External Source Folders I have / > zope/Products. For those unfamiliar, with Zope, products that can be > installed are in this folder. So one of the folders under Products is > Archetypes. My class extends one of the classes in Archetypes. > > class MyClass(OrderedBaseFolder): > > PyDev can not find OrderedBaseFolder. I have tried to add /zope/ > Products/Archetypes to the ESF's but to no avail. > > Any ideas? Thanks! > > > ------------------------------------------------------- > All the advantages of Linux Managed Hosting--Without the Cost and Risk! > Fully trained technicians. The highest number of Red Hat certifications in > the hosting industry. Fanatical Support. Click to learn more > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > |
From: Fabio Z. <fa...@gm...> - 2006-06-03 09:52:35
|
Hi Timothy, Well, I haven't gotten zope myself, so, I think I should get it to see how it works, but I don't know when I'll be able to get it so that I can help you further... I've passed another message (regarding turbogears) in the forum, where I give some tips on how to check the debugger... ( https://sourceforge.net/forum/message.php?msg_id=3761753) so, if you have time and can check it yourself, it would be great (I can give you tips on things you want to know about), or you can wait for me, but I don't know when I'll be able to get zope to try it myself... Cheers, Fabio On 5/26/06, Timothy Reaves <tr...@si...> wrote: > > O.K., I believe I have everything configured properly. I have my > Eclipse workspace added to my zope.conf file as a Products entry, and > this works, as I could then install into Plone. I can run, and > interact with the code. When an error or warning happens, I can > click that line and the file opens. All well and good. But I can't > seem to debug. > > I have created a Zope Run instance (as per the Plone site). I run > this in debug mode. I set a breakpoint (or several). When that code > gets executed, no breakpoint is hit. > > After starting is debug mode, is there anything that needs to be > done to connect to the python engine? Is just setting a breakpoint > sufficient? Has anyone else debugged Zope or Plone products under > PyDev? > > Thanks. > > > ------------------------------------------------------- > All the advantages of Linux Managed Hosting--Without the Cost and Risk! > Fully trained technicians. The highest number of Red Hat certifications in > the hosting industry. Fanatical Support. Click to learn more > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > |
From: Timothy R. <tr...@si...> - 2006-05-27 01:22:05
|
For PyDev - PYTHONPATH I have my project (root folder) in the Project Source Folder, and in the External Source Folders I have / zope/Products. For those unfamiliar, with Zope, products that can be installed are in this folder. So one of the folders under Products is Archetypes. My class extends one of the classes in Archetypes. class MyClass(OrderedBaseFolder): PyDev can not find OrderedBaseFolder. I have tried to add /zope/ Products/Archetypes to the ESF's but to no avail. Any ideas? Thanks! |
From: Timothy R. <tr...@si...> - 2006-05-27 00:56:19
|
O.K., I believe I have everything configured properly. I have my Eclipse workspace added to my zope.conf file as a Products entry, and this works, as I could then install into Plone. I can run, and interact with the code. When an error or warning happens, I can click that line and the file opens. All well and good. But I can't seem to debug. I have created a Zope Run instance (as per the Plone site). I run this in debug mode. I set a breakpoint (or several). When that code gets executed, no breakpoint is hit. After starting is debug mode, is there anything that needs to be done to connect to the python engine? Is just setting a breakpoint sufficient? Has anyone else debugged Zope or Plone products under PyDev? Thanks. |
From: Fabio Z. <fa...@gm...> - 2006-05-26 10:28:14
|
You should try to create the markers with the Pydev marker utils: from org.python.pydev.builder import PydevMarkerUtils with the method: createMarker(IResource resource, IDocument doc, String message, int lineNumber, String markerType, int severity, boolean userEditable, boolean istransient, List<IMarker> existingMarkers) You can see an example that uses it at http://pydev.cvs.sourceforge.net/pydev/org.python.pydev/src/org/python/pyde= v/builder/todo/PyTodoVisitor.java?view=3Dmarkup If that does fail, you can try doing a refreshLocal (but I don't really think it should be needed): from org.eclipse.core.resources import IResource from org.eclipse.core.runtime import NullProgressMonitor resource.refreshLocal(IResource.DEPTH_ZERO, NullProgressMonitor()) Cheers, Fabio On 5/26/06, Don Taylor <nos...@gm...> wrote: > > Hi Fabio: > > I am trying to write an extension to bookmark all occurrences of a > selection but I am having trouble getting the bookmark icons to show up > unless the file is closed and re-opened again. > > I have the following code: > > class BookmarkOccurrences(Action): > def run(self): > selection =3D PySelection(editor) > line =3D selection.getCursorLine() > > resource =3D editor.getIFile() > if not resource: > log("Did not get a file resource") > return # Give up. > > marker =3D resource.createMarker(IMarker.BOOKMARK) > if not marker: > log("Did not get a marker") > return # Give up > > marker.setAttribute(IMarker.MESSAGE, "This is my marker") > marker.setAttribute(IMarker.LINE_NUMBER, line) > > When this code is executed in a Pydev extension the bookmark shows up > immediately in the bookmark view, but the little symbol does not show up > until the file is closed and re-opened. > > As far as I can tell the file is synchonized, and I have tried touching > the file to make sure that it is up to date. > > resource.touch(None) > if resource.isSynchronized(IResource.DEPTH_INFINITE): > log("Resource is synchonized") > > Any suggestions? > > Thanks, > > Don. > > > ------------------------------------------------------- > All the advantages of Linux Managed Hosting--Without the Cost and Risk! > Fully trained technicians. The highest number of Red Hat certifications i= n > the hosting industry. Fanatical Support. Click to learn more > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D107521&bid=3D248729&dat= =3D121642 > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > |
From: Don T. <nos...@gm...> - 2006-05-26 03:20:57
|
Hi Fabio: I am trying to write an extension to bookmark all occurrences of a selection but I am having trouble getting the bookmark icons to show up unless the file is closed and re-opened again. I have the following code: class BookmarkOccurrences(Action): def run(self): selection = PySelection(editor) line = selection.getCursorLine() resource = editor.getIFile() if not resource: log("Did not get a file resource") return # Give up. marker = resource.createMarker(IMarker.BOOKMARK) if not marker: log("Did not get a marker") return # Give up marker.setAttribute(IMarker.MESSAGE, "This is my marker") marker.setAttribute(IMarker.LINE_NUMBER, line) When this code is executed in a Pydev extension the bookmark shows up immediately in the bookmark view, but the little symbol does not show up until the file is closed and re-opened. As far as I can tell the file is synchonized, and I have tried touching the file to make sure that it is up to date. resource.touch(None) if resource.isSynchronized(IResource.DEPTH_INFINITE): log("Resource is synchonized") Any suggestions? Thanks, Don. |
From: Fabio Z. <fa...@gm...> - 2006-05-24 20:01:41
|
Hi All, Pydev and Pydev Extensions 1.0.8 have been released Check http://www.fabioz.com/pydev for details on Pydev Extensions and http://pydev.sf.net for details on Pydev This is a 'single-bugfix' release because of a major bug that could cause Pydev to hang when making a new line under certain condations. What is PyDev? --------------------------- PyDev is a plugin that enables users to use Eclipse for Python and Jython development -- making Eclipse a first class Python IDE -- It comes with man= y goodies such as code completion, syntax highlighting, syntax analysis, refactor, debug and many others. Cheers, --=20 Fabio Zadrozny ------------------------------------------------------ Software Developer ESSS - Engineering Simulation and Scientific Software http://www.esss.com.br Pydev Extensions http://www.fabioz.com/pydev Pydev - Python Development Enviroment for Eclipse http://pydev.sf.net http://pydev.blogspot.com |
From: Fabio Z. <fa...@gm...> - 2006-05-23 19:25:31
|
Hi Don, Well, I usually look at http://sourceforge.net/docs/a04 (which is pointing that the cvs will be down for 30 minutes, so, should be shortly up again). You can get the code from the released source (I'm putting it in sourceforg= e for download in the same place the binary distribution is available -- http://sourceforge.net/projects/pydev) -- Fabio On 5/23/06, Don Taylor <nos...@gm...> wrote: > > I have tried several times today to refresh my source to 1.0.7 but SF > always refuses my connection. > > Has something changed? Or is it SF being it's usual PITA? > > Don. > > > ------------------------------------------------------- > All the advantages of Linux Managed Hosting--Without the Cost and Risk! > Fully trained technicians. The highest number of Red Hat certifications i= n > the hosting industry. Fanatical Support. Click to learn more > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D107521&bid=3D248729&dat= =3D121642 > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > |
From: Don T. <nos...@gm...> - 2006-05-23 19:20:11
|
I have tried several times today to refresh my source to 1.0.7 but SF always refuses my connection. Has something changed? Or is it SF being it's usual PITA? Don. |
From: Fabio Z. <fa...@gm...> - 2006-05-22 20:42:30
|
Hi All, Pydev and Pydev Extensions 1.0.7 have been released Check http://www.fabioz.com/pydev for details on Pydev Extensions and http://pydev.sf.net for details on Pydev Release Highlights in Pydev Extensions: ----------------------------------------------------------------- - Mark Occurrences is able to highlight all the occurrences of some token i= n a file (and is python-aware) - Rename Occurrences is able to rename all the occurrences of some token in a file (Ctrl+2+R) - Hierarchy view is final (can now find children classes in referencing modules) - Remote debugger - Can redirect the output to the client (the signature for starting the remote debugger became settrace(host=3D'localhost', stdoutToServer =3D False, stderrToServer =3D False)) - Maps the locations from the server to the client even if they are not in the same exact paths - Force code-analysis in the current editor (Ctrl+2+C) Release Highlights in Pydev: ---------------------------------------------- - Assign variables to attributes (Ctrl+2+a): Contributed by Joel Hedlund (this is the first contribution using the new jython scripting engine). - 3 minor 'quirks' were fixed in the indentation engine - The debugger had some changes (so, if you had halts with it, please try i= t again). - Allow changing the keybinding for activating the Find next problem (Ctrl+.) - The debugger step-return had its behaviour changed. - Additional scripts location added to pythonpath in the jython scripting engine - Transversal of nested references improved - Fixed problems with compiled modules when they had 'nested' module structures (e.g.: wx.glcanvas) What is PyDev? --------------------------- PyDev is a plugin that enables users to use Eclipse for Python and Jython development -- making Eclipse a first class Python IDE -- It comes with man= y goodies such as code completion, syntax highlighting, syntax analysis, refactor, debug and many others. Cheers, --=20 Fabio Zadrozny ------------------------------------------------------ Software Developer ESSS - Engineering Simulation and Scientific Software http://www.esss.com.br Pydev Extensions http://www.fabioz.com/pydev Pydev - Python Development Enviroment for Eclipse http://pydev.sf.net http://pydev.blogspot.com |
From: Don T. <nos...@gm...> - 2006-05-21 16:46:34
|
Fabio Zadrozny wrote: > I've checked it, and I have some suggestions: > 1. Instead of having 80 as the default, you could use the preferences > the user specified as its print margin: > > from org.python.pydev.plugin import PydevPlugin > from org.eclipse.ui.texteditor import > AbstractDecoratedTextEditorPreferenceConstants > cols = > PydevPlugin.getChainedPrefStore().getInt(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN > ); > That is really good. Done - I have updated the version on the web page: http://pilger.googlepages.com/pydevstuff Actually, this brings up an observation about Pydev extension scripts: there is no mechanism to allow a script to have preferences. I don't know how you could provide one, but it would be nice. > 2. When you try to indent the following: > > #_line_to_wrap1_eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee > # class Foo: > # def m1(): > # pass > #_line_to_wrap2_eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee > > if you start doing it at the first line, it will stop there, and not get > the full comment block (so, I think it could indent all that started > with '#' + character, instead of bailing out when it finds the first '#' > + space) I have kept this thing simple as I did not want to get into analyzing what the text actually is (code or text) because then I would have to do different things. If it is indented multiline text then I should rewrap it to the new indentation, if it is a bunch of lines of code starting at the same indent then I should leave them alone. I don't know how to distinguish: # This is line one, # and this is line two that should be wrapped. from: # print "This is line one, " # print " and this is line two that should not be wrapped." Your observation would also apply to lines inside multiline docstrings. I bailed on doing this much analysis. I bailed on rewrapping more than one paragraph and I even bailed on handling the first line of a docstring. I may do more later but so far I have not found these restrictions too much of a burden, especially when compared to reformatting comments by hand. I think that this thing obeys the Pareto Principle - it does 80% of what I want for 20% of the effort required to do it completely. Don |
From: Fabio Z. <fa...@gm...> - 2006-05-21 11:08:00
|
On 5/21/06, Don Taylor <nos...@gm...> wrote: > > Folks: > > I have written a Pydev script that wraps comment paragraphs in Python or > Jython in Eclipse. I would be grateful if you could try it out and let > me know about any bugs or suggestions for improving the code. > Hi Don, I've checked it, and I have some suggestions: 1. Instead of having 80 as the default, you could use the preferences the user specified as its print margin: from org.python.pydev.plugin import PydevPlugin from org.eclipse.ui.texteditor import AbstractDecoratedTextEditorPreferenceConstants cols =3D PydevPlugin.getChainedPrefStore().getInt( AbstractDecoratedTextEditorPreferenceConstants.EDITOR_PRINT_MARGIN_COLUMN); 2. When you try to indent the following: #_line_to_wrap1_eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee= eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee # class Foo: # def m1(): # pass #_line_to_wrap2_eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee= eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee if you start doing it at the first line, it will stop there, and not get th= e full comment block (so, I think it could indent all that started with '#' + character, instead of bailing out when it finds the first '#' + space) Cheers, Fabio |
From: Don T. <nos...@gm...> - 2006-05-21 04:26:09
|
Folks: I have written a Pydev script that wraps comment paragraphs in Python or Jython in Eclipse. I would be grateful if you could try it out and let me know about any bugs or suggestions for improving the code. You can download it from: http://pilger.googlepages.com/pydevstuff This article tells you how to setup a Pydev Jython script in Eclipse: http://www.fabioz.com/pydev/manual_articles_scripting.html Thanks, Don. |
From: Don T. <nos...@gm...> - 2006-05-21 04:03:07
|
Fabio Zadrozny wrote: > Well, the problem is that you need to run it from an UI-thread. The code > below shows a helper to do it: > Fabio: Thanks very much, works great. Don. |
From: Fabio Z. <fa...@gm...> - 2006-05-20 15:44:07
|
Hi Don, On 5/19/06, Don Taylor <nos...@gm...> wrote: > > > When I run your code outside the action listener then it works, but when > it is inside the action listeners run() then it does not display anything= . > Well, the problem is that you need to run it from an UI-thread. The code below shows a helper to do it: if cmd =3D=3D 'onCreateActions': from org.eclipse.jface.action import Action from org.python.pydev.core.docutils import PySelection from org.eclipse.ui.texteditor import IEditorStatusLine from org.eclipse.swt.widgets import Display from java.lang import Runnable #------------------------------------------------ HELPER TO RUN THINGS IN THE UI class RunInUi(Runnable): '''Helper class that implements a Runnable (just so that we can pass it to the Java side). It simply calls some callable. ''' def __init__(self, c): self.callable =3D c def run(self): self.callable() def runInUi(callable): ''' @param callable: the callable that will be run in the UI ''' Display.getDefault().asyncExec(RunInUi(callable)) #------------------------------------------------ END HELPER TO RUN THINGS IN THE UI class ExampleCommand3(Action): def run(self): def callable(): statusLine =3D editor.getAdapter(IEditorStatusLine) if statusLine is not None: statusLine.setMessage(True, "foo", None) runInUi(callable) editor.addOfflineActionListener("e", ExampleCommand3(), 'Example on how to bind script action', False) |
From: Don T. <nos...@gm...> - 2006-05-19 19:40:45
|
Fabio Zadrozny wrote: > Strange, I just tested it here and it worked... it appears in the > lower-left corner for me (and if you pass the setMessage with the first > parameter True, it will appear in red). > > > The script I tested here is: > pyedit_test.py > ------------------------------------------------------------- > > if False: > editor = '' > > from org.eclipse.ui.texteditor import IEditorStatusLine > > statusLine = editor.getAdapter(IEditorStatusLine) > if statusLine is not None: > statusLine.setMessage(True, "foo", None) > ----------------------------------------------------------------- Hmmm... When I run your code outside the action listener then it works, but when it is inside the action listeners run() then it does not display anything. Don. |
From: Fabio Z. <fa...@gm...> - 2006-05-19 18:51:53
|
Strange, I just tested it here and it worked... it appears in the lower-lef= t corner for me (and if you pass the setMessage with the first parameter True= , it will appear in red). The script I tested here is: pyedit_test.py ------------------------------------------------------------- if False: editor =3D '' from org.eclipse.ui.texteditor import IEditorStatusLine statusLine =3D editor.getAdapter(IEditorStatusLine) if statusLine is not None: statusLine.setMessage(True, "foo", None) ----------------------------------------------------------------- -- Fabio On 5/19/06, Don Taylor <nos...@gm...> wrote: > > Fabio Zadrozny wrote: > > Actually, you probably want to ask the status manager to the editor. > > Something as below (untested): > > > > statusLine =3D editor.getAdapter(IEditorStatusLine.class); > > if statusLine is not None: > > statusLine.setMessage(False, "foo", None) > > > Fabio: > > My code looks like this: > > if cmd =3D=3D 'onCreateActions': > from org.eclipse.jface.action import Action > from org.python.pydev.core.docutils import PySelection > from org.eclipse.ui.texteditor import IEditorStatusLine > > > #-Paragrapher------------------------------------------------------------= --- > > class Paragrapher: > ''' Provides tools to process a paragraph of text in the Pydev > editor. > > ''' > def __init__(self): > > self.selection =3D PySelection(editor) > self.document =3D editor.getDocument() > > self.statusLine =3D editor.getAdapter(IEditorStatusLine) > print "statusLine %s" % self.statusLine > if self.statusLine is not None: > self.statusLine.setMessage(False, "foo", None) > > > When I run this I get: > > statusLine org.eclipse.ui.texteditor.EditorStatusLine@1133f56 > > on the console - which I think is good? > > But I don't see my message showing up anywhere. > > DOn. > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim= o > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > |
From: Don T. <nos...@gm...> - 2006-05-19 18:36:40
|
Fabio Zadrozny wrote: > Actually, you probably want to ask the status manager to the editor. > Something as below (untested): > > statusLine = editor.getAdapter(IEditorStatusLine.class); > if statusLine is not None: > statusLine.setMessage(False, "foo", None) > Fabio: My code looks like this: if cmd == 'onCreateActions': from org.eclipse.jface.action import Action from org.python.pydev.core.docutils import PySelection from org.eclipse.ui.texteditor import IEditorStatusLine #-Paragrapher--------------------------------------------------------------- class Paragrapher: ''' Provides tools to process a paragraph of text in the Pydev editor. ''' def __init__(self): self.selection = PySelection(editor) self.document = editor.getDocument() self.statusLine = editor.getAdapter(IEditorStatusLine) print "statusLine %s" % self.statusLine if self.statusLine is not None: self.statusLine.setMessage(False, "foo", None) When I run this I get: statusLine org.eclipse.ui.texteditor.EditorStatusLine@1133f56 on the console - which I think is good? But I don't see my message showing up anywhere. DOn. |
From: Fabio Z. <fa...@gm...> - 2006-05-19 17:08:34
|
Actually, you probably want to ask the status manager to the editor. Something as below (untested): statusLine =3D editor.getAdapter(IEditorStatusLine.class); if statusLine is not None: statusLine.setMessage(False, "foo", None) On 5/19/06, Don Taylor <nos...@gm...> wrote: > > Fabio: > > I am trying to write a message to the status area on the bottom of the > Eclipse screen, but I can't get it working. > > This is what I have so far: > > if cmd =3D=3D 'onCreateActions': > ... > from org.eclipse.jface.action import StatusLineManager > > ... > > self.statusLine =3D StatusLineManager() > self.statusLine.setMessage("hello") > self.statusLine.update(True) > > Maybe I need to call createControl() but I don't know what to supply as > the 'parent' parameter. > > Any pointers will be appreciated. > > Don. > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim= o > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 > _______________________________________________ > pydev-code mailing list > pyd...@li... > https://lists.sourceforge.net/lists/listinfo/pydev-code > |
From: Don T. <nos...@gm...> - 2006-05-19 16:20:30
|
Fabio: I am trying to write a message to the status area on the bottom of the Eclipse screen, but I can't get it working. This is what I have so far: if cmd == 'onCreateActions': ... from org.eclipse.jface.action import StatusLineManager ... self.statusLine = StatusLineManager() self.statusLine.setMessage("hello") self.statusLine.update(True) Maybe I need to call createControl() but I don't know what to supply as the 'parent' parameter. Any pointers will be appreciated. Don. |
From: Fabio Z. <fa...@gm...> - 2006-05-18 12:59:55
|
Hi Don, On 5/18/06, Don Taylor <nos...@gm...> wrote: > > Fabio: > > Is there a way to get at the pythonpath for the underlying project? In the script: editor.getPythonNature().getPythonPathNature().getCompletePr= ojectPythonPath() you can view the interface for editor.getPythonNature().getPythonPathNature= () to see what else is available at: http://pydev.cvs.sourceforge.net/pydev/org.python.pydev.core/src/org/python= /pydev/core/IPythonPathNature.java?view=3Dmarkup -- Fabio |
From: Don T. <nos...@gm...> - 2006-05-18 12:51:33
|
Fabio: Is there a way to get at the pythonpath for the underlying project? Don. |
From: Fabio Z. <fa...@gm...> - 2006-05-15 22:19:18
|
Hi Don, On 5/15/06, Don Taylor <nos...@gm...> wrote: > > Fabio: > > I am having a strange problem with syntax coloring in a Jython file. > > My Pydev extension under development allows you to rewrap comments in > Python/Jython files. It is mostly working except for one strange case: > > I ask it to wrap the first paragraph in the following docstring: > > class TextWrapper: > """ ... > """ > > and the text is wrapped fine except that the code that follows is now > colored as if it were a string too. However, if I save the file as it > now is and re-open it then it comes back colored the way it should be > (and it runs OK). > That's a known bug: https://sourceforge.net/tracker/index.php?func=3Ddetail&aid=3D1402165&group= _id=3D85796&atid=3D577329 |
From: Don T. <nos...@gm...> - 2006-05-15 20:44:37
|
Fabio: I am having a strange problem with syntax coloring in a Jython file. My Pydev extension under development allows you to rewrap comments in Python/Jython files. It is mostly working except for one strange case: I ask it to wrap the first paragraph in the following docstring: class TextWrapper: """ Object for wrapping/filling text. The public interface consists of the wrap() and fill() methods; the other methods are just there for subclasses to override in order to tweak the default behaviour. If you want to completely replace the main wrapping algorithm, you'll probably have to override _wrap_chunks(). Several instance attributes control various aspects of wrapping: width (default: 70) the maximum width of wrapped lines (unless break_long_words is false) <stuff deleted> Break words longer than 'width'. If false, those words will not be broken, and some lines might be longer than 'width'. """ whitespace_trans = string.maketrans(_whitespace, ' ' * len(_whitespace)) unicode_whitespace_trans = {} uspace = ord(u' ') and the text is wrapped fine except that the code that follows is now colored as if it were a string too. However, if I save the file as it now is and re-open it then it comes back colored the way it should be (and it runs OK). Also, if I hit ctrl-Z after a paragraph wrap then the text is restored to its original state, Eclipse thinks that the file is the same as its original state (no * on the tab) but the code is still colored as if it were part of the docstring. This text is part of a largish (>500 line) file and I have not been able to reproduce this problem in a small file. I have put a copy of the file on: http://pilger.googlepages.com/pydevstuff Don. |
From: Fabio Z. <fa...@gm...> - 2006-05-09 15:22:44
|
Hi Don, > > I am using: > offset =3D selection.getAbsoluteCursorOffset() > lineno =3D selection.getLineOfOffset(offset) > line =3D selection.getLine(lineno) > to get the line containing the current cursor position. I then march up > and down the text grabbing lines until I have acquired the 'paragraph' > of text that contains the cursor. PySelection has a 'selectCompleteLine' method that may be what you want... Eventually I replace this paragraph with a reformatted paragraph. In > order to do this I need to figure out the offsets to the first character > of the original paragraph and to the last character of the delimiter on > the last line of the paragraph. Right now I am assuming that I can do > the latter by adding len(selection.getDelimiter(document)) to the last > character offset but this assumes that the delimiter on the last line is > the same size as the document delimiter. Actually, I think you could use the PySelection.deleteLine approach (it checks the offset of the next line to see what it should delete -- if there's a 'next' line). It is possible that this is not true, for example by using a Windows > editor to change a document that originated on Linux. However, I believe > that CPython gets upset if mixed delimiters are used within the same > document so maybe this does not really matter. Maybe, I'm not really sure about this one... In any case, I can use the IDocument method getLineDelimiter() to get > the line delimiter for a specific line, but it looks like you intended > PySelection to be the main interface for Jython extension scripts so > maybe you want add something like this one day. > > BTW. I noticed that PySelection does not have a method > getStartLineOffset(lineno) that would be a pair with > getEndLineOffset(lineno). Not a big deal as it is easy to calculate. Yeah, probably could be done... > > > I actually meant the line number shown at the bottom of the screen in > Eclipse - this line number always starts at 1, which is apparantly > internally known as line 0. So it looks like Eclipse is inconsistent > about starting at 0 or 1. No matter. Oops... Well, yes, Eclipse has one representation for the gui and one for the internal API. -- Fabio |