Re: [Distutils] pkg_resources: Loading resources in a uniform fashion

2010-10-29 Thread Alan Franzoni
On Fri, Oct 29, 2010 at 5:24 AM, P.J. Eby p...@telecommunity.com wrote:
 PEAK does, but it's even less frequently updated than setuptools.  ;-)
  There may be other things out there as well, I don't know.

I peeked through PEAK, but it's quite a large collection of tools.
Would you point me to a more precise subpackage, please?

-- 
Alan Franzoni
--
contact me at pub...@[mysurname].eu
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] pkg_resources: Loading resources in a uniform fashion

2010-10-29 Thread P.J. Eby

At 12:10 PM 10/29/2010 +0200, Alan Franzoni wrote:

On Fri, Oct 29, 2010 at 5:24 AM, P.J. Eby p...@telecommunity.com wrote:
 PEAK does, but it's even less frequently updated than setuptools. Â ;-)
 Â There may be other things out there as well, I don't know.

I peeked through PEAK, but it's quite a large collection of tools.
Would you point me to a more precise subpackage, please?


peak.naming provides lookup services for URLs and other sorts of 
names; peak.binding provides ways to link object attributes to 
automatically look up relevant objects.  There is very little 
documentation, as the  PEAK core packages were a toolkit I and a 
friend developed for use in our enterprise jobs.


In any case, this is now off-topic for distutils-sig; if you are 
still interested, you should follow up via the PEAK mailing list here:


   http://www.eby-sarna.com/mailman/listinfo/peak



--
Alan Franzoni
--
contact me at pub...@[mysurname].eu


___
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] pkg_resources: Loading resources in a uniform fashion

2010-10-28 Thread P.J. Eby

At 06:18 PM 10/28/2010 +0200, Alan Franzoni wrote:

Hello,

lately I was thinking about writing a kind of factory method for
parsing an url and returning a resource filename or stream, something
like:

fs_resource = load_resource_filename(file:///etc/software/config.conf)
pkg_resource = load_resource_filename(pkg://package.something)

I'd like the first one to just return the file system path
/etc/software/config.conf, while I'd like the second one one to do
something roughly like

from pkg_resources import resource_filename
return resource_filename(package, something)

This way it would be pretty easy to get a consistent way to describe a
resource from a stream.

I've got some questions:

1) is there anything around that already does something like that?


PEAK does, but it's even less frequently updated than 
setuptools.  ;-)  There may be other things out there as well, I don't know.



2) would you think it to be a good addition for pkg_resources, or
would it go beyond its scope?


Way beyond scope.  It makes more sense for it to be part of a url 
management package.



3) can you see some obvious issues?
4) how would you handle requirements string?


___
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig