[Tutor] advise on this loop

W W srilyk at gmail.com
Thu Jun 4 15:48:12 CEST 2009


On Thu, Jun 4, 2009 at 8:29 AM, Norman Khine <norman at khine.net> wrote:

> Hello,
> I have the following code, which searches through a directory structure
> such as:
>
> $ tree -L 2 companies
> companies
> |-- aberdeen-airport-ltd
> |   |-- aberdeen-airport-dyce-grampian
> |   `-- aberdeen-airport-dyce-grampian.metadata
> |-- aberdeen-airport-ltd.metadata
> |-- aberdeen-motor-company-ltd
> |   |-- mugiemoss-road-grampian
> |   `-- mugiemoss-road-grampian.metadata
>
>
> the code can be seen at:
>
> http://paste.lisp.org/display/81348
>
> I basically have a form, where the user makes a search for 'Company'
> name, than the code searches for all the items that do not contain
> 'hotel' in the metadata
>
> This works for the first level, i.e. when searching in the companies
> directory.
>
> Now I want to extend this to search for the '/companies/company/ but
> to only search the addresses that are in the found = [] list from the
> previous search.


I haven't looked at your code, but I presume your "search" is a function? I
certainly hope so anyway! Also I presume you return the found list? If so,
it should be trivial. If not, you should probably adjust your code to do
such things.

HTH,
Wayne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090604/2ed11063/attachment.htm>


More information about the Tutor mailing list