looking for library function browser to run inside (x)emacs

Les Schaffer godzilla at netmeg.net
Mon Apr 24 16:46:56 EDT 2000


I have been using the OOBrowser inside XEmacs for a couple years and
its useful for browsing class hierarchies.

but i find it does not allow for browsing function hierarchies, such
as is found in the [...]/python/site-packages and subdirs.

does anyone know of a package which runs inside emacs allowing to
browse function hierarchies?

by hierarchies, i mean something like all the standalone functions
which reside in modules like so (below site-packages):

scientific/ArrayIO.py           
scientific/Color.py             
scientific/Derivatives.py       
....
Numerical/ArrayPrinter.py   
Numerical/FFT.py           
Numerical/LinearAlgebra.py 
etc...

for example:

>>>
(gustav)/usr/lib/python1.5/site-packages/: cd scientific
(gustav)/usr/lib/python1.5/site-packages/scientific/: grep "^def " ArrayIO.py
def readArray(filename):
def writeArray(a, filename):
def writeDataSets(datasets, filename, separator = ''):
<<<

the problem with OO browser is it seems to only like to catalogue
functions which exit in the so-called system tree -- that is -- the
files one is creating locally for a project. it doesnt catalog modules
(like those listed above) containing class-less functions which exist
in the library hierarchy inside scientific, Numerical, etc.

many thanks for any pointers...

i'm tempted to wrote something myself which grabs __doc__ strings
from the lib hierarchy and arranges/formats them inside an xemacs
buffer. (assuming all functions are suitably doc'ed ;-) but the more
interesting part would be to make the buffer clickable, so if i see a
function i like, i can read it into xemacs and see if it does what i
need and learn how to use it...

i wrote a little script to grep for 'def XXX' strings hard left
in each py file in the site-packages hierarchy:

(gustav)/usr/lib/python1.5/site-packages/: findpydef | wc -l
   3550

thatsalottafunctions!!!

interestingly, not a lot of them are marked module private 

e.g.

def _ummagumma():
   """Careful with that ax, eugene"""

though i am betting a lot __could be__.....

les schaffer

======= how many def's you got??? ====

#!/bin/sh

cd /usr/lib/python1.5/site-packages

PYFILES=`find . -name "*.py"`

for file in $PYFILES; do

  echo "Checking $file ..."
  grep "^def " $file
done  



More information about the Python-list mailing list