On 2009-09-04, Reinout van Rees <[email protected]> wrote:
> On 2009-09-04, P.J. Eby <[email protected]> wrote:
>> At 01:58 PM 9/3/2009 -0400, Jim Fulton wrote:
>>>I think the script information should be included somehow so that it
>>>can be gotten from eggs.
>>
>> The original script files get stored in the "EGG-INFO/scripts" directory.
>
> Ok, I got something working based on that info. Thanks! It is in the
> zc.buildout/branches/reinout-scripts branch.  Just run bin/buildout and the
> presence of bin/pyflakes, bin/rst2s5.py and friends demonstrates that it
> works.
>
>
> I'm not sure how robust it is, though.  My main worry is that it probably only
> works OK with unzipped eggs.  "dist.location" is the egg's location:
>
>     scripts_dir = os.path.join(dist.location, 'EGG-INFO', 'scripts')
>     if os.path.exists(scripts_dir):
>         for name in os.listdir(scripts_dir):
>             distutils_scripts.append(
>                 (name, os.path.join(scripts_dir, name)))
>
> So this does a basic os.path.join()... I tried pkg_resources'
> resource_filename() call, but that doesn't work because the egg isn't
> installed yet.  But I might be overlooking something here!  An alternative
> would be to unzip an egg ourselves.

I verified that it doesn't work with zipped eggs.  Are there alternatives for
getting my hand on that listdir of EGG-INFO/scripts/* without unzipping the
egg?  Otherwise I'm in favour of just leaving zipped eggs be.

Reinout

-- 
Reinout van Rees - [email protected] - http://reinout.vanrees.org
Software developer at http://www.thehealthagency.com
"Military engineers build missiles. Civil engineers build targets"

_______________________________________________
Distutils-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to