Re: Confusing code in ObjectManager manage_FTPstat

Jim Fulton <[email protected]> Mon, 31 Oct 2005 10:05:45 -0500
Newsgroups gmane.comp.web.zope.coders
Message-ID <[email protected]>
Sidnei da Silva wrote:
> Found some lovely piece of code deep into the FTP parts of Zope 2 last
> saturday, one of them is truely ugly. It's listing the contents of
> the current and parent folders for no apparent reason (or at least, it
> didn't make sense either to me or Chris McDonough).

There's a comment stating the intent.

> The code in question is in the ``manage_FTPstat`` method of
> ``OFS.ObjectManager``. Tracing back the source of this code, it seems
> to have been (surprisingly) introduced by Jim Fulton, back in
> 1999. [1]
> 
> Later on, Amos Latteier changed part of the code (namely
> ``manage_FTPlist``) to use a slightly more friendlier, yet equally
> confusing ``is_acquired`` method. [2]
> 
> I'm now sitting here, trying to make sense of this code and wondering
> what was the original intention in the first place. Would anyone have
> a clue?

I think the comments make this pretyu clear.  The intent is to avoid
providing listings of acquired objects.  In fact, the intent of both
bits of code, I think is to prevent FTP access to acquired objects.

I suspect that there is a clearer way to implement the intent.

Jim

-- 
Jim Fulton           mailto:[email protected]       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org