On Thu, Mar 26, 2009 at 2:37 PM, Barry Warsaw <ba...@python.org> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Mar 26, 2009, at 2:31 PM, Guido van Rossum wrote:
>
>>> One thing that /would/ be helpful though is the ability to list all the
>>> resources under a specific package path.  This is (I think) one use case
>>> that pkg_resource fails to support and it's the one place that I've had
>>> to
>>> drop down to file system introspection.
>>>
>>> Think: the package-y flavor of
>>> os.listdir(os.path.dirname(package.__file__))
>>
>> Good idea. Can I suggest that API this takes a glob-style pattern? (Or
>> to be fully general, a list of patterns and a list of exclusion
>> patterns.)
>
> Good idea.  Thinking back on my typical use cases, a glob style pattern
> would be enough.  Usually I'm asking "give me all the .py files in this
> package" or "I'm looking for the .txt files in this path".

I think shutil.copytree new ignore mechanism handles this use case
pretty well (see the ignore_patterns factory in
http://docs.python.org/library/shutil.html)

Maybe we could use the same pattern.

Tarek
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to