searching/viewing Zope source?
On the "eat your own dogfood" principle, I decided today that since -- let's face it -- the Zope Python, DTML, and C source files *are* the definitive documentation -- I ought to index them, and why not with ZCatalog? First, I imported /zope/lib/python into Zope. Which took longer than I expected, mainly because although I remembered having used fsimport.py in Zope 1.x, I could not find it in 2.x, nor in any searchable Zope place I could think of (zope.org, egroups.com, altavista, deja.com, etc.). Fortunately, I found a backup of Zope 1 that had fsimport.py, so I set it up as an external method, made a Zopedir called src, and ran this: http://host/src/fsimport?fsdir=/usr/zope2/lib/python Cool. Now the source tree is in Zope. I added a ZCatalog to the src folder, and told it to add everything. I'd have liked to have added just *.py, *.dtml, and *.c, but none of the strings I could think of typing into the with ids: containing: expr: boxes of the "Find Items to ZCatalog" seemed to find anything. I'm guessing that regexps can be used here somewhere, but none of the usual suspects (zope.org, egroups.com, altavista, deja.com, etc.) yielded any clues. (This, of course, is *why* I was trying to index the source in the first place!) Whatever, I just took the whole lot, 800 and some files. Then tried searching, and realized -- oops, no text index, only a meta_data index. After searching the usual suspects again (zope.org, egroups.....) I came up with the idea of indexing the 'data' attribute of the File objects. But no joy. It's looking like either: a) wrap those files, in some way, so that they have a catalog-able attribute (which I guess means changing fsimport.py?) or b) use a conventional search engine I guess b) sounds easier :-) The reason for all this is that I've begun, finally, to be productive in Zope. I would like to be much more productive. I think one thing that would help me would be something like Mozilla's searchable, cross-referenced source viewer: <http://lxr.mozilla.org/seamonkey/> I wonder if there's a tool like this that groks Python syntax rather than C? -- Jon Udell | <http://udell.roninhouse.com/> | 603-355-8980
Jon Udell wrote:
<http://lxr.mozilla.org/seamonkey/>
I wonder if there's a tool like this that groks Python syntax rather than C?
Jon, though I haven't used the product that generates the cross-reference stuff for Mozilla (lxr), I did search their mailing list and checked out a CVS release. It would appear that lxr (which is written in Perl) does grok Python code (at least minimally), as it includes a language module for Python in the CVS checkout. lxr requires that you set up a relational database of some kind (which I don't have handy at home), so I didn't bother to set it up to try it out. But I suppose it's worth a shot. See http://lxr.linux.no/ -- Chris McDonough Digital Creations, Inc. Zope - http://www.zope.org
FYI: I tried lxr, and it seems unready for cataloging anything but the Linux source at the moment. Very sparse docs (imagine!), and bombs on index creation. Reading the CVS source where it bombs is not easy (no code comments). I am punting. Chris McDonough wrote:
Jon Udell wrote:
<http://lxr.mozilla.org/seamonkey/>
I wonder if there's a tool like this that groks Python syntax rather than C?
Jon, though I haven't used the product that generates the cross-reference stuff for Mozilla (lxr), I did search their mailing list and checked out a CVS release. It would appear that lxr (which is written in Perl) does grok Python code (at least minimally), as it includes a language module for Python in the CVS checkout. lxr requires that you set up a relational database of some kind (which I don't have handy at home), so I didn't bother to set it up to try it out. But I suppose it's worth a shot.
-- Chris McDonough Digital Creations, Inc. Zope - http://www.zope.org
participants (2)
-
Chris McDonough -
Jon Udell