efficient way for building class browsers.

Sridhar R sridharinfinity at yahoo.com
Wed Feb 11 08:28:02 EST 2004


Josiah Carlson <jcarlson at nospam.uci.edu> wrote in message news:<c04nvs$h6j$1 at news.service.uci.edu>...
> > I am looking for a class browser that has these features.
> 
> Only a browser?  Text or GUI?  What OS?  Any particular GUI toolkit?

   IDE. Linux,Windows,Mac. PyGTK

> > Remember I need a class browser, that also tells me the line no in
> > source code of that symbol. (So compiler module  (ast) can't be used -
> > Is it so? )
> 
> compiler.ast can be used for this, but only produces proper results when 
> the file has no syntax errors.  Don't get me wrong, using the output of 
> compiler.ast can be a pain in the ass, and slow as hell (5 seconds for 
> 100k of source on a celeron 400), but it can be used.
> 
> > Are there any better ways for achieving this?
> 
> You can write a limited parser (subject to certain flaws), one that 
> doesn't use tokenize or compiler.ast, and get pretty fast results.  I 
> wrote one to go into my own editor PyPE (pype.sourceforge.net), and it 
> has no problems parsing a 100k Python source file and displaying the 
> source tree in a GUI in less than 1/2 second on a celeron 400.
> 

   I'll try that.  I have come across tagmanager (C) code written for
the Anjuta (http://anjuta.org) project.  I should give it a try too.

> It wouldn't be too bad to pull the tree portion out, what kind of 
> browser do you need?

   I will put it in brief.  The class browser can't support all
standard and third party python packages, since most of them is
available as shared objects.  So mine is focused only on the current
project, i.e. user created (or application) python files.  So the
browser should be able to fetch the tags (class, functions, methods)
from source code along with the line number information.  That's all
about.  Any further possiblities in this regard is also expected.

>   - Josiah



More information about the Python-list mailing list