[Zope-dev] find unused objects: hopefully the last misunderstanding... :o)

THerp@apriori.de THerp@apriori.de
Fri, 30 Aug 2002 15:25:41 +0200


Original problem:
> I have lots of scripts, dtml methods etc. everywhere which are
> perfectly well-known to the ZODB, nothing wrong with that, but which
> are simply not used by me anymore. No usage from other scripts nor
> methods nor documents. And these buggers I'd like to find.

@Steve:

> You forgot to post my suggestions:

Sorry, no offense meant. Here they are:

> You can use Zope Find to get a list of them, and then manually audit
> them. You could instrument such methods to output logging, and check the
> logs every so often to see what is typically being used.

> You could use Zope Find to see if the name of particular methods is used
> within other methods.

Well, I simply liked to know if anyone had already done it, so I simply
forgot to add them.

@ Jean:
> They're impossible to find :))  Take for example the 'index_html' of
> a folder: nothing else in my Zope app refers to it. But whenever
> someone browses to http://my.zopeserver.com/folder they see that
> 'index_html'. No automatic method can guess what objects have become
> irrelevant.

Well, the search seed could be an optional argument w/default value
'index_html'.

> If you want to find everything that isn't refered to by another Zope
> object, you could use 'sitecopy' to make a filesystem copy of
> everything in your ZODB, 'ls -R' to get a list of filenames, and
> 'grep -r filename *' for each filename in the list. If the grep
> returns nothing, nothing refers to that object.
>
> You could do the same kind of thing ('ls -R' and 'grep') from the
> Zope Management Interface using Jerome Alet's zshell.

Interesting suggestions! Of course, these unfortunately won't handle
the acquisition thing correctly.

To dream a dream:

Consider a tab for folderish objects which allows to search them for
unused scripts/methods/... (after pressing a button because it would
possibly take a while), producing a sortable list of links, with
checkboxes for deletion...

Consider a tab for methods... which allows to parse them and produces
a sortable list of links to the other referenced methods...

Maybe I'll write something like that, but it would be my very first
Zope product.

By the way, new question:
Is this the correct mailing list for such suggestions?
If not, which one is it?

Tobias Herp