is anyone using return_folders in tools.Walk()?

Ryan Barrett <pyblosxom-6sb6M7qyT/[email protected]>
Newsgroups gmane.comp.web.pyblosxom.devel
Message-ID <[email protected]>
hi all! is anyone using the optional return_folders parameter in the 
tools.Walk() function? i'm considering a non-backward compatible change. i 
found a couple uses on the web, beloq, and i've cc'ed their authors. i figured 
i'd check here too.

return_folders defaults to false, which returns only files. if it's set to 
true, only directories are returned. i'm planning to extend it so that both 
files and directories can be returned. that's possible now by calling Walk 
twice, but that stats all of the directories and folders twice, which is 
inefficient. if you don't use a filestat cache, it can be noticeable on large 
sites.

i'm considering adding an optional return_files parameter, defaulting to true. 
callers could set return_files and return_folders independently to control 
whether files, directories, or both are returned.

the incompatibility would only affect code that calls tools.Walk() with 
return_folders=True (or 1). currently, it returns only directories. with this 
change, it would return both files and directories.

so far, i've only found one plugin, pylists, that does this. i've cc'ed its 
author. regardless, let me know if you have any concerns!

current uses:
http://persson.cx/pyblosxom/code/pyblosxom/pylists.html
http://copia.ogbuji.net/files/latest_comments.py

-Ryan

--
http://snarfed.org/

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.